From mocking to rocking your tests with testcontainers
summary
Claim: testcontainers spins real Docker services from pytest so tests hit actual Redis Kafka MinIO emulators rather than pure mocks. Live demo uses a Redis container with ~4s startup, shows session-scoped fixtures cut repeated-start overhead, and a wrapper called TC‑nuts (Kafka helper) that the team builds and reuses in Go and Python. Limits: Google Cloud Storage needs a partial emulator so some mocking remains, complex seeded state and CI Docker security add friction, but blackbox feedback loops get noticeably faster.
AI-written summary · about
chapters (21)
- 0:00Welcome
- 1:12Speaker and Testcontainers
- 2:36Mission and stroke workflow
- 7:20Integration testing challenges
- 9:50What are testcontainers and how they work
- 11:43Docker garbage collection with Ryuk
- 12:05Mocking vs real dependencies
- 16:03Redis integration demo
- 18:52Performance and fixture optimization
- 20:19Replacing cloud dependencies
- 22:06Unsupported cloud services
- 23:29Storage and state testing
- 24:57Advantages and disadvantages of testcontainers
- 27:48Debugging tips
- 28:11Summary and when to use
- 28:55Q&A: Container state
- 30:40Q&A: Database testing
- 32:28Q&A: Integration tests
- 33:54Q&A: Stability and realism
- 35:18Q&A: Version control
- 36:24Closing
related talks
26mSimplify Your Dev Life with Testcontainers
01h 03mMocks vs Testcontainers
53mTestcontainers: a year-in-review
43mRemoving complexity from integration tests using Testcontainers!
24mIntegration Testing Made Easy: Leveraging Testcontainers and
47mIntegration Tests: testcontainers to the Rescue
32mMock my infrastructure! Using Testcontainers for better integration tests.
46mRemoving complexity from integration tests using Testcontainers!
