SlideShare a Scribd company logo
Run automated tests in Docker
Run automated tests in Docker
Oleksandr Metelytsia
5 December 2017, Kyiv
About me
Senior Test Automation Engineer in SoftServe
8+ years experience in software testing on different projects
Agenda
●Problem statement
●Docker to the rescue
●“Hello world” with Docker
●Tips and Tricks
●Q&A
Works on my machine (c)
●OS differences between CI and local run
●python versions
●selenium and browser versions
●dependencies versions
●environment specific issues
●tools and libraries versions
●...
Possible reasons
Docker to the rescue
Docker containers wrap a piece of software in
a complete filesystem that contains
everything needed to run: code, runtime,
system tools, system libraries – anything that
can be installed on a server. This guarantees
that the software will always run the same,
regardless of its environment.
Docker
● docker != Virtual Machine like VirtualBox ov VMWare
● docker != configuration management like Chef or Puppet
● Encapsulates an app and all it dependencies including OS
into a single object called container
● Gives portable deployment across machines
● Works on Mac, Linux, Windows
● Multi-container orchestration with docker-compose
Docker diagram
Enough theory. Let’s code.
Step0.
Install docker and docker-compose
Hello world
Our dependencies
Dockerize the app
Build and test container
The dependency
Not so easy to setup Redis in an identical way every
time in a traditional environment.
But easy with Docker
Build and run
Test application
Create test case
Test dependencies: Firefox47 and requirements.txt
Test run:
Headless mode: xvfb
Xvfb or X virtual framebuffer
is a display server which
performs all graphical operations
in virtual memory without
showing any screen output.
Headless mode: xvfbwrapper
xvfbwrapper is a python wrapper for controlling Xvfb.
Let’s use xvfbwrapper
Create test environment
Build and test container
Test env Docker-compose yaml
Run pipeline
We are ready for Continuous Integration!
● very few commands to run in CI
● simple agents setup
● easy to maintain dependencies
● clear external services configuration
● the same local and CI envs
● fast dev-loop
● multi-environmental
Will this work on Windows7?
Tips & Tricks: Docker registry
The Registry is a stateless, highly scalable server side
application that stores and lets you distribute Docker images.
You could run your own private registry or use Docker Hub.
Tips & Tricks: CI your docker images
1.Put Dockerfiles under version control
2.Create CI plans to build and push images
3.Trigger plans on repo commit
4.Profit
Tips & Tricks: Official repositories
Thanks to Docker and Docker-Compose we automated:
● build of application (Dockerfile)
● deploy of a local environment (docker-compose.yml)
● build of a testing image (Dockerfile.test)
● tests execution (docker-compose.test.yml) for an application
Conclusions: 1
Advantages of using the docker-compose.test.yml file for testing:
● Automatable: the way a tool executes the docker-compose.test.yml is
independent of the application under test
● Light-weight: hundreds of external services can be deployed on a single
host, simulating complex test environments
● Agnostic: avoid CI provider lock-in, and your tests can run in any
infrastructure and on any OS which supports Docker
● Immutable: tests passing on your local machine will pass in your CI tool
Conclusions: 2
Conclusions: 3
Oleksandr Metelytsia
ometel@softserveinc.com
metelitsa.alexandr@gmail.com
Q&A

More Related Content

What's hot (20)

PDF
The Fairy Tale of the One Command Build Script
Docker, Inc.
 
PDF
Docker and DevOps --- new IT culture
Terry Chen
 
PDF
Docker for dev
Erik Talboom
 
PDF
Azure Meetup Stuttgart - Multi-arch Docker images
Stefan Scherer
 
PPTX
Report portal
COMAQA.BY
 
PDF
Docker for tooling
Rafael Gomes
 
PDF
CI/CD with Docker on AWS
Hart Hoover
 
PPTX
Developer South Coast 2018: Modernizing .NET Apps with Docker
Elton Stoneman
 
PDF
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
Docker, Inc.
 
PPTX
Windows Server Containers- How we hot here and architecture deep dive
Docker, Inc.
 
PPTX
CI CD WORKFLOW
AddWeb Solution Pvt. Ltd.
 
PPTX
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
PPTX
Lando - AddWeb Solution
AddWeb Solution Pvt. Ltd.
 
PDF
Docker Platform Internals: Taking runtimes and image creation to the next lev...
Docker, Inc.
 
PDF
Docker basic on azure
Philip Zheng
 
PDF
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
PPTX
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
PDF
Automate App Container Delivery with CI/CD and DevOps
Daniel Oh
 
PDF
DockerCon SF 2015: Enabling Microservices @Orbitz
Docker, Inc.
 
PDF
Weekly lecture appsterdam_19mar2014
Microsoft
 
The Fairy Tale of the One Command Build Script
Docker, Inc.
 
Docker and DevOps --- new IT culture
Terry Chen
 
Docker for dev
Erik Talboom
 
Azure Meetup Stuttgart - Multi-arch Docker images
Stefan Scherer
 
Report portal
COMAQA.BY
 
Docker for tooling
Rafael Gomes
 
CI/CD with Docker on AWS
Hart Hoover
 
Developer South Coast 2018: Modernizing .NET Apps with Docker
Elton Stoneman
 
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
Docker, Inc.
 
Windows Server Containers- How we hot here and architecture deep dive
Docker, Inc.
 
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
Lando - AddWeb Solution
AddWeb Solution Pvt. Ltd.
 
Docker Platform Internals: Taking runtimes and image creation to the next lev...
Docker, Inc.
 
