SlideShare a Scribd company logo
1 of 28
Download to read offline
Using Docker for
Testing
MUKTA APHALE
ATA GTR 2016, PUNE
@muktaa
Who Am I?
• Developer, DevOps Enthusiast
• Passion for technology, innovation and the thirst to keep
learning
• Love to code
• Love to design solutions
• Love to network
• Believe in dreaming big
• Believe in work-life balance
@muktaa
Agenda
• Where testing stands today, current challenges of
testing
• What is Docker?
• How can docker help in better automation testing?
• A traditional way of doing integration testing
• Demo of using Docker for testing
• Demo of integrating dockerized tests with your CI
@muktaa
Pain Points of Testing
• Unit tests, integration tests, complex integration tests
• UI testing
• Git branching
• Environments
• Failed tests pollute environment
• Deployment dependencies, testing dependencies
@muktaa
Docker
@muktaa
Linux	
  Container Docker Data	
  Centre,	
  
Docker Cloud,	
  Docker
Engine,	
  Docker Hub,	
  
UCP
Benefits:
Speed
Portability
Density
Open	
  Source
“Can	
  create	
  lightweight,	
  self	
  
sufficient	
  containers	
  from	
  
any	
  application”
Docker Applications
• Testing
• Microservices Applications
• Simplifying Development
• Simplifying Deployment
• Production
• CaaS
@muktaa
Docker for enabling Testing
• Mimic production environment
• Consistent Environments
• Black Box Testing
• Scalability Testing
• Configuration Testing
• Testing Simplified
@muktaa
Deploying for Integration Testing:
Old Way
• Build project
• SCP the build artifact to the
server(s)
• Ssh into the server
• Stop webserver
• Replace the build artifact at the
right path
• Restart webserver
o SCP the tar.gz from the project
to the server(s)
o ssh into the server
o stop tomcat
o remove the “work”, “webapps”,
“shared” and “common” folders
o extract the tar.gz into the
tomcat folder
o start tomcat
@muktaa
Integration Testing: Old Way
• Wait for deployment to complete
◦Webserver comes up
• Ensure setup is clean
◦DB Scripts, Env variables, etc
• Get your latest integration test code ready
• Point your integration tests to your newly deployed
setup
• Run integration tests
@muktaa
Let’s use Docker…
@muktaa
Example
Scenario
• Webserver
• NGiNX
• App Server
• 3 load balanced instances
• Node js
• DB Server
• Redis
@muktaa
Output
• Prints the number of times
the page was hit
• Source Code:
https://github.com/muktaa/dock
er-example/
@muktaa
Dockerizing Each Component
• Dockerfile for each
component
• Docker-compose.yml
• Build Script
@muktaa
Demo
DEPLOY APPLICATION FOR INTEGRATION TESTING
@muktaa
Steps
• Git clone https://github.com/muktaa/docker-example/
• Docker-compose build
• Docker-compose up
@muktaa
Running Integration
Tests
LETS DOCKERIZE THE INTEGRATION TESTS TOO!
@muktaa
Example of Selenium Tests
• https://github.com/muktaa/SeleniumExample
• Ready docker image available:
◦Docker pull selenium-example
• Customize the sample tests, refer to README:
https://github.com/muktaa/SeleniumExample/blob/m
aster/README.md
• Headless Selenium tests
@muktaa
Demo
• https://github.com/muktaa/SeleniumExample/blob/m
aster/Dockerfile
• Docker pull muktaa/selenium-example:headless
• Docker run -it -e
TEST_URL=http://54.254.223.84:5555/
muktaa/selenium-example:headless
@muktaa
Sample Output
@muktaa
Nightly Build
PUTTING	
  IT	
  ALL	
  TOGETHER	
  TO	
  WRITE	
  NIGHTLY	
  BUILD	
  JOB	
  FOR	
  OUR	
  
DOCKERIZED INTEGRATION	
  TESTS
