SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Automated Virtualized Testing (AVT) with
Docker, Kubernetes, WireMock and Gatling
Liberty Mutual Insurance - Tongyu Wang & Wei Li
Introduction
2
Tongyu Wang
Architect,
Liberty Mutual Insurance
Wei Li
Solutions Engineer,
Liberty Mutual Insurance
Agenda
3
 Traditional Testing Approach
 What’s AVT
 AVT Architecture and Implementation
 Demo
 Lessons Learned
How We Test Traditionally
4
Build
Unit
Test
Deploy
CI/CD Pipeline
SCM
Dev/Test/Stage/Perf
MyApp
Data
Service A
Service C
Service B
App
AppOther
Apps
Dedicated
Testing Suite
(LoadRunner)
Problems:
▪ Environment stability
▪ Dependency availability
▪ Limited testing window
▪ Unreliable results
Client
Dedicated env with shared dependencies
Performance TestingFunctional Testing
Dependencies
Automated Virtualized Testing (AVT) Approach
5
Introducing AVT
AVT is an approach that leverages
Containers As A Service (CaaS)
infrastructure to auto-provision
ephemeral runtime environments with
external dependencies virtualized with
mocks, so your application can run and
be tested in a scalable and repeatable
fashion.
Benefits
▪ Reliable results and trending over time -
because we focus on app-under-test
rather than its dependencies and the
environment
▪ Cost saving - we no longer need to
maintain dedicated permanent test
environments that only see sporadic
usage
▪ Automated and repeatable - Increase
testing automation in CI/CD pipeline
Guiding
Principles
Reusable
Components
Integrated
Framework
• Test only what you control
• Avoid testing in shared
environments
• Treat infrastructure as code
• Docker images
• Docker compose files
• Kubernetes manifest files
• Shell scripts
• Monitoring/Visualization tools
• Project structure convention
• CI/CD pipeline integration
• CaaS provider integration
AVT Conceptual Architecture
6
Build
Unit
Test
Functional
Test
CI/CD Pipeline
SCM
Non-Prod/Prod
MyApp Data
Perf
Test
Deploy
Functional Testing Env
MyApp
Data
Mock Svc A
Mock Svc A
Mock Svc A
Test Driver
& Scripts
Perf Testing Env
MyApp
Data
Mock Svc A
Mock Svc A
Mock Svc A
Test Driver
& Scripts
CaaS Infrastructure
Auto-Provision
Mock Svc A
Mock Svc A
Service A
Artifact
Repo
Result
Aggregation &
Visualization
AVT Implementation @ Liberty Mutual
7
Build
Unit
Test
Functional
Test
CI/CD Pipeline Non-Prod/Prod
MyApp Data
Perf
Test
Deploy
Functional Testing Env
Mock Svc A
Mock Svc A
Perf Testing Env
Mock Svc A
Mock Svc A
Auto-Provision
Mock Svc A
Mock Svc A
Service A
App
Artifacts
Mock
Config
Test
Scripts
App Artifacts
Mock Config
Test Scripts
Demo - Sample Application and Tooling
8
Sample Application
• A Spring Boot application
• Expose Restful endpoints
• Read data from a MySQL database
• Call other web services
Tooling
• Java 11 and Maven 3.2.5
• InfluxDB 1.7
• Grafana 7.0.5
• Docker Desktop Community 2.3.0.3
• Kubernetes 1.16.5
• Kompose 1.21.0
Demo - Steps
9
Clone git repo (skipped)
Use kompose to convert docker-compose to
Kubernetes manifest files
Build Spring Boot executable jar
(skipped)
run-app-gatling-k8s.sh
kubectl apply -f k8s-app-gatling/
Demo - AVT Process Flow
10
Demo - AVT Process Flow (Continued)
11
Lessons Learned
12
 Having well-defined service contracts is important.
 The adoption of the framework can be incremental depending on each
app’s unique situation to balance upfront costs vs. benefits over time.
 Being able to launch test environments either from desktop or via
CI/CD pipeline is very powerful, especially during test development and
troubleshooting environment configurations.
 Organizations adopting AVT should focus more on its core guiding
