Integration and end-to-end testing with TestContainers-Go
summary
Shows TestContainers-Go spinning real Docker Postgres and Redis, building service images from Dockerfiles, wiring a shared Docker network and calling services over internal URLs; demos run unit-style integration tests and an end-to-end scenario with two services plus databases. Uses the docker client, exposes random host port mapping to avoid conflicts, demonstrates waiting strategies and built-in cleanup via a registry sidecar, builds images on each run, and the demos complete successfully with containers removed afterward.
AI-written summary · about
chapters (10)
- 0:00Introduction to TestContainers-Go
- 1:06Why integration tests matter
- 5:42Challenges with manual Docker setups
- 8:20How TestContainers-Go solves issues
- 14:47Demo: Basic Postgres integration
- 19:30Demo: End-to-end testing setup
- 28:33Demo: Running multi-service tests
- 35:28Q&A on database management
- 37:37Q&A on environment complexity
- 40:15Q&A on resource usage
