Build a remote testing capability! Dockerize your testing ......testing • QA best practice in...

51
Build a remote testing capability! Dockerize your testing to enable virtual environments Ref: 2020 Docker Inc Webinar

Transcript of Build a remote testing capability! Dockerize your testing ......testing • QA best practice in...

Page 1: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Build a remote testing capability!

Dockerize your testing to enable virtual

environments

Ref: 2020 Docker Inc

Webinar

Page 2: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Today’s Webinar

Bryon LowenTessolve -Software testing lead

Mounika KoduriTessolve – SDET

Sankar D RaoTessolve – SDET

Page 3: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Agenda• Benefits of Dockerizing your

testing• QA best practice in using Docker

environments• Tips in creating your virtual

Docker containers• How to integrate SonarQube for

code coverage • Understand Docker driven test

automation

Page 4: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Benefits of Dockerizing your testing

Page 5: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Why Docker?

• Docker accelerates your workflow

• Developing apps today requires so much more than writing code.

• Complexity:

• Multiple languages

• Frameworks

• Architectures

• Interfaces

Page 6: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Incredible adoption in just 4 years!

Ref: 2020 Docker Inc

Page 7: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Benefits• Agility

• Portability

• Security

• Cost savings

Page 8: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Why Docker is Hot!• Its simple

• Developers love it

Dev / test of legacy apps

New app dev

Code agility, CI/CD pipeline

DevOps adoption

Microservices & cloud

Page 9: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Ecosystem

Page 10: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

QA best practice in

using Docker environments

Page 11: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Historical limitations of app deployment

• Slow

• Costs

• Wasted resources

• Difficult to scale

• Difficult to migrate

• Vendor lock in

Application

Operating System

Physical server

Page 12: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Hypervised-based Virtualization

© 2019, Vipin Joshi. All Rights Reserved

Page 13: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Unlocking Containers

• A standardized unit of software that allows developers to isolate their app from its environment

• De facto standard to build and share containerized apps

• For Quality assurance:

• Clean builds

• Separate sections

• Is the defect a bug or env

Page 14: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker containers

Page 15: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Containers and VMs together

Conference: A Hybrid Genetic Programming: Boxiong Tan . All Rights Reserved

Page 16: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Benefits of Docker containers

Page 17: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Creating your virtual Docker

containers

Page 18: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Excellent Use Cases for Containers

Ready to Run Application Stacks

New App Dev & Microservices

One-Time Run jobs and Analytics

Build your own Paas

Front-End App Servers

Increase server density

Create secure sandboxes

Create your own SaaS

Automated application deployment

Continuous Integration and Deployment

Lightweight Desktop Virtualization

Page 19: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Dictionary

• Images:

• Base image

• Child image

• Containers

• Docker daemon

• Docker client

• Docker hub

Page 20: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Architecture

Page 21: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Containers as a Service

Page 22: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker CLI – Common / useful commands

• docker build : build docker image from Dockerfile

• docker run : run docker image• docker logs : show log data for a running

or stopped container

• docker ps : list running docker containers (analogous to ps)

• docker ps –a : list all containers including not running

• docker images : list all images on the local volume

• docker rm : remove/delete a container | docker rmi : remove/delete an image

• docker tag : name a docker image

• docker login : login to registry

• docker push/pull : push or pull volumes to/from Docker Registries

• docker inspect : return container run time configuration parameter metadata

Page 23: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Dockerfile

Page 24: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Demo -Docker commands hands-on

Page 25: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Compose

Docker Tool for defining and running multi-container Docker applicationsReference file defined in YAMLdocker-compose.yml

$ docker-compose up -d

Page 26: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Allocation of images to hosts

Page 27: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Swarm Master

Page 28: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

How to integrate

SonarQube for code coverage

Page 29: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Tracking and improving

software quality with

Page 30: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Overview

● Code quality (what, why

and when)

● SonarQube introduction

● How does it work?

● Integration with Maven

Project.

Page 31: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

What is code quality?

“It’s an indicator about how quickly

developers can add business value to

a software system”

Page 32: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Why measure?

● Source code is the heart of each system

● Developers don’t write new software. They

maintain “legacy” systems

● A system is (almost) never “finished”

● You can’t improve if you don’t measure

● Broken window theory

Page 33: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

When you should measure?

● From project day #1

● Continuously

● Prevent vs post-actions

● Prioritize and plan

Page 34: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

What SonarQube is?

● Free & open source “Code Quality Platform”

● Provides moment-in-time quality snapshots

● Gives trends of lagging and leading

indicators

● Tracks developers’ seven deadly sins (seven

axes of quality )

Page 35: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

How does it work?

● Analyzes source code and byte code

● Computes hundreds of metrics

● Associates metrics with analysis

snapshots

● Shows the results in dashboards

and widgets accessible by any

browser

Page 36: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

SonarQube for everything

● Initially developed only for Java projects

● Today supports over twenty languages

Open Source : C++, C#, Flex, Groovy, Android,

Javascript, PHP, Python, XML,

Web(xhtml, jsp , jsf, )

Commercial : ABAP, C, C++, Cobol, Natural, PL/SQL, Visual

Basic

Page 37: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

… and for everyone

● For developers. Is my code “good”? How can I improve it?

● For testers / QA staff. Which parts of the system lack unit

testing?

● For architects. Is the initial design “broken”? How about

complexity?

● For managers. Give me the numbers!! Are we going up or down?

Page 38: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Sonar Integration with

Maven Project

● Download and install SonarQube from URL

● Define sonar properties, jacoco.exec file path,

sonar dependency plugins Jacoco-maven-plugin,

Maven-compiler-plugin and maven-surefire-plugin)

● Push code coverage to sonar server using below

command from local/jenkins

mvn clean install sonar:sonar -

Dsonar.host.url=http://10.80.200.8 -

Dsonar.jacoco.reportPath=target/jacoco.exec

Page 39: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Sonar Properties

Page 40: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Sonar Plugins

Page 41: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Code Coverage & Quality Gate

Page 42: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Code Measures

Page 43: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Understand Docker driven

test automation

Page 44: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Test Automation Pre Req’s

● Docker Setup

● Sonar Integration with Maven/Gradle.. etc.

● Jenkins Job creation with Docker Swarm Cluster

for Unit / Integration Testing.

● Run the job and get the code quality report

through email.

Page 45: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Driven Test

Automation Flow Chart

Page 46: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Driven Unit Test

Reports

Page 47: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Docker Driven

Unit + Integration Test Reports

Page 48: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Summary

Q & A

Page 49: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Summary

• Docker accelerates your workflow

• Containers are a standardized unit of software

• For Quality assurance:

• Clean builds

• Separate sections

• Is the defect a bug or environment issue

• Integrate SonarQube to enable code coverage & quality

• Use docker environments to drive quality automation pipeline

Page 50: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Q & A

Page 51: Build a remote testing capability! Dockerize your testing ......testing • QA best practice in using Docker environments • Tips in creating your virtual Docker containers • How

Thankyou