principles, keep the implementation flexible and adjust to your
organization’s existing infrastructure and practice.
Appendix
13
Docker Compose
14
Docker Compose (continued)
15
Sample Gatling Test Script
16
Kubernetes Manifests Converted from docker
compose file by kompose
17
Kubernetes Manifest Example (app-deployment.yaml)
18
Kubernetes Manifest Example (app-deployment.yaml,
continued)
19
Kubernetes Manifest Example (app-service.yaml)
20
Grafana Real Time Monitoring
21
Sample Gatling Test Report
22
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gatling

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
 
User authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesUser authentication and authorizarion in Kubernetes
User authentication and authorizarion in Kubernetes
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Kubernetes CI/CD with Helm
Kubernetes CI/CD with HelmKubernetes CI/CD with Helm
Kubernetes CI/CD with Helm
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installation
 
Terraform
TerraformTerraform
Terraform
 
Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트
 
CI/CD on AWS
CI/CD on AWSCI/CD on AWS
CI/CD on AWS
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray
 
"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築
"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築
"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築
 
Overview of kubernetes network functions
Overview of kubernetes network functionsOverview of kubernetes network functions
Overview of kubernetes network functions
 
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Terraform
TerraformTerraform
Terraform
 
CI/CD on AWS
CI/CD on AWSCI/CD on AWS
CI/CD on AWS
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
 
Introduction to IAC and Terraform
Introduction to IAC and Terraform Introduction to IAC and Terraform
Introduction to IAC and Terraform
 
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
 

Ähnlich wie Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gatling

Ähnlich wie Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gatling (20)

Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
Technology Primer: Closing the DevOps Loop by Integrating CA Application Perf...
Technology Primer: Closing the DevOps Loop by Integrating CA Application Perf...Technology Primer: Closing the DevOps Loop by Integrating CA Application Perf...
Technology Primer: Closing the DevOps Loop by Integrating CA Application Perf...
 
Creating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft WebinarCreating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
Creating Complete Test Environments in the Cloud: Skytap & Parasoft Webinar
 
How to Reuse OPNFV Testing Components in Telco Validation Chain
How to Reuse OPNFV Testing Components in Telco Validation ChainHow to Reuse OPNFV Testing Components in Telco Validation Chain
How to Reuse OPNFV Testing Components in Telco Validation Chain
 
AWS Webcast - Continuous integration with AWS and Ravello
AWS Webcast - Continuous integration with AWS and RavelloAWS Webcast - Continuous integration with AWS and Ravello
AWS Webcast - Continuous integration with AWS and Ravello
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Continuous Delivery with a PaaS Application
Continuous Delivery with a PaaS ApplicationContinuous Delivery with a PaaS Application
Continuous Delivery with a PaaS Application
 
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 Medellin
 
Get Mapped: Using Value Stream Mapping to Create a DevOps Adoption Roadmap
Get Mapped: Using Value Stream Mapping to Create a DevOps Adoption RoadmapGet Mapped: Using Value Stream Mapping to Create a DevOps Adoption Roadmap
Get Mapped: Using Value Stream Mapping to Create a DevOps Adoption Roadmap
 
Journey toward3rdplatform
Journey toward3rdplatformJourney toward3rdplatform
Journey toward3rdplatform
 
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps DeploymentsDon't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
 
Testing Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the CloudTesting Applications—For the Cloud and in the Cloud
Testing Applications—For the Cloud and in the Cloud
 
DevTest Portfolio Overview
DevTest Portfolio OverviewDevTest Portfolio Overview
DevTest Portfolio Overview
 
Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
 
DevOps and Application Delivery for Hybrid Cloud - DevOpsSummit session
DevOps and Application Delivery for Hybrid Cloud  - DevOpsSummit sessionDevOps and Application Delivery for Hybrid Cloud  - DevOpsSummit session
DevOps and Application Delivery for Hybrid Cloud - DevOpsSummit session
 

Mehr von VMware Tanzu

Mehr von VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Kürzlich hochgeladen

%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Kürzlich hochgeladen (20)

WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 

Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gatling

  • 1. Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gatling Liberty Mutual Insurance - Tongyu Wang & Wei Li
  • 2. Introduction 2 Tongyu Wang Architect, Liberty Mutual Insurance Wei Li Solutions Engineer, Liberty Mutual Insurance
  • 3. Agenda 3  Traditional Testing Approach  What’s AVT  AVT Architecture and Implementation  Demo  Lessons Learned
  • 4. How We Test Traditionally 4 Build Unit Test Deploy CI/CD Pipeline SCM Dev/Test/Stage/Perf MyApp Data Service A Service C Service B App AppOther Apps Dedicated Testing Suite (LoadRunner) Problems: ▪ Environment stability ▪ Dependency availability ▪ Limited testing window ▪ Unreliable results Client Dedicated env with shared dependencies Performance TestingFunctional Testing Dependencies
  • 5. Automated Virtualized Testing (AVT) Approach 5 Introducing AVT AVT is an approach that leverages Containers As A Service (CaaS) infrastructure to auto-provision ephemeral runtime environments with external dependencies virtualized with mocks, so your application can run and be tested in a scalable and repeatable fashion. Benefits ▪ Reliable results and trending over time - because we focus on app-under-test rather than its dependencies and the environment ▪ Cost saving - we no longer need to maintain dedicated permanent test environments that only see sporadic usage ▪ Automated and repeatable - Increase testing automation in CI/CD pipeline Guiding Principles Reusable Components Integrated Framework • Test only what you control • Avoid testing in shared environments • Treat infrastructure as code • Docker images • Docker compose files • Kubernetes manifest files • Shell scripts • Monitoring/Visualization tools • Project structure convention • CI/CD pipeline integration • CaaS provider integration
  • 6. AVT Conceptual Architecture 6 Build Unit Test Functional Test CI/CD Pipeline SCM Non-Prod/Prod MyApp Data Perf Test Deploy Functional Testing Env MyApp Data Mock Svc A Mock Svc A Mock Svc A Test Driver & Scripts Perf Testing Env MyApp Data Mock Svc A Mock Svc A Mock Svc A Test Driver & Scripts CaaS Infrastructure Auto-Provision Mock Svc A Mock Svc A Service A Artifact Repo Result Aggregation & Visualization
  • 7. AVT Implementation @ Liberty Mutual 7 Build Unit Test Functional Test CI/CD Pipeline Non-Prod/Prod MyApp Data Perf Test Deploy Functional Testing Env Mock Svc A Mock Svc A Perf Testing Env Mock Svc A Mock Svc A Auto-Provision Mock Svc A Mock Svc A Service A App Artifacts Mock Config Test Scripts App Artifacts Mock Config Test Scripts
  • 8. Demo - Sample Application and Tooling 8 Sample Application • A Spring Boot application • Expose Restful endpoints • Read data from a MySQL database • Call other web services Tooling • Java 11 and Maven 3.2.5 • InfluxDB 1.7 • Grafana 7.0.5 • Docker Desktop Community 2.3.0.3 • Kubernetes 1.16.5 • Kompose 1.21.0
  • 9. Demo - Steps 9 Clone git repo (skipped) Use kompose to convert docker-compose to Kubernetes manifest files Build Spring Boot executable jar (skipped) run-app-gatling-k8s.sh kubectl apply -f k8s-app-gatling/
  • 10. Demo - AVT Process Flow 10
  • 11. Demo - AVT Process Flow (Continued) 11
  • 12. Lessons Learned 12  Having well-defined service contracts is important.  The adoption of the framework can be incremental depending on each app’s unique situation to balance upfront costs vs. benefits over time.  Being able to launch test environments either from desktop or via CI/CD pipeline is very powerful, especially during test development and troubleshooting environment configurations.  Organizations adopting AVT should focus more on its core guiding principles, keep the implementation flexible and adjust to your organization’s existing infrastructure and practice.
  • 16. Sample Gatling Test Script 16
  • 17. Kubernetes Manifests Converted from docker compose file by kompose 17
  • 18. Kubernetes Manifest Example (app-deployment.yaml) 18
  • 19. Kubernetes Manifest Example (app-deployment.yaml, continued) 19
  • 20. Kubernetes Manifest Example (app-service.yaml) 20
  • 21. Grafana Real Time Monitoring 21
  • 22. Sample Gatling Test Report 22