Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Denis Brusnin
Jan 2018
Testing Microservices with Docker
2
Agenda
• E2E Tests: The challenges
• Automation Test Strategy
• About Docker
• Emulating Microservice Dependencies
• Benefits of using Docker
3
Require staging environment
• The Staging environment is not always up to date
• You can deploy one version of each microservice at a time
• All tests share the same database
• Wasting a lot of resources
4
Flaky Tests
Investigation Time Consuming
5 5
Test Execution Speed
6
Slow feedback loop
• Build
• Generate artifacts
• Publish artifacts
• Deploy artifacts to a staging
server
• Execute tests
7
Normalising the Test Pyramid
8
API
Automation Test Strategy
Frontend
C C
DataBase
MOCK
9
IIS
ASP.NET Core
User API service (example)
User API
ENVIRONMENT
SQL Server
HTTP
request
HTTP
response
Redis Cache
MongoDB
External API
AppAppApp
10
About Docker
• Docker is an application build and
deployment tool
• It is based on the idea that you can
package your code with dependencies into
a deployable unit called a container
• Docker Images are an artefact, essentially
a snapshot of the contents a container is
meant to run
11
Problems solved by Docker
• Management of applications
• Version control
• Distributed management
• Low overhead
12
Docker Engine
• SERVER
a daemon process
• CLI
command line interface
• REST API
client to server communication via http
13
Docker Hub
• Image Repositories
• Automated Builds
• Webhooks
• Organizations
14
Dockerize Microservice
• Create a Dockerfile for your application
• Build and run the Docker image
• Check the service is running from a container
15
A typical API Tests
Test Case:
User API service should register a new user
Arrange
Build a POST request with user’s details
Act
Send the request to User API service
Assert
HTTP Status code returned, all records in SQL
tables were inserted correctly
User API
Test
SQL
SERVER
16
API Test Framework
• Setup
• Execute Tests
• Clean up
Container
ASP .NET Core
User API
DOCKER HOST Container
SQL Server
HTTP
request
HTTP
response
Container
Redis Cache
Container
MongoDB
Mock
External API
Test Orchestrator
17
Data Seeding
Execute SQL scripts to
• Create Database in SQL Server
• Create Schemas
• Create Tables
• Create Views
• Seed tables with required data
18
Test Example
Test Case:
User API service should register
a new user on Post request
Arrange
Build a request with user’s details
Act
Send the request to User API
service
Assert
All records in SQL tables were
inserted correctly
19
Integrate Tests with the CI Build
• Add one more step
• Instruct step how to run tests
• Parse and analyse build result
• Stop the build on any test failure
20
Example of failed CI build
• Stopping the build on Test Failure
• Does not generate artefacts with
broken version
• No way to deploy the broken
version to a staging server
• Provide fast feedback
21 21
Benefits (or what you can learn from us)
22
API Tests running in CI Build
• Test services in isolation
• Stable and reliable test
results
• Allow breakages to fail a
build
• Provide fast feedback
• Do not require a staging
environment
Level 19, 60 Margaret Street, Sydney NSW 2000 Australia. www.ofx.com
Thank You

More Related Content

What's hot

PP_Eric_Gandt
PP_Eric_GandtPP_Eric_Gandt
PP_Eric_Gandt
Eric Gandt
 
There's more to Ratpack than non-blocking
There's more to Ratpack than non-blockingThere's more to Ratpack than non-blocking
There's more to Ratpack than non-blocking
Marcin Erdmann
 
Validating latest changes with XCI
Validating latest changes with XCIValidating latest changes with XCI
Validating latest changes with XCI
Victor Morales
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core Demos
Erik Noren
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
Erik Noren
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseUsing Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...
Victor Morales
 
Automated Testing in DevOps
Automated Testing in DevOpsAutomated Testing in DevOps
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
Tame your test environment with Docker Compose
Tame your test environment with Docker ComposeTame your test environment with Docker Compose
Tame your test environment with Docker Compose
Kevin Bell
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
laeshin park
 
Сергей Калинец "Стероиды для Дотнетчика"
Сергей Калинец "Стероиды для Дотнетчика"Сергей Калинец "Стероиды для Дотнетчика"
Сергей Калинец "Стероиды для Дотнетчика"
Fwdays
 
