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

Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarPascal Larocque
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesRamit Surana
 
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!
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginnersBugRaptors
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with JenkinsEdureka!
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops DevopsKris Buytaert
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersRyan Hodgin
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...Simplilearn
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsRajith Bhanuka Mahanama
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineRobert McDermott
 
Configuration management I - Ansible + Packer
Configuration management I - Ansible + PackerConfiguration management I - Ansible + Packer
Configuration management I - Ansible + PackerXavier Serrat Bordas
 

What's hot (20)

Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and Sonar
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 
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...
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with Jenkins
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops Devops
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Dev ops using Jenkins
 
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
What is DevOps? | DevOps Introduction | DevOps Tools | DevOps Tutorial For Be...
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOps
 
Jenkins
JenkinsJenkins
Jenkins
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
 
Configuration management I - Ansible + Packer
Configuration management I - Ansible + PackerConfiguration management I - Ansible + Packer
Configuration management I - Ansible + Packer
 

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

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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