Running Docker-Based Integration Tests in Scala: A Case Study
summary
Compares sbt-docker-compose and testcontainers-scala using a tiny Scala HTTP app that listens on port 8080. Finds sbt plugin starts containers faster and reuses them across suites but forces duplicated Docker Compose config, lacks readiness checks (requiring eventual retries) and is brittle; Testcontainers is slower per test but offers fine‑grained container definitions, built‑in readiness strategies, typed access to mapped ports and reusable container classes, leading to far cleaner, more maintainable integration tests. Continuous migration to Testcontainers proves practical.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:26Why is testing so important
- 3:50The testing pyramid
- 4:51Endtoend testing
- 6:11Docker images
- 7:31Different approaches
- 10:26Case study
- 11:10SBT compos
- 12:33Running a single test
- 16:05Testing Switch
- 19:04Testing Suite
- 21:42Test Containers
- 23:00Test Container Flow
- 23:56Container Definition
- 26:12Test Class
- 26:50Test Case
- 27:57Conclusion
related talks
40mScala, Docker and Testing oh my!
51mTestContainers: Integration Testing Without the Hassle
30mIntegration tests & testContainers
47mIntegration Tests: testcontainers to the Rescue
48mContainers for Real Integration Tests
15mTestcontainers: Simplify Your Integration Tests and Development
52mIntegration tests are needed and simple
30mUsing Docker & Compose to Simplify Integration Testing
