Scala, Docker and Testing oh my!
summary
Uses Docker to run lightweight stubs of downstream services, ties image creation into the build with sbt-docker integration, and orchestrates per-suite containers with docker-it-scala per-suite orchestration so tests start only the resources they need. Builds simple WireMock-style stubs in containers, measures behaviour with ApacheBench, and reports that end-to-end integration cycles fall from about two hours to ten minutes. Results include reproducible test fixtures, performance curves and business-relevant capacity numbers.
AI-written summary · about
chapters (33)
- 0:00Intro
- 0:55Agenda Introduction to Docker
- 1:35Intro to Docker
- 1:48Virtual Machines
- 3:34Enter Docker
- 4:59Background: Our Service
- 6:12Dependency Nightmares
- 6:41Isolation is Key
- 7:09Decompose the Monolith
- 8:01Identify Services we are Dependent Upon
- 9:47Stub the Contract
- 11:22Run your Tests
- 12:25Dockerizing Scala
- 12:35Normal Docker flow
- 14:13Integrating Docker with sbt
- 15:05Setting the Image Name
- 16:59Configuring the Dockerfile
- 18:11Creating and Publishing the Image
- 19:38Integration Testing with Docker
- 20:54Container Orchestration during Tests Orchestration platforms
- 21:41Using the Docker Java API
- 22:45Using reactive-docker
- 23:32Caveats and Recommendations
- 24:46Introducing docker-it-scala
- 25:57Defining a Resource Container
- 26:16Defining Resource Container (Neo4j)
- 27:08Defining Resource Container (PostgreSQL)
- 27:56Writing Your Tests
- 28:44What Did We Achieve?
- 29:03The Effect
- 31:09Performance measurements (from Stubbed Tests)
- 35:04Summary
- 36:13Acknowledgements & Notes
related talks
30mRunning Docker-Based Integration Tests in Scala: A Case Study
42mUse Docker to test microservices
48mUsing Docker for Testing Legacy Code
56mWrite Tests That Spark Flow
30mUsing Docker & Compose to Simplify Integration Testing
30mTest as You Run - Production-like Integration Tests with Docker
42mScalaWebTest - integration testing made easy
34mWrite tests that spark flow
