~/talk

From mocking to rocking your tests with testcontainers

Talkat PyData Amsterdam 2024 · 2024-09-18..09-20· [testing, devops-and-delivery]
links:none on file
slides:none on file

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

  1. 0:00Welcome
  2. 1:12Speaker and Testcontainers
  3. 2:36Mission and stroke workflow
  4. 7:20Integration testing challenges
  5. 9:50What are testcontainers and how they work
  6. 11:43Docker garbage collection with Ryuk
  7. 12:05Mocking vs real dependencies
  8. 16:03Redis integration demo
  9. 18:52Performance and fixture optimization
  10. 20:19Replacing cloud dependencies
  11. 22:06Unsupported cloud services
  12. 23:29Storage and state testing
  13. 24:57Advantages and disadvantages of testcontainers
  14. 27:48Debugging tips
  15. 28:11Summary and when to use
  16. 28:55Q&A: Container state
  17. 30:40Q&A: Database testing
  18. 32:28Q&A: Integration tests
  19. 33:54Q&A: Stability and realism
  20. 35:18Q&A: Version control
  21. 36:24Closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.