Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Integration and end-to-end testing with TestСon...
Search
Nikolay Kuznetsov
June 26, 2019
Programming
0
29
Integration and end-to-end testing with TestСontainers
Nikolay Kuznetsov
June 26, 2019
Tweet
Share
More Decks by Nikolay Kuznetsov
See All by Nikolay Kuznetsov
Integration testing with TestСontainers-Go
nikolayk812
0
130
Integration testing with TestContainers-Go
nikolayk812
0
260
Integration testing with TestСontainers and JUnit 5
nikolayk812
0
170
TestContainers + JUnit 5 = elegant integration and e2e tests for microservices
nikolayk812
2
350
Integration and end-to-end testing with TestСontainers
nikolayk812
0
120
Other Decks in Programming
See All in Programming
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
150
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
480
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
320
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.9k
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
150
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
510
ThorVG Viewer In VS Code
nors
0
500
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
230
SQL Server 2025 LT
odashinsuke
0
110
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
220
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
470
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
KATA
mclloyd
PRO
33
15k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
150
Amusing Abliteration
ianozsvald
0
79
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
120
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
360
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
39
HDC tutorial
michielstock
1
280
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
210
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
170
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
0
980
Transcript
Integration and end-to-end testing with TestСontainers Nikolay Kuznetsov @nikolayk812 ContainerDays,
Hamburg, 26 June 2019
About me • Go developer at Zalando Helsinki • Java
developer at Infobip, DevExperts • C developer at Samsung, Motorola
Why integration testing?
Trade-offs Test Runtime
Integration testing evolution • In-memory mocking • Local DBs •
Vagrant • Docker, Docker Compose • Docker API
How to start Docker containers for integration test? • Shell
scripts • Maven plugin • Docker Compose • … • MiniKube, Kubernetes
Shell scripts
Maven plugins github.com/fabric8io/docker-maven-plugin
Docker Compose
None
TestContainers • github.com/testcontainers/testcontainers-java • Wraps docker-java library • Docker environment
discovery • Host port randomization • Containers clean up on JVM shutdown • Waiting strategies
As simple as static PostgreSQLContainer postgres = new PostgreSQLContainer(); static
GenericContainer redis = new GenericContainer("redis:5.0.5") .withExposedPorts(6379);
Docker environment discovery
Host port randomization • To prevent port conflicts • Enables
parallel builds • API to get a host port
Containers cleanup https://github.com/testcontainers/moby-ryuk
Waiting strategies
Demo github.com/nikolayk812/cd-tc-demo
Why end-to-end testing? • Test business flows which go through
multiple microservices before production deployment • Replace a legacy service with a new implementation, make sure business flows hold
E2E setup Item Service User Service Spring Cloud Netflix Eureka
None
Demo github.com/nikolayk812/cd-tc-demo
Hints • Host port forwarding Testcontainers.exposeHostPorts() • Fixed host port
for remote debug GenericContainer.addFixedExposedPort() • Disable Ryuk set env TESTCONTAINERS_RYUK_DISABLED=true
Alternatives to E2E testing Goal is to minimize chances of
breaking production • Staging environments Handling team boundaries? • Canary deployment • Contract testing Spring Cloud Contract
Modules • 10+ DB modules • MockServer • LocalStack =
Atlassian’s local AWS cloud stack • Toxiproxy • Kafka
Takeaways • https://testcontainers.org • Balance between flexibility, speed and features
• Works on Mac, Linux, Windows
Thank you! @nikolayk812 nikolayk812