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
Scrum Gathering Rio 2016 - Containerizing Tests...
Search
Stefan Teixeira
June 24, 2016
Programming
0
60
Scrum Gathering Rio 2016 - Containerizing Tests with Docker Compose
Stefan Teixeira
June 24, 2016
Tweet
Share
More Decks by Stefan Teixeira
See All by Stefan Teixeira
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
stefanteixeira
0
79
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
110
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
63
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
48
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
42
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
120
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
80
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
68
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
59
Other Decks in Programming
See All in Programming
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
230
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
870
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
820
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
260
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
140
iOS開発におけるCopilot For XcodeとCode Completion / copilot for xcode
fuyan777
1
1.2k
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
330
バグを見つけた?それAppleに直してもらおう!
uetyo
0
210
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
200
テストケースの名前はどうつけるべきか?
orgachem
PRO
1
180
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Music & Morning Musume
bryan
46
6.3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
97
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Writing Fast Ruby
sferik
628
61k
How STYLIGHT went responsive
nonsquared
96
5.3k
Facilitating Awesome Meetings
lara
50
6.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Transcript
Containerizing Tests with Docker Compose Stefan Teixeira @stefan_teixeira
[email protected]
stefanteixeira.com.br
stefanteixeira.com
• QA Automation Engineer @ Toptal • Technical blogs: stefanteixeira.com.br
(pt-br) / stefanteixeira.com (en) • Co-organizer of DevOps Carioca and Grupo de Testes Carioca meetups Links: • E-mail:
[email protected]
• Twitter: twitter.com/stefan_teixeira • LinkedIn: linkedin.com/in/stefanteixeira • GitHub: github.com/stefanteixeira • SlideShare: slideshare.net/stefanteixeira About
Docker Compose
Docker Compose • Tool for defining and running multi-container applications
https://docs.docker.com/compose/
Docker Compose • Tool for defining and running multi- container
applications • Previously known as Fig https://docs.docker.com/compose/
Docker Compose • Tool for defining and running multi- container
applications • Previously known as Fig • YAML ❤ https://docs.docker.com/compose/
Compose File (v1)
Compose File (v2)
Containerizing Tests with Docker Compose
WAT?
Containers != mini-VMs https://twitter.com/rhein_wein/status/662995114235678720
Motivation
#1 If tests (except unit tests) are hard to run
locally, developers will not run them. ¯\_(ϑ)_/¯
#2 Sometimes it’s really hard to configure a test environment.
“Docker delivers a predictable, reproducible testing environment.” (Laura Frank, Codeship)
❤
Examples
App A
App A DB
App A DB Mock Service
App A DB Mock Service API Tests
App A DB Mock Service API Tests UI Tests
App A DB Mock Service API Tests UI Tests Security
Tests
App A DB Mock Service API Tests UI Tests Security
Tests Smoke Tests
Demo
Demo • Very simple example, with three containers: • App
(a REST API) • DB (MongoDB database) • API Tests (written with Supertest) • https://github.com/stefanteixeira/demo-testing- compose
Points of attention • Logs
Points of attention • Logs • volumes or data containers
Points of attention • Logs • volumes or data containers
• Startup time
Points of attention • Logs • volumes or data containers
• Startup time • netcat (nc), curl, wait-for-it, wait_for module (Ansible)
Points of attention • Logs • volumes or data containers
• Startup time • netcat (nc), curl, wait-for-it, wait_for module (Ansible) • Generating images
Points of attention • Logs • volumes or data containers
• Startup time • netcat (nc), curl, wait-for-it, wait_for module (Ansible) • Generating images • Alpine-linux, Phusion (minimal base images)
Points of attention • Logs • volumes or data containers
• Startup time • netcat (nc), curl, wait-for-it, wait_for module (Ansible) • Generating images • Alpine-linux, Phusion (minimal base images) • Automate the process
References • "Stop Being Lazy and Test Your Software”: •
https://www.youtube.com/watch?v=Mx1Il9wIepw • http://www.slideshare.net/rheinwein/stop-being-lazy-and-test- your-software • https://hharnisc.github.io/2016/06/19/integration-testing-with-docker- compose.html • https://docs.docker.com/compose/startup-order/ • https://github.com/vishnubob/wait-for-it • https://www.ansible.com/blog/six-ways-ansible-makes-docker- compose-better
Thanks! Stefan Teixeira @stefan_teixeira
[email protected]
stefanteixeira.com.br stefanteixeira.com