@muktaa
Jenkins Job
@muktaa
Job Configuration
@muktaa
Job Build Step 1
#/bin/bash +x
docker-compose --project-name=${JOB_NAME}stop &>
/dev/null || true &> /dev/null
docker-compose --project-name=${JOB_NAME}rm --
force &> /dev/null || true &> /dev/null
docker stop `docker ps -a -q -f status=exited`&> /dev/null
|| true &> /dev/null
docker rm -v `docker ps -a -q -f status=exited`&> /dev/null
|| true &> /dev/null
docker rmi `docker images--filter 'dangling=true' -q --no-
trunc` &> /dev/null || true &> /dev/null
docker-compose build
docker-compose --project-name=${JOB_NAME}up &
@muktaa
Job Build Step 2, 3
docker run -itd -v /var/lib/jenkins/workspace/docker-
example/test-report:/usr/share/app/target/surefire-
reports -e TEST_URL=http://54.254.223.84:5555/
muktaa/selenium-example:headless
@muktaa
Job Build Steps 3, 4
@muktaa
What Next?
• Lots More!
• Running Selenium tests inside Docker
• Using docker swarm to deploy
• Using docker machine to manage hosts for testing
@muktaa
References
• http://blogs.plos.org/tech/testing-made-awesome-with-docker/
• https://www.wouterdanes.net/2014/04/11/continuous-integration-using-
docker-maven-and-jenkins.html
• http://making.meetup.com/post/122890386432/steps-towards-automated-
testing-with-docker-and
• https://divan.github.io/posts/integration_testing/
• https://medium.com/@WoloxEngineering/ruby-on-rails-continuous-
integration-with-jenkins-and-docker-compose-8dfd24c3df57#.7vxoq2gfg
• http://anandmanisankar.com/posts/docker-container-nginx-node-redis-
example/
• http://www.conductor.com/nightlight/running-selenium-grid-using-docker-
compose/
@muktaa
Thank You!
QUESTIONS?
@muktaa

More Related Content

What's hot

Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Binary Studio
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Automated-Testing-inside-containers
Automated-Testing-inside-containersAutomated-Testing-inside-containers
Automated-Testing-inside-containersManoj Kumar Kumar
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsKumar Shìvam
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with JenkinsMartin Málek
 
Jenkins for java world
Jenkins for java worldJenkins for java world
Jenkins for java worldAshok Kumar
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using SeleniumNikhil Kapoor
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle IntroductionGanesh Samarthyam
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideBytemark
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesabhishek chawla
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...Edureka!
 

What's hot (20)

"DevOps > CI+CD "
"DevOps > CI+CD ""DevOps > CI+CD "
"DevOps > CI+CD "
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
 
CI/CD
CI/CDCI/CD
CI/CD
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Automated-Testing-inside-containers
Automated-Testing-inside-containersAutomated-Testing-inside-containers
Automated-Testing-inside-containers
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Jenkins for java world
Jenkins for java worldJenkins for java world
Jenkins for java world
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
Jenkins
JenkinsJenkins
Jenkins
 
CI CD Basics
CI CD BasicsCI CD Basics
CI CD Basics
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 
Docker
DockerDocker
Docker
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management services
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
 
Docker swarm
Docker swarmDocker swarm
Docker swarm
 

Viewers also liked

Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerMukta Aphale
 
CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!Ramya Authappan
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Dockertoffermann
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for TestingCarlos Sanchez
 
Baking Docker Using Chef
Baking Docker Using ChefBaking Docker Using Chef
Baking Docker Using ChefMukta Aphale
 
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturitySD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturityBrian Dawson
 
DevOps Picc12 Management Talk
DevOps Picc12 Management TalkDevOps Picc12 Management Talk
DevOps Picc12 Management TalkMichael Rembetsy
 
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOpsDevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOpsSailaja Tennati
 
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system Tarin Gamberini
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5Paul Peissner
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with DockerLaura Frank Tacho
 
How good are your tests?
How good are your tests?How good are your tests?
How good are your tests?Noam Shaish
 
DevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesDevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesShiva Narayanaswamy
 

Viewers also liked (20)

Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
 
CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
 
Baking Docker Using Chef
Baking Docker Using ChefBaking Docker Using Chef
Baking Docker Using Chef
 
