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
23
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
240
Integration testing with TestСontainers and JUnit 5
nikolayk812
0
160
TestContainers + JUnit 5 = elegant integration and e2e tests for microservices
nikolayk812
2
340
Integration and end-to-end testing with TestСontainers
nikolayk812
0
110
Other Decks in Programming
See All in Programming
Benchmark
sysong
0
250
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
710
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
童醫院敏捷轉型的實踐經驗
cclai999
0
180
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
270
GoのGenericsによるslice操作との付き合い方
syumai
3
680
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
310
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
350
Webからモバイルへ Vue.js × Capacitor 活用事例
naokihaba
0
760
Is Xcode slowly dying out in 2025?
uetyo
1
190
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Speed Design
sergeychernyshev
32
1k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
YesSQL, Process and Tooling at Scale
rocio
173
14k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Thoughts on Productivity
jonyablonski
69
4.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
The Language of Interfaces
destraynor
158
25k
Code Reviewing Like a Champion
maltzj
524
40k
Navigating Team Friction
lara
187
15k
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