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 Portugal 2016 - Containerizing ...
Search
Stefan Teixeira
December 01, 2016
Programming
0
79
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
Talk presented at Scrum Gathering Portugal 2016, in 2016/12/01
Stefan Teixeira
December 01, 2016
Tweet
Share
More Decks by Stefan Teixeira
See All by Stefan Teixeira
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
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
65
Other Decks in Programming
See All in Programming
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
360
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
980
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
820
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
200
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
870
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
360
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
140
HTML/CSS超絶浅い説明
yuki0329
0
160
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
670
Zoneless Testing
rainerhahnekamp
0
150
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1k
선언형 UI에서의 상태관리
l2hyunwoo
0
250
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Producing Creativity
orderedlist
PRO
343
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Speed Design
sergeychernyshev
25
720
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Adopting Sorbet at Scale
ufuk
74
9.1k
Transcript
Containerizing Tests with Docker Stefan Teixeira @stefan_teixeira
[email protected]
• QA Automation Engineer @ Toptal • Blogs: stefanteixeira.com.br (pt-br)
/ stefanteixeira.com (en) Contact: • E-mail:
[email protected]
• Twitter: twitter.com/stefan_teixeira • LinkedIn: linkedin.com/in/stefanteixeira • GitHub: github.com/stefanteixeira • SlideShare: slideshare.net/stefanteixeira About me
None
VMs x Containers https://www.docker.com/whatisdocker
Why?
Why? • Reprodutibility
Why? • Reprodutibility
Why? • Scalability
Why? • Scalability
Why? • Containers are (really) fast
Why? • Containers are (really) fast
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
Containerizing Tests with Docker
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
https://hub.docker.com/u/selenium/
Demo
Demo • Very simple example, with three containers: • App
(a REST API written in Node.js) • 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 • wait-for-it, netcat (nc), curl, wait_for module (Ansible)
Points of attention • Building images
Points of attention • Building images • minimal base images:
Alpine-linux, Phusion
Points of attention • Building images • minimal base images:
Alpine-linux, Phusion • 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
Stefan Teixeira @stefan_teixeira
[email protected]
Thanks!