Integration Testing with TestContainers-Go
summary
TestContainers-Go uses the official Docker Go client to spin up throwaway containers so tests run against a real database instead of mocks, with random host port assignment to avoid conflicts and enable parallel builds. A small reaper container automatically cleans up labeled test containers to prevent resource leaks. Built-in readiness waiting strategies (HTTP, SQL, host port, payload or custom checks) remove flaky sleep logic and make integration tests reliable and repeatable.
AI-written summary · about
chapters (10)
- 0:00Intro
- 0:32Basic integration test
- 0:46Getting a database for testing
- 0:59Docker advantages
- 1:19Integration testing with Docker
- 1:40What could go wrong?
- 2:42Docker API
- 2:54Exec example
- 4:39Waiting strategies
- 5:09Host port waiting strategy
related talks
47mIntegration Tests: testcontainers to the Rescue
20mTest Me Up, Before You Go-Go
51mTestContainers: Integration Testing Without the Hassle
48mContainers for Real Integration Tests
15mTestcontainers: Simplify Your Integration Tests and Development
52mIntegration tests are needed and simple
24mIntegration Testing Made Easy: Leveraging Testcontainers and
47mHow to make a world-class integration testing library?
