Upload
irfan-ahmad
View
1.883
Download
0
Embed Size (px)
Citation preview
OUTLINE
▸Why? - Challenges
▸What? - Containers
▸How? - Testing in Containers
▸Really? -See Demo
▸Next? - Try Hands On Example
WHY WE FAIL TO TEST?
45%
15% 5%
35%
▸ Slow-down deployments
▸ Slow test and setup
▸ Ineffective tests
▸Not needed
▸ * All of these challenges are linked to infrastructure underlying tests.
AN APPLICATION, PLUS ALL ITS DEPENDENCIES, LIBRARIES AND OTHER BINARIES, AND CONFIGURATION FILES NEEDED TO RUN IT, BUNDLED INTO ONE PACKAGE.
WHAT ARE CONTAINERS?
AN ENTIRE ISOLATED PORTABLE RUNTIME ENVIRONMENT
DOCKER▸ Docker is an open platform for developers and
sysadmins to build, ship, and run distributed applications.
INSIDE DOCKER ▸ Docker Image :static snapshot of the containers’
configuration.
▸ Docker Engine: a lightweight runtime and robust tooling that builds and runs your Docker containers.
▸ Docker Registry :a repository of images
HOW DOCKER WORKS
DOCKER RUNDOCKER LOOKS
FOR LOCAL IMAGES
IS IT INSTALLEDDOCKER LOOKS REGISTRY FOR
IMAGES
NO
IS IT AVAILABLE
DOCKER DOWNLOADS THE
IMAGE
IMAGE INSTALLED LOCALLY
DOCKER CREATES NEW
CONTAINER AND STARTS
PROGRAM
CONTAINER IS RUNNING
YES
PRE-REQUISITES▸ virtual-box
▸ download docker toolbox
▸ https://www.docker.com/products/docker-toolbox
VOTING APP : APP UNDER TEST▸ Simple Real Time voting app
▸ Runs with Docker Compose and multiple containers in network
Deliver Below Test as Container to Test Voting App Docker Image
1.API 2.Web 3.Web with Selenium Grid
PROBLEM STATEMENT
DOCKERS ANSWERS TO TESTING CHALLENGES
Problem Solution
Automation Dockerfile for setup
Agility & Reliability
Ship and Share Images
DevOps Infrastructure as Code
Scale Docker Compose
Tools Diversity
Docker support by and from vendors.
DOCKER - HANDS ON‣ clone https://github.com/irfanah/teststack
docker-compose up #for starting example-web app
‣ To run any test inside docker containers
‣ rake docker["api"] #for api tests
‣ rake docker["web"] #web tests on headless browse
‣ rake docker["webapp"] #web tests on selenium grid
BEST PRACTICES
▸ Ship Images , not just code
▸ One container one process
▸ Add only Required packages
▸ Group common operations
▸ Use Specific tags with Images
Q & A THANK YOU
Open Sourced - For Hands On
Github https://github.com/irfanah/TestStack https://github.com/irfanah/example-voting-app
Docker hub https://hub.docker.com/u/irfanah/
IRFAN AHMAD
Email [email protected] Web http://critick.io Twitter @critickerr