Docker basic on azure
Philip Zheng
 
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
Automate App Container Delivery with CI/CD and DevOps
Daniel Oh
 
DockerCon SF 2015: Enabling Microservices @Orbitz
Docker, Inc.
 
Weekly lecture appsterdam_19mar2014
Microsoft
 

Similar to Run automated tests in Docker (20)

PDF
[@NaukriEngineering] Docker 101
Naukri.com
 
PDF
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
PDF
Docker primer and tips
Samuel Chow
 
PDF
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
PDF
Docker Up and Running for Web Developers
Amr Fawzy
 
PDF
Docker up and Running For Web Developers
BADR
 
PDF
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
Puppet
 
PDF
DCSF 19 Building Your Development Pipeline
Docker, Inc.
 
ODP
Docker on Power Systems
Cesar Maciel
 
PPTX
Using Docker to boost your development experience with Drupal
dockerizedrupal
 
PPTX
Getting started with docker (2017)
JEMLI Fathi
 
PDF
Docker in everyday development
Justyna Ilczuk
 
PDF
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Ambassador Labs
 
PDF
Adventures in docker compose
LinkMe Srl
 
PDF
Docker Container Introduction
Innfinision Cloud and BigData Solutions
 
PPTX
Introduction to Docker
Pubudu Jayawardana
 
ODP
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
lenworthhenry
 
PPTX
Docker with WordPress
Imran Sayed
 
PPTX
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
ODP
DevAssistant, Docker and You
BalaBit
 
[@NaukriEngineering] Docker 101
Naukri.com
 
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
Docker primer and tips
Samuel Chow
 
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
Docker Up and Running for Web Developers
Amr Fawzy
 
Docker up and Running For Web Developers
BADR
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
Puppet
 
DCSF 19 Building Your Development Pipeline
Docker, Inc.
 
Docker on Power Systems
Cesar Maciel
 
Using Docker to boost your development experience with Drupal
dockerizedrupal
 
Getting started with docker (2017)
JEMLI Fathi
 
Docker in everyday development
Justyna Ilczuk
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Ambassador Labs
 
Adventures in docker compose
LinkMe Srl
 
Docker Container Introduction
Innfinision Cloud and BigData Solutions
 
Introduction to Docker
Pubudu Jayawardana
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
lenworthhenry
 
Docker with WordPress
Imran Sayed
 
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
DevAssistant, Docker and You
BalaBit
 
Ad

Recently uploaded (20)

PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
Design Thinking basics for Engineers.pdf
CMR University
 
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Day2 B2 Best.pptx
helenjenefa1
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
MRRS Strength and Durability of Concrete
CivilMythili
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Ad

Run automated tests in Docker

  • 2. Run automated tests in Docker Oleksandr Metelytsia 5 December 2017, Kyiv
  • 3. About me Senior Test Automation Engineer in SoftServe 8+ years experience in software testing on different projects
  • 4. Agenda ●Problem statement ●Docker to the rescue ●“Hello world” with Docker ●Tips and Tricks ●Q&A
  • 5. Works on my machine (c)
  • 6. ●OS differences between CI and local run ●python versions ●selenium and browser versions ●dependencies versions ●environment specific issues ●tools and libraries versions ●... Possible reasons
  • 7. Docker to the rescue Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.
  • 8. Docker ● docker != Virtual Machine like VirtualBox ov VMWare ● docker != configuration management like Chef or Puppet ● Encapsulates an app and all it dependencies including OS into a single object called container ● Gives portable deployment across machines ● Works on Mac, Linux, Windows ● Multi-container orchestration with docker-compose
  • 10. Enough theory. Let’s code. Step0. Install docker and docker-compose
  • 14. Build and test container
  • 15. The dependency Not so easy to setup Redis in an identical way every time in a traditional environment.
  • 16. But easy with Docker
  • 20. Test dependencies: Firefox47 and requirements.txt Test run:
  • 21. Headless mode: xvfb Xvfb or X virtual framebuffer is a display server which performs all graphical operations in virtual memory without showing any screen output.
  • 22. Headless mode: xvfbwrapper xvfbwrapper is a python wrapper for controlling Xvfb.
  • 25. Build and test container
  • 28. We are ready for Continuous Integration! ● very few commands to run in CI ● simple agents setup ● easy to maintain dependencies ● clear external services configuration ● the same local and CI envs ● fast dev-loop ● multi-environmental
  • 29. Will this work on Windows7?
  • 30. Tips & Tricks: Docker registry The Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. You could run your own private registry or use Docker Hub.
  • 31. Tips & Tricks: CI your docker images 1.Put Dockerfiles under version control 2.Create CI plans to build and push images 3.Trigger plans on repo commit 4.Profit
  • 32. Tips & Tricks: Official repositories
  • 33. Thanks to Docker and Docker-Compose we automated: ● build of application (Dockerfile) ● deploy of a local environment (docker-compose.yml) ● build of a testing image (Dockerfile.test) ● tests execution (docker-compose.test.yml) for an application Conclusions: 1
  • 34. Advantages of using the docker-compose.test.yml file for testing: ● Automatable: the way a tool executes the docker-compose.test.yml is independent of the application under test ● Light-weight: hundreds of external services can be deployed on a single host, simulating complex test environments ● Agnostic: avoid CI provider lock-in, and your tests can run in any infrastructure and on any OS which supports Docker ● Immutable: tests passing on your local machine will pass in your CI tool Conclusions: 2