SlideShare a Scribd company logo
1 of 48
To cover
uncoverable
Andrii Shumada
WalkMe
It’s about
tests!
...and infrastructure around them!
Why do we need
tests*?
* by tests I mean autotests. I’m a
developer(R&D Team Lead). I hate
manual testing.
We want to have
less bugs in
production!
How our production looks like?
Frontend
Backend
DataBase
Web server
HTTP
Requests
How our backend tests should look like
Tests
Integration tests
MongoDB
Node.js
HTTP
Requests
Requirements for our tests
01
04
02
03
Easy to write Easy to setup
locally
Easy to setup
in CI/CD
As close to
production
environment
Simple Node.js app
Patron, dog mascot of the State Emergency
Service of Ukraine
*Patron translates as “bullet”
Mac
OS
Windo
ws
Linux
Intel 1 2 ∞
Arm 3 4 ∞
What are the options to run 3rd parties? (MongoDB)
Pros:
- easy to run in all
envs
01 02
Mock it Run real db on your computer
Cons:
- Will not represent
production
- Chance to
implement mocks
wrongly
Pros:
- Familiar way to
start DB
- Real DB
Cons:
- Different setup for
local envs and for CI
Where we can run 3rd parties? (MongoDB)
04
03 Use dedicated cloud infra
for tests
Run everything in docker
ecosystem
Pros:
- As close to
production as
possible
Cons:
- Hard to isolate test
runs
- Might require VPN
access to internal
resources
- Can cost money
Pros:
- easy to run in all
envs
- Close to production
Cons:
- Initial setup might
take some time
- Debug in containers
is harder
Running tests in Docker infra is
hard?
01
04
02
05
03
Build image for
an app
Spin all the
services
Run tests in
container
Change the
code or the
tests
Repeat 1 and 3
and 4?
What If I tell you that we can solve
all our problems with one command?
docker compose run --rm nodejs-app-test
docker compose run --rm nodejs-app-test
docker-compose.yaml
https://github.com/eagleeye/to-cover-uncoverable
https://gitlab.com/andrii.shumada/to-cover-uncoverable
Dockerfile
Easy to setup in CI (gitlab)
…as well as on github.com
How our production looks like? (2)
Frontend
Backend
Queue
Node.js app
HTTP
Requests
What’s wrong with Kafka tests?
● Recreating topic is time
consuming
● There is no key-value access
● Failed test runs can produce
more messages then read
Sample Kafka producer app
https://github.com/eagleeye/to-cover-uncoverable/tree/master/02-kafka
https://gitlab.com/andrii.shumada/to-cover-uncoverable/-/tree/master/02-kafka
Simple test with kafka
Start zookeeper
Start Kafka
Build Node.js
Docker image
Run tests
Order of subtasks to run tests with Kafka
docker-compose.yaml
.gituhub/workflows/test-with-github.yaml .gitlab-ci.yml
How our production looks like? (3)
Frontend
Backend
Node.js app
HTTP
Requests
Localstack - mocks of AWS services
docker-compose.yml
https://localstack.cloud/
*
* better to fix version
- Lambda
- Kinesis
- Redshift
- DynamoDB
- ElastiCache
…and 45 more services
Node.js app
DataStore
Cloud functions
Big Query
Not all the 3rd parties we can run
locally…
For DataStore
Managing shared cloud resources could be
hard, specially when you have multiple
developers trying to reach your resources
Cloud function
Option 2
Spin up cloud function
emulator
Write unit test for
controller
Option 1
Testing cloud functions
https://cloud.google.com/functi
ons/docs/testing/test-http
Or
Personal
experience
What if our production production is
even more complex? (4)
We tested all the gears, but will it
work a gearbox..
No way that you can write
that complex test…*
You need more than
1 team to develop,
maintain and test
that
*I know you can,,,
Where we can run 3rd parties? (Google services)
04
03
Use dedicated cloud infra
for tests
Run everything in docker
ecosystem
Pros:
- As close to
production as
possible
Cons:
- Hard to setup
isolation for
separate tests
- Might require VPN
access to internal
resources
Pros:
- easy to run in all
envs
- Close to production
Cons:
- Initial setup might
take some time
- Debug in containers
is harder
Continuous QA in Qa environment to the rescue!
Service that
constantly
sends data
in QA
(emulates
clients)
HTTP
Requests
Grafana
(any monitoring)
Zoo of services
and 3rd parties
How grafana
appeared here?
How I know that my
product (apps and
infrastructure) works
properly in
production?
1) I don’t receive calls from
support and my boss
2) Metrics and alerts
Metrics and alerts on:
- Status codes
- Number of error logs
- Business metrics
- Container restarts
- Resources usage
How can I know, that
my product works in
QA?
Example of continuous test
Client
automation
HTTP
Requests
- 10 valid POST
/pets requests
with unique pets
- 5 invalid
requests
- 5 valid GET
/pet/:id requests
- 15 of 200 status codes
- 5 of 400 status codes
- Incoming records per second in
topic should be 10
- Increased number of items in
your database by 10
- Cloud function was executed 10
times
- Cloud function executions
finished without errors
- No logs with severity > error
- No restarts in all containers
- CPU, memory, disk metrics
should be < 80%
- …..
Sends similar
requests
Every second
Conclusion
- Use Docker compose infrastructure to
organize your local development
infrastructure and as infrastructure for
tests locally and on CI/CD
- Use continuous testing in your QA
environment by making automated
requests to your infra and monitoring
should catch problems if they occur
Thanks!
Do you have any questions?
Leave them in Youtube comment or
Discord: Voice Chat: Voice WDDay
eagleeyes91@gmail.com
https://eagleeye.github.io
https://gitlab.com/andrii.shumada/to-cover-uncoverable
https://github.com/eagleeye/to-cover-uncoverable
https://u24.gov.ua/
Remember to support Ukraine!