Crevise Technologies
Crevise TechnologiesCrevise Technologies
Crevise Technologies
 
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
 
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps MaturitySD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
SD DevOps Meet-up - Exploring Quadrants of DevOps Maturity
 
DevOps Picc12 Management Talk
DevOps Picc12 Management TalkDevOps Picc12 Management Talk
DevOps Picc12 Management Talk
 
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOpsDevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
DevOps Summit 2015 Presentation: Continuous Testing At the Speed of DevOps
 
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
 
Mutation testing
Mutation testingMutation testing
Mutation testing
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
How good are your tests?
How good are your tests?How good are your tests?
How good are your tests?
 
DevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesDevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best Practices
 
Javantura v3 - Mutation Testing for everyone – Nicolas Fränkel
Javantura v3 - Mutation Testing for everyone – Nicolas FränkelJavantura v3 - Mutation Testing for everyone – Nicolas Fränkel
Javantura v3 - Mutation Testing for everyone – Nicolas Fränkel
 

Similar to Using Docker for Testing

Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankDocker, Inc.
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksGoDataDriven
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and dockerShapeBlue
 
Building Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with DockerBuilding Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with DockerLaura Frank Tacho
 
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)Amazon Web Services
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochranedotCloud
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for RealistsOracle Developers
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realistsKarthik Gaekwad
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KuberneteszekeLabs Technologies
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development PipelineGlobalLogic Ukraine
 
CI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumCI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumSreenivas Makam
 
Microsoft Azure Container Service - DockerCH
Microsoft Azure Container Service - DockerCHMicrosoft Azure Container Service - DockerCH
Microsoft Azure Container Service - DockerCHNguyen Anh Tu
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerWeb à Québec
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureYury Tsarev
 

Similar to Using Docker for Testing (20)

Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure Databricks
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
 
Building Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with DockerBuilding Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with Docker
 
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Docker
DockerDocker
Docker
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & Kubernetes
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Why to docker
Why to dockerWhy to docker
Why to docker
 
CI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumCI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and Tutum
 
Microsoft Azure Container Service - DockerCH
Microsoft Azure Container Service - DockerCHMicrosoft Azure Container Service - DockerCH
Microsoft Azure Container Service - DockerCH
 
Docker.pptx
Docker.pptxDocker.pptx
Docker.pptx
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven Infrastructure
 

More from Mukta Aphale

CI with Docker in Docker
CI with Docker in DockerCI with Docker in Docker
CI with Docker in DockerMukta Aphale
 
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using DatadogMukta Aphale
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration managementMukta Aphale
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev opsMukta Aphale
 

More from Mukta Aphale (6)

CI with Docker in Docker
CI with Docker in DockerCI with Docker in Docker
CI with Docker in Docker
 
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
 
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using Datadog
 
MomOps in DevOps
MomOps in DevOpsMomOps in DevOps
MomOps in DevOps
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
 

