dockerizedautomated tests: profit and principles · 2019. 4. 26. · agenda what docker is...
TRANSCRIPT
Dockerized automated tests: profit and principles
IT Weekend Dnipro: Automation Testing and Business Analysis
Dmytro Serdiuk
Who am I
Dmytro Serdiuk
Test automation architect at SOFTSERVE
2
Agenda
What Docker isDocker and test automationWhy dockerized automated testsPrinciples of dockerization
3
Concept
4
Containers benefits
LIGHTWEIGHT
STANDARD
SECURE
5
6
Test infrastructure: Selenium Grid
7
8
Docker + Selenium Grid
https://github.com
/SeleniumHQ/docker-selenium
/aerokube/selenoid9
Idea
10
Motivation
Environment issues
Parallel execution
Collaboration speed
11
Steps
Make tests configurable
Create Docker image
Document usage
12
Principal Dockerfile
FROMmaven:3.5-jdk-8-slim
13
Dockerfile: Base image selection
Minimal sizeAlways specify tag
maven:3.5-jdk-8-slimUse your own base image
Pre-installed toolsUnder your control
14
Principal Dockerfile
FROM maven:3.5-jdk-8-slimCOPY . .RUN mvn dependency:go-offline
15
Dockerfile: Tests installation
Minimize image sizeOnly needed toolsNo cache
Add metadata LABEL, VOLUME
Keep your files separatelyWORKDIR
16
Principal Dockerfile
FROM maven:3.5-jdk-8-slimCOPY . .RUN mvn dependency:go-offlineENTRYPOINT ["mvn --offline"]CMD ["test"]
17
Dockerfile: Run configuration
Make ready-to-run imagesENTRYPOINT ["mvn --offline"]
Define default run optionsCMD ["mvn –offline test -Dapi=calc-service"]
Use wrapper scriptENTRYPOINT ["./run.sh"]
18
Tests configuration
Files sharing with VOLUMEs
Image’s argument
Environment variables
19
Multi-container apps
Play with custom networks
Use docker-compose or other
orchestrator
20
21
Demo project
https://github.com/extsoft/jcat
22
Summary
SUT
Test infrastructure
Tests execution
23
Q & A
24