Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
62
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
82
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
110
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
67
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
54
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
45
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
130
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
84
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
74
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
61
Other Decks in Programming
See All in Programming
connect-python: convenient protobuf RPC for Python
anuraaga
0
390
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
600
sbt 2
xuwei_k
0
260
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
愛される翻訳の秘訣
kishikawakatsumi
1
310
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
210
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
FluorTracer / RayTracingCamp11
kugimasa
0
220
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
8
1.1k
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
320
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
RailsConf 2023
tenderlove
30
1.3k
Six Lessons from altMBA
skipperchong
29
4.1k
Speed Design
sergeychernyshev
33
1.4k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Typedesign – Prime Four
hannesfritz
42
2.9k
Producing Creativity
orderedlist
PRO
348
40k
It's Worth the Effort
3n
187
29k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Scaling GitHub
holman
464
140k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
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