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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nikolay Kuznetsov
June 26, 2019
Programming
37
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Integration and end-to-end testing with TestСontainers
Nikolay Kuznetsov
June 26, 2019
More Decks by Nikolay Kuznetsov
See All by Nikolay Kuznetsov
Integration testing with TestСontainers-Go
nikolayk812
0
140
Integration testing with TestContainers-Go
nikolayk812
0
280
Integration testing with TestСontainers and JUnit 5
nikolayk812
0
180
TestContainers + JUnit 5 = elegant integration and e2e tests for microservices
nikolayk812
2
380
Integration and end-to-end testing with TestСontainers
nikolayk812
0
130
Other Decks in Programming
See All in Programming
VibeCodingからAgenticWorkflowへ
starfish719
0
880
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
240
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
T3DD26: From RAGs to Riches
martinhelmich
0
100
Hono + Inertia + React で LP を構築した話
oukayuka
2
170
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
500
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3k
仕様駆動開発の消費期限
watany
20
9k
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.7k
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
650
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
550
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
620
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
Color Theory Basics | Prateek | Gurzu
gurzu
0
440
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
480
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
300
Designing for humans not robots
tammielis
254
26k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Bash Introduction
62gerente
615
220k
It's Worth the Effort
3n
188
29k
Scaling GitHub
holman
464
140k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
900
A Modern Web Designer's Workflow
chriscoyier
698
190k
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