Recently uploaded

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Using Docker for Testing

  • 1. Using Docker for Testing MUKTA APHALE ATA GTR 2016, PUNE @muktaa
  • 2. Who Am I? • Developer, DevOps Enthusiast • Passion for technology, innovation and the thirst to keep learning • Love to code • Love to design solutions • Love to network • Believe in dreaming big • Believe in work-life balance @muktaa
  • 3. Agenda • Where testing stands today, current challenges of testing • What is Docker? • How can docker help in better automation testing? • A traditional way of doing integration testing • Demo of using Docker for testing • Demo of integrating dockerized tests with your CI @muktaa
  • 4. Pain Points of Testing • Unit tests, integration tests, complex integration tests • UI testing • Git branching • Environments • Failed tests pollute environment • Deployment dependencies, testing dependencies @muktaa
  • 5. Docker @muktaa Linux  Container Docker Data  Centre,   Docker Cloud,  Docker Engine,  Docker Hub,   UCP Benefits: Speed Portability Density Open  Source “Can  create  lightweight,  self   sufficient  containers  from   any  application”
  • 6. Docker Applications • Testing • Microservices Applications • Simplifying Development • Simplifying Deployment • Production • CaaS @muktaa
  • 7. Docker for enabling Testing • Mimic production environment • Consistent Environments • Black Box Testing • Scalability Testing • Configuration Testing • Testing Simplified @muktaa
  • 8. Deploying for Integration Testing: Old Way • Build project • SCP the build artifact to the server(s) • Ssh into the server • Stop webserver • Replace the build artifact at the right path • Restart webserver o SCP the tar.gz from the project to the server(s) o ssh into the server o stop tomcat o remove the “work”, “webapps”, “shared” and “common” folders o extract the tar.gz into the tomcat folder o start tomcat @muktaa
  • 9. Integration Testing: Old Way • Wait for deployment to complete ◦Webserver comes up • Ensure setup is clean ◦DB Scripts, Env variables, etc • Get your latest integration test code ready • Point your integration tests to your newly deployed setup • Run integration tests @muktaa
  • 11. Example Scenario • Webserver • NGiNX • App Server • 3 load balanced instances • Node js • DB Server • Redis @muktaa
  • 12. Output • Prints the number of times the page was hit • Source Code: https://github.com/muktaa/dock er-example/ @muktaa
  • 13. Dockerizing Each Component • Dockerfile for each component • Docker-compose.yml • Build Script @muktaa
  • 14. Demo DEPLOY APPLICATION FOR INTEGRATION TESTING @muktaa
  • 15. Steps • Git clone https://github.com/muktaa/docker-example/ • Docker-compose build • Docker-compose up @muktaa
  • 16. Running Integration Tests LETS DOCKERIZE THE INTEGRATION TESTS TOO! @muktaa
  • 17. Example of Selenium Tests • https://github.com/muktaa/SeleniumExample • Ready docker image available: ◦Docker pull selenium-example • Customize the sample tests, refer to README: https://github.com/muktaa/SeleniumExample/blob/m aster/README.md • Headless Selenium tests @muktaa
  • 18. Demo • https://github.com/muktaa/SeleniumExample/blob/m aster/Dockerfile • Docker pull muktaa/selenium-example:headless • Docker run -it -e TEST_URL=http://54.254.223.84:5555/ muktaa/selenium-example:headless @muktaa
  • 20. Nightly Build PUTTING  IT  ALL  TOGETHER  TO  WRITE  NIGHTLY  BUILD  JOB  FOR  OUR   DOCKERIZED INTEGRATION  TESTS @muktaa
  • 23. Job Build Step 1 #/bin/bash +x docker-compose --project-name=${JOB_NAME}stop &> /dev/null || true &> /dev/null docker-compose --project-name=${JOB_NAME}rm -- force &> /dev/null || true &> /dev/null docker stop `docker ps -a -q -f status=exited`&> /dev/null || true &> /dev/null docker rm -v `docker ps -a -q -f status=exited`&> /dev/null || true &> /dev/null docker rmi `docker images--filter 'dangling=true' -q --no- trunc` &> /dev/null || true &> /dev/null docker-compose build docker-compose --project-name=${JOB_NAME}up & @muktaa
  • 24. Job Build Step 2, 3 docker run -itd -v /var/lib/jenkins/workspace/docker- example/test-report:/usr/share/app/target/surefire- reports -e TEST_URL=http://54.254.223.84:5555/ muktaa/selenium-example:headless @muktaa
  • 25. Job Build Steps 3, 4 @muktaa
  • 26. What Next? • Lots More! • Running Selenium tests inside Docker • Using docker swarm to deploy • Using docker machine to manage hosts for testing @muktaa
  • 27. References • http://blogs.plos.org/tech/testing-made-awesome-with-docker/ • https://www.wouterdanes.net/2014/04/11/continuous-integration-using- docker-maven-and-jenkins.html • http://making.meetup.com/post/122890386432/steps-towards-automated- testing-with-docker-and • https://divan.github.io/posts/integration_testing/ • https://medium.com/@WoloxEngineering/ruby-on-rails-continuous- integration-with-jenkins-and-docker-compose-8dfd24c3df57#.7vxoq2gfg • http://anandmanisankar.com/posts/docker-container-nginx-node-redis- example/ • http://www.conductor.com/nightlight/running-selenium-grid-using-docker- compose/ @muktaa