More Related Content

Similar to АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js

Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeCybera Inc.
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsMarcelo Pinheiro
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Yan Cui
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
Cloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerizationCloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerizationMárton Kodok
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Yan Cui
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleArnaud LEMAIRE
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!DoiT International
 
Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Andrew Yatsenko
 
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...LF_DPDK
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!Docker, Inc.
 
Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Maarten Balliauw
 
Docker interview Questions-3.pdf
Docker interview Questions-3.pdfDocker interview Questions-3.pdf
Docker interview Questions-3.pdfYogeshwaran R
 
Building services on AWS in China region
Building services on AWS in China regionBuilding services on AWS in China region
Building services on AWS in China regionRoman Naumenko
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise ApplicationsDaniel Oh
 

Similar to АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js (20)

Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and moreWhere should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and more
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
Cloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerizationCloud Run - the rise of serverless and containerization
Cloud Run - the rise of serverless and containerization
 
Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)Serverless in Production, an experience report (AWS UG South Wales)
Serverless in Production, an experience report (AWS UG South Wales)
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
 
Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2Performance profiling and testing of symfony application 2
Performance profiling and testing of symfony application 2
 
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...
LF_DPDK17_rte_raw_device: implementing programmable accelerators using generi...
 
Terraform
TerraformTerraform
Terraform
 
Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
 
Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...
 
Docker interview Questions-3.pdf
Docker interview Questions-3.pdfDocker interview Questions-3.pdf
Docker interview Questions-3.pdf
 
Building services on AWS in China region
Building services on AWS in China regionBuilding services on AWS in China region
Building services on AWS in China region
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
 

More from WDDay

РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 js
РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 jsРОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 js
РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 jsWDDay
 
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...WDDay
 
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 js
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 jsМАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 js
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 jsWDDay
 
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...WDDay
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021WDDay
 
РОМАН САВІЦЬКИЙ «Core Web Vitals» Online WDDay 2021
РОМАН САВІЦЬКИЙ «Core Web Vitals»  Online WDDay 2021РОМАН САВІЦЬКИЙ «Core Web Vitals»  Online WDDay 2021
РОМАН САВІЦЬКИЙ «Core Web Vitals» Online WDDay 2021WDDay
 
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET» O...
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET»  O...ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET»  O...
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET» O...WDDay
 
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...WDDay
 

More from WDDay (8)

РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 js
РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 jsРОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 js
РОМАН САВІЦЬКИЙ «Web Accesability» Online WDDay 2022 js
 
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...
НАЗАРІЙ РОМАНКІВ «Top three questions that people fail in interviews about No...
 
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 js
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 jsМАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 js
МАКСИМ МОСТОВИЙ «Візуалізація даних на фронт енді» Online WDDay 2022 js
 
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...
ОЛЕКСІЙ ГОЛУБЄВ «Electron. Як використовуючи WEB framework’і створити багатоп...
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
 
