Say it works on my machine one more time… I dare you! Oleg Šelajev

What actually drives productivity?

What actually drives productivity? The developer-centric approach to measuring and improving productivity. Abi Noda, DX Margaret-Anne Storey, University of Victoria Nicole Forsgren, Microsoft Research Michaela Greiler, DX / / https: queue.acm.org/detail.cfm?id=3595878

Feedback flows

Cognitive load

Flow state

Oleg Šelajev Developer relations

Tests are essential

Great tests improve Feedback loops Flow state Cognitive load

With bad tests nothing will help your developer productivity*

❌ Can’t run locally Break on changes Flaky runs Slow pipelines

✅ Novel Reproducible Significant

How to do tests?

e2e Integration tests Unit tests

Integration Testing transformation over the years Timeline Mocking Local DBs VMs (Vagrant)

Integration Testing transformation over the years Timeline Docker Docker Compose Docker API

• Container lifecycle & cleanup • Container & service configuration • Integration with frameworks or tests

• Container lifecycle & cleanup • Container & service configuration • Integration with frameworks or tests

Testcontainers-java • Created 7 years ago (Docker is 8 years old) • github.com/testcontainers/testcontainers-java • Uses docker-java API • Integrates with frameworks, like Spring, JUnit • Works with anything that runs in a Docker container

Growing ecosystem of modules

testcontainers.com/modules

testcontainers.com/modules

Why are Testcontainers - 🏆🏆🏆 ● Flexible lifecycle API: isolation vs convenience ● Capable of abstractions (modules) ● Waiting strategies ● Complex network topologies ● Automatic cleanu p ● Everything is dynamic allowing parallelisation

🏆🏆🏆 Feels like a unit, reliable like integration

Environment parity

Dev Prod

Dev CI Prod

● Using Docker-in-Docker (DinD) ● Testcontainers Cloud setup ● Parallelisation https://www.atomicjar.com/2023/01/running-testcontainers-tests-on-gitlab-ci/

Parallelization ● Surefire plugin ○ parallel=classes ○ forkCount=N ○ reuseForks=true ● Showcase ○ github.com/testcontainers/testcontainers-showcase https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html

Local development environment with SpringBoot 3.1 https://docs.spring.io/spring-boot/docs/3.1.0-SNAPSHOT/reference/htmlsingle/#features.testing.testcontainers.at-development-time

What’s next? — testcontainers.com — testcontainers.cloud — slack.testcontainers.org