Microstrategy Integrity Manager for QA tests automation
Microstrategy Integrity Manager for QA tests automationMicrostrategy Integrity Manager for QA tests automation
Microstrategy Integrity Manager for QA tests automation
Slava Potapenko
 
The Evolution of Continuous Delivery at Scale @ Linkedin
The Evolution of Continuous Delivery at Scale @ LinkedinThe Evolution of Continuous Delivery at Scale @ Linkedin
The Evolution of Continuous Delivery at Scale @ Linkedin
C4Media
 
Sponia with QingCloud
Sponia with QingCloudSponia with QingCloud
Sponia with QingCloud
Gong Haibing
 
Continuous Integration on AWS
Continuous Integration on AWSContinuous Integration on AWS
Continuous Integration on AWS
Petar Petrov
 
How to build a Java Web App in the Cloud
How to build a Java Web App in the CloudHow to build a Java Web App in the Cloud
How to build a Java Web App in the Cloud
WSO2
 
(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS
BIOVIA
 
Serverless
ServerlessServerless
Serverless
Vishwas N
 

What's hot (20)

PP_Eric_Gandt
PP_Eric_GandtPP_Eric_Gandt
PP_Eric_Gandt
 
There's more to Ratpack than non-blocking
There's more to Ratpack than non-blockingThere's more to Ratpack than non-blocking
There's more to Ratpack than non-blocking
 
Validating latest changes with XCI
Validating latest changes with XCIValidating latest changes with XCI
Validating latest changes with XCI
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core Demos
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseUsing Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your Database
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
 
How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...How to contribute to an open source project and don’t die during the Code Rev...
How to contribute to an open source project and don’t die during the Code Rev...
 
Automated Testing in DevOps
Automated Testing in DevOpsAutomated Testing in DevOps
Automated Testing in DevOps
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
 
Tame your test environment with Docker Compose
Tame your test environment with Docker ComposeTame your test environment with Docker Compose
Tame your test environment with Docker Compose
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
Сергей Калинец "Стероиды для Дотнетчика"
Сергей Калинец "Стероиды для Дотнетчика"Сергей Калинец "Стероиды для Дотнетчика"
Сергей Калинец "Стероиды для Дотнетчика"
 
Microstrategy Integrity Manager for QA tests automation
Microstrategy Integrity Manager for QA tests automationMicrostrategy Integrity Manager for QA tests automation
Microstrategy Integrity Manager for QA tests automation
 
The Evolution of Continuous Delivery at Scale @ Linkedin
The Evolution of Continuous Delivery at Scale @ LinkedinThe Evolution of Continuous Delivery at Scale @ Linkedin
The Evolution of Continuous Delivery at Scale @ Linkedin
 
Sponia with QingCloud
Sponia with QingCloudSponia with QingCloud
Sponia with QingCloud
 
Continuous Integration on AWS
Continuous Integration on AWSContinuous Integration on AWS
Continuous Integration on AWS
 
How to build a Java Web App in the Cloud
How to build a Java Web App in the CloudHow to build a Java Web App in the Cloud
How to build a Java Web App in the Cloud
 
(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS
 
Serverless
ServerlessServerless
Serverless
 

Similar to Testing microservices with docker

ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
Alex Thissen
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
Amazon Web Services
 
Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.
ICON UK EVENTS Limited
 
Let's serve your data
Let's serve your dataLet's serve your data
Let's serve your data
Frank van der Linden
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
mbaric
 
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
Laura Frank Tacho
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
Ryan Cuprak
 
Oracle database connection with the .net developers
Oracle database connection with the .net developersOracle database connection with the .net developers
Oracle database connection with the .net developers
veerendramb3
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
Paul Withers
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Amazon Web Services
 
NuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 - Transitioning from OData to JSON-LDNuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 - Transitioning from OData to JSON-LD
Jeff Handley
 
Improving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with DockerImproving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with Docker
Brett Palmer
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
ASP.NET
ASP.NETASP.NET
Apigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM iApigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM i
chukShirley
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
Amazon Web Services
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
Amazon Web Services
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
Learntek1
 

Similar to Testing microservices with docker (20)

ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
 
Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.
 
Let's serve your data
Let's serve your dataLet's serve your data
Let's serve your data
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
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
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
Oracle database connection with the .net developers
Oracle database connection with the .net developersOracle database connection with the .net developers
Oracle database connection with the .net developers
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
NuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 - Transitioning from OData to JSON-LDNuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 - Transitioning from OData to JSON-LD
 
Improving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with DockerImproving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with Docker
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Apigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM iApigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM i
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 

Recently uploaded

@Call @Girls in Tiruppur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
 @Call @Girls in Tiruppur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ... @Call @Girls in Tiruppur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
@Call @Girls in Tiruppur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
Mona Rathore
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
Hironori Washizaki
 
Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01
williamrobertherman
 
Chennai @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Chennai @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real MeetChennai @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Chennai @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
lovelykumarilk789
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S... @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
Mona Rathore
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Major Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara ConferenceMajor Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara Conference
Tier1 app
 
AI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdfAI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdf
ayushiqss
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
DNUG e.V.
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
sofiafernandezon
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Asher Sterkin
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
Philip Schwarz
 
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
arvindkumarji156
 
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai AvailableDombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
cristine510
 
dachnug51 - HCL Domino Roadmap .pdf
dachnug51 - HCL Domino Roadmap      .pdfdachnug51 - HCL Domino Roadmap      .pdf
dachnug51 - HCL Domino Roadmap .pdf
DNUG e.V.
 
@Call @Girls in Surat 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Best High Class Surat Avaulable
 @Call @Girls in Surat 🐱‍🐉  XXXXXXXXXX 🐱‍🐉  Best High Class Surat Avaulable @Call @Girls in Surat 🐱‍🐉  XXXXXXXXXX 🐱‍🐉  Best High Class Surat Avaulable
@Call @Girls in Surat 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Best High Class Surat Avaulable
DiyaSharma6551
 
Kolkata @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Kolkata @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real MeetKolkata @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Kolkata @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
lovelykumarilk789
 

Recently uploaded (20)

@Call @Girls in Tiruppur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
 @Call @Girls in Tiruppur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ... @Call @Girls in Tiruppur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
@Call @Girls in Tiruppur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class ...
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
 
Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01Java SE 17 Study Guide for Certification - Chapter 01
Java SE 17 Study Guide for Certification - Chapter 01
 
Chennai @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Chennai @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real MeetChennai @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Chennai @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S... @Call @Girls in Solapur 🤷‍♂️  XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
@Call @Girls in Solapur 🤷‍♂️ XXXXXXXX 🤷‍♂️ Tanisha Sharma Best High Class S...
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Major Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara ConferenceMajor Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara Conference
 
AI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdfAI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdf
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
 
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
Bhiwandi @Call @Girls Whatsapp 000000000 With Best And No 1
 
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai AvailableDombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Dombivli @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
 
dachnug51 - HCL Domino Roadmap .pdf
dachnug51 - HCL Domino Roadmap      .pdfdachnug51 - HCL Domino Roadmap      .pdf
dachnug51 - HCL Domino Roadmap .pdf
 
@Call @Girls in Surat 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Best High Class Surat Avaulable
 @Call @Girls in Surat 🐱‍🐉  XXXXXXXXXX 🐱‍🐉  Best High Class Surat Avaulable @Call @Girls in Surat 🐱‍🐉  XXXXXXXXXX 🐱‍🐉  Best High Class Surat Avaulable
@Call @Girls in Surat 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Best High Class Surat Avaulable
 
Kolkata @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Kolkata @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real MeetKolkata @Call @Girls 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
Kolkata @Call @Girls 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Genuine WhatsApp Number for Real Meet
 

Testing microservices with docker

  • 1. Denis Brusnin Jan 2018 Testing Microservices with Docker
  • 2. 2 Agenda • E2E Tests: The challenges • Automation Test Strategy • About Docker • Emulating Microservice Dependencies • Benefits of using Docker
  • 3. 3 Require staging environment • The Staging environment is not always up to date • You can deploy one version of each microservice at a time • All tests share the same database • Wasting a lot of resources
  • 6. 6 Slow feedback loop • Build • Generate artifacts • Publish artifacts • Deploy artifacts to a staging server • Execute tests
  • 9. 9 IIS ASP.NET Core User API service (example) User API ENVIRONMENT SQL Server HTTP request HTTP response Redis Cache MongoDB External API AppAppApp
  • 10. 10 About Docker • Docker is an application build and deployment tool • It is based on the idea that you can package your code with dependencies into a deployable unit called a container • Docker Images are an artefact, essentially a snapshot of the contents a container is meant to run
  • 11. 11 Problems solved by Docker • Management of applications • Version control • Distributed management • Low overhead
  • 12. 12 Docker Engine • SERVER a daemon process • CLI command line interface • REST API client to server communication via http
  • 13. 13 Docker Hub • Image Repositories • Automated Builds • Webhooks • Organizations
  • 14. 14 Dockerize Microservice • Create a Dockerfile for your application • Build and run the Docker image • Check the service is running from a container
  • 15. 15 A typical API Tests Test Case: User API service should register a new user Arrange Build a POST request with user’s details Act Send the request to User API service Assert HTTP Status code returned, all records in SQL tables were inserted correctly User API Test SQL SERVER
  • 16. 16 API Test Framework • Setup • Execute Tests • Clean up Container ASP .NET Core User API DOCKER HOST Container SQL Server HTTP request HTTP response Container Redis Cache Container MongoDB Mock External API Test Orchestrator
  • 17. 17 Data Seeding Execute SQL scripts to • Create Database in SQL Server • Create Schemas • Create Tables • Create Views • Seed tables with required data
  • 18. 18 Test Example Test Case: User API service should register a new user on Post request Arrange Build a request with user’s details Act Send the request to User API service Assert All records in SQL tables were inserted correctly
  • 19. 19 Integrate Tests with the CI Build • Add one more step • Instruct step how to run tests • Parse and analyse build result • Stop the build on any test failure
  • 20. 20 Example of failed CI build • Stopping the build on Test Failure • Does not generate artefacts with broken version • No way to deploy the broken version to a staging server • Provide fast feedback
  • 21. 21 21 Benefits (or what you can learn from us)
  • 22. 22 API Tests running in CI Build • Test services in isolation • Stable and reliable test results • Allow breakages to fail a build • Provide fast feedback • Do not require a staging environment
  • 23. Level 19, 60 Margaret Street, Sydney NSW 2000 Australia. www.ofx.com Thank You

Editor's Notes

  1. The QA environment is not always up to date. Sometimes, some teams simply forget to deploy the last version of their software. As a result, the QA team tests old features. You can only deploy one version of each microservice at a time. what if first engineer needs to test featureA and the second engineer needs to test FeatureB. All our tests run with the same databases … we simply can’t assure the correct isolation of tests Test environment is not coming for free. Having and maintain a lot of environments is expensive.
  2. Fragile tests do not point broken code.
  3. Test execution speed Test run of 20 minutes is not accessible for us. If my tests are taking too long to finish due to remote call to external service, I might just mock it and have one single integration test to cover it and not pay a cost in every test. Our team commits code about 10 times per day and making test suite run 10 minutes faster can save 1000 minutes collectively across the team.
  4. Typical CI/CD pipeline.
  5. Unit tests are fast running tests that are quick to debug. They cover the bulk of our testing strategy. Integration tests: They run slower than unit tests and test component integration points. Acceptance tests: These are end-to-end (E2E) test cases and consist of happy user journeys and critical failure scenarios, which cannot be tested by unit or integration tests.
  6. Classical 3-tier application architecture Unit tests are fast running tests that are quick to debug. They cover the bulk of our testing strategy. We write JavaScript unit tests for basic components rendering, events and event handlers, we test all client validation cases for example email or phone fields, etc. Write API service level unit for each of code modules (these are typically classes, functions, dynamic queries, or some other units) to ensure that each unit in isolation performs as it should. All service validation tests such as checking for mandatory fields in incoming requests are also covered by unit tests. Integration Tests run slower than unit tests and test component integration points. For UI we do browser based tests with mocking service calls to API components We avoid any validation testing in integration tests as it’s already covered by unit tests. We also do data contract testing to validate data contracts between Frontend application and API service satisfy each other. E2E E2E acceptance tests with one happy path only.
  7. Since each test run uses a new, fresh instance if database we need to create all required schemas, table and views required for our Microservice. This steps usually takes no more than two seconds.
  8. Artifacts were not generated, so no one cannot deploy the broken application. Fast feedback loop.