РОМАН САВІЦЬКИЙ «Core Web Vitals» Online WDDay 2021
РОМАН САВІЦЬКИЙ «Core Web Vitals»  Online WDDay 2021РОМАН САВІЦЬКИЙ «Core Web Vitals»  Online WDDay 2021
РОМАН САВІЦЬКИЙ «Core Web Vitals» Online WDDay 2021
 
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET» O...
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET»  O...ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET»  O...
ВІТАЛІЙ ГОНЧАРУК «За допомогою чого пишуться серйозні веб додатки на .NET» O...
 
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...
ВЛАДИСЛАВ ЄРМОЛАЄВ «Чому варто використовувати CSS Grid Layout на реальних пр...
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js

  • 3. Why do we need tests*? * by tests I mean autotests. I’m a developer(R&D Team Lead). I hate manual testing.
  • 4. We want to have less bugs in production!
  • 5. How our production looks like? Frontend Backend DataBase Web server HTTP Requests
  • 6. How our backend tests should look like Tests Integration tests MongoDB Node.js HTTP Requests
  • 7. Requirements for our tests 01 04 02 03 Easy to write Easy to setup locally Easy to setup in CI/CD As close to production environment
  • 9.
  • 10. Patron, dog mascot of the State Emergency Service of Ukraine *Patron translates as “bullet”
  • 11. Mac OS Windo ws Linux Intel 1 2 ∞ Arm 3 4 ∞ What are the options to run 3rd parties? (MongoDB) Pros: - easy to run in all envs 01 02 Mock it Run real db on your computer Cons: - Will not represent production - Chance to implement mocks wrongly Pros: - Familiar way to start DB - Real DB Cons: - Different setup for local envs and for CI
  • 12. Where we can run 3rd parties? (MongoDB) 04 03 Use dedicated cloud infra for tests Run everything in docker ecosystem Pros: - As close to production as possible Cons: - Hard to isolate test runs - Might require VPN access to internal resources - Can cost money Pros: - easy to run in all envs - Close to production Cons: - Initial setup might take some time - Debug in containers is harder
  • 13. Running tests in Docker infra is hard? 01 04 02 05 03 Build image for an app Spin all the services Run tests in container Change the code or the tests Repeat 1 and 3 and 4?
  • 14. What If I tell you that we can solve all our problems with one command? docker compose run --rm nodejs-app-test
  • 15. docker compose run --rm nodejs-app-test docker-compose.yaml
  • 18. Easy to setup in CI (gitlab)
  • 19.
  • 20.
  • 21. …as well as on github.com
  • 22. How our production looks like? (2) Frontend Backend Queue Node.js app HTTP Requests
  • 23. What’s wrong with Kafka tests? ● Recreating topic is time consuming ● There is no key-value access ● Failed test runs can produce more messages then read
  • 24. Sample Kafka producer app https://github.com/eagleeye/to-cover-uncoverable/tree/master/02-kafka https://gitlab.com/andrii.shumada/to-cover-uncoverable/-/tree/master/02-kafka
  • 26.
  • 27. Start zookeeper Start Kafka Build Node.js Docker image Run tests Order of subtasks to run tests with Kafka
  • 30.
  • 31.
  • 32. How our production looks like? (3) Frontend Backend Node.js app HTTP Requests
  • 33. Localstack - mocks of AWS services docker-compose.yml https://localstack.cloud/ * * better to fix version - Lambda - Kinesis - Redshift - DynamoDB - ElastiCache …and 45 more services
  • 34. Node.js app DataStore Cloud functions Big Query Not all the 3rd parties we can run locally…
  • 35. For DataStore Managing shared cloud resources could be hard, specially when you have multiple developers trying to reach your resources
  • 36. Cloud function Option 2 Spin up cloud function emulator Write unit test for controller Option 1
  • 38. What if our production production is even more complex? (4)
  • 39. We tested all the gears, but will it work a gearbox..
  • 40. No way that you can write that complex test…* You need more than 1 team to develop, maintain and test that *I know you can,,,
  • 41. Where we can run 3rd parties? (Google services) 04 03 Use dedicated cloud infra for tests Run everything in docker ecosystem Pros: - As close to production as possible Cons: - Hard to setup isolation for separate tests - Might require VPN access to internal resources Pros: - easy to run in all envs - Close to production Cons: - Initial setup might take some time - Debug in containers is harder
  • 42. Continuous QA in Qa environment to the rescue! Service that constantly sends data in QA (emulates clients) HTTP Requests Grafana (any monitoring) Zoo of services and 3rd parties
  • 44. How I know that my product (apps and infrastructure) works properly in production? 1) I don’t receive calls from support and my boss 2) Metrics and alerts
  • 45. Metrics and alerts on: - Status codes - Number of error logs - Business metrics - Container restarts - Resources usage How can I know, that my product works in QA?
  • 46. Example of continuous test Client automation HTTP Requests - 10 valid POST /pets requests with unique pets - 5 invalid requests - 5 valid GET /pet/:id requests - 15 of 200 status codes - 5 of 400 status codes - Incoming records per second in topic should be 10 - Increased number of items in your database by 10 - Cloud function was executed 10 times - Cloud function executions finished without errors - No logs with severity > error - No restarts in all containers - CPU, memory, disk metrics should be < 80% - ….. Sends similar requests Every second
  • 47. Conclusion - Use Docker compose infrastructure to organize your local development infrastructure and as infrastructure for tests locally and on CI/CD - Use continuous testing in your QA environment by making automated requests to your infra and monitoring should catch problems if they occur
  • 48. Thanks! Do you have any questions? Leave them in Youtube comment or Discord: Voice Chat: Voice WDDay eagleeyes91@gmail.com https://eagleeye.github.io https://gitlab.com/andrii.shumada/to-cover-uncoverable https://github.com/eagleeye/to-cover-uncoverable https://u24.gov.ua/ Remember to support Ukraine!