Removing complexity from integration tests

e2e Integration tests Unit tests By Unknown author - U.S. Army Photo, Public Domain, https://commons.wikimedia.org/w/index.php?curid=55124

Microservices Testing Honeycomb https://labs.spotify.com/2018/01/11/testing-of-microservices/

Oleg Šelajev Developer relations @shelajev github.com/shelajev oleg@atomicjar.com

https://martinfowler.com/bliki/IntegrationTest.html

https://martinfowler.com/bliki/IntegrationTest.html

https://martinfowler.com/bliki/IntegrationTest.html

• Process isolation • FileSystem, Network • CPU/memory limits

• Con guring multiple services simultaneously • Flexibility in creating test data or use-cases • Separation of production & test environments • Dynamic con guration of external mappings • Parallel deployments fi fi 😓

testcontainers.org

Testcontainers • Created 7 years ago • github.com/testcontainers/testcontainers-java • Uses docker-java API • Automatic Docker environment discovery • Automatic cleanup

We think it’s a useful default option for creating a reliable environment for running tests. … Our teams have consistently found this library of programmable, lightweight and disposable containers to make functional tests more reliable. https://www.thoughtworks.com/en-us/radar/languages-and-frameworks/testcontainers

Downloads

Unique IPs

Show me the code

Model: record Rating (String talkId, Integer value) {}

What’s next? Reusable containers Networks for more complex topologies Custom startup & waiting strategies Creating images on-the- y fl fi Logs, les, commands, limits…

What to do if you have no Docker?

Docker environments https://www.atomicjar.com/2021/10/docker-on-windows-and-macos

Testcontainers Cloud testcontainers.cloud

What’s next? — www.testcontainers.org — github.com/testcontainers/testcontainers-java ! — github.com/testcontainers/workshop

Thanks!