docker в автоматизации тестирования
TRANSCRIPT
1CONFIDENTIAL
Docker in automated testing
November 6, 2016
2CONFIDENTIAL
SPEAKER NAME
Andrei Varabyeu
EPAM Systems, Solution Architect
Architect and Key Developer of ReportPortal 5 years with EPAM and 7 years in ITAreas: Software Development and Automated TestingTechnologies: JVM-based stack
3CONFIDENTIAL
• Why containers?• Problems they solve• Automated testing perspective
AGENDA
4CONFIDENTIAL
• How to use docker (CLI, docker-compose) • Dockerfiles• Docker networking
NOT NOW
5CONFIDENTIAL
Why?
6CONFIDENTIAL
–Engineers need to spend time on setting up local environment which is not productive
–Setting up new environment is expensive
– Integration problems with different Operating Systems
–Building different app packs for different environments
Environment problems
7CONFIDENTIAL
Problem: Tester’s perspective
STAG
ING
8CONFIDENTIAL
Welcome to Hell
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Development VM QA Server Single Prod
Server Onsite Cluster Public Cloud Contributor’s laptop
Customer Servers
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Source: http://www.slideshare.net/dotCloud/why-docker
9CONFIDENTIAL
Welcome to Hell
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Source: http://www.slideshare.net/dotCloud/why-docker
10CONFIDENTIAL
1950x: Cargo Hell
Multiplicity of goods
Multipilicity of methods for
transporting/storing
Do I worry about how goods interact (e.g. coffee beans
next to spices)
Can I transport quickly and smoothly
(e.g. from boat to train to truck)
Source: http://www.slideshare.net/dotCloud/why-docker
11CONFIDENTIAL
Malcom McLean
12CONFIDENTIAL
Solution: Intermodal Shipping Container
…in between, can be loaded and unloaded, stacked, transported efficiently over long distances, and transferred from one mode of transport to another
A standard container that is loaded with virtually any goods, and stays sealed until it reaches final delivery.
Source: http://www.slideshare.net/dotCloud/why-docker
13CONFIDENTIAL
Malcom McLean
• Massive reduction in losses due to theft or damage
• Huge reduction in freight cost as percent of final goods (from >25% to <3%)
• 90% of all cargo now shipped in a standard container
• Order of magnitude reduction in cost and time to load and unload ships
Source: http://www.slideshare.net/dotCloud/why-docker
14CONFIDENTIAL
Docker is a shipping container system for code
Development VM QA
serverPublic Cloud
Contributor’s laptopProduction
ClusterCustomer Data
Center
Static website
User DB
Analytics DB
Queue
Web frontend
DevOps: Configure Once, Run Anything
Developer/QA: Build Once, Run Anywhere
Source: http://www.slideshare.net/dotCloud/why-docker
15CONFIDENTIAL
What it means?
Engineer can setup environment and start creating the value within 5 minutes
Each Engineer. You don’t need to be an expert in DevOps
16CONFIDENTIAL
Docker vs Virtual Machine
Source: https://www.docker.com/what-docker
17CONFIDENTIAL
Docker container anatomy
18CONFIDENTIAL
Docker: how to build selenium server
Docker
19CONFIDENTIAL
How?
20CONFIDENTIAL
Automation perspective
• Start fresh environment• Test Initial Scripts• Test DB Update Scripts
• Perform disaster recovery testing• Perform DVT tests• Easy access to application logs
21CONFIDENTIAL
Automation perspective
Tests
App 1 App 2
Docker
REST API
API Clientdocker-compose CLI
22CONFIDENTIAL
Fresh Environment Scenario
[PRE] Deploy Test
[POST] Shutdow
n
Wait until SUT is UP
23CONFIDENTIAL
Disaster Recovery Scenario
[PRE] Deploy
Check
Shutdown smth
Check
[POST] Shutdow
n
24CONFIDENTIAL
DVT Tests
Gateway / Load Balancer
UI Service
API Service
XXX Service…
API Service
[2]
Internal Network
DVTTests
25CONFIDENTIAL
Availability Tests
Gateway / Load Balancer
UI Service
API Service
XXXService…
API Service[2
]
26CONFIDENTIAL
Thank you!
28CONFIDENTIAL
THANKYOU