SlideShare ist ein Scribd-Unternehmen logo
1 von 29
INTEGRATION TESTING AS
VALIDATION AND MONITORING
Melissa Benua
Senior Backend Engineer
PlayFab, Inc
STARWEST 2015
The challenge: Monitoring SaaS products
Software as a service is exploding, and so is testing complexity:
1. Not enough just to run tests at build time, now you also need need
deploy-time integration tests and continuous network monitoring
2. Every layer of tests adds
complexity & maintenance costs
3. There are a limited amount
of engineer-hours in the day
4. Engineers want to use their time
with maximum efficiency
Time spent writing the same tests over again is time that could be spent doing more
interesting and important stuff!
EXISTING OPTIONS
Commercial products you can buy now!
3
Cloud Monitoring Services
Providers:
• Keynote
• Gomez
• Pingdom
Pros:
• Lightweight
• Integrated alerting
• Public vs. private status pages
Cons:
• Difficult to manage multiple contributors
• Can’t do complex checks easily (log in a user and verify inventory)
• Can get expensive or require enterprise contracts
Hosted Monitoring Services
Providers:
• Sensu
• System Center Operations
Manager (SCOM)
• Nagios
Pros:
• Extremely powerful
• Older technology
Cons:
• Complex to set up
• Single centralized server
• Overkill for many services hosted in the cloud
OUR APPROACH
Do it the PlayFab way!
October 5, 2015 PlayFab Confidential 6
Our Solution
1. Author one set of HTTP-level tests
• Same as how clients connect
• Self-contained and self-initializing
• Repeatable and reliable
2. Deploy tests both within the build environment
and within the monitoring cloud
3. Collect data from tests into one central location
4. Present data for use by both devops and customers
Pros:
• Efficient use of engineering resources
• VM hosting bill is very small
• Can run complex tests without
worrying about maintainability
Cons:
• Pipeline requires some maintenance
• Requires knowing how to use two
different clouds
• Must be able to do test setup from
within a different ecosystem
Our solution, cont’d
Goals:
• Minimize number of lines of code
duplicated per functional piece
• Reliable & trustworthy reporting
• Affordable cost
• Adequate geo-location
• Very low maintenance time cost
• Easy to access
• More free time for engineering!
Limitations:
• Smaller # of monitoring leaf nodes (~10 instead of ~100 or ~1000)
• Vulnerable to gaps in dev logic
• Not as straightforward to set up
• Monitoring is only as good as your testing!
TESTING SCENARIOS
One of these may look familiar!
October 5, 2015 PlayFab Confidential 9
Scenario A – RESTful API
Sample characteristics:
• Custom service in Java layered on Apache
• Private hosting
• Tests via Junit
• Authenticates using private login
• Connects to several different backend
services (mongodb, sql, analytics,
queueing, etc)
Scenario B – MVC Website
Sample characteristics:
• Built on .net MVC
• Hosted in Azure
• Testing via custom harness
• Authenticates using OAuth and Facebook
• Backends into locally-hosted SQL server
Scenario C - PlayFab
Characteristics:
• JSON API built on C# + management website
• https://api.playfab.com/documentation
• Hosted in Windows on AWS
• Tests via VSTest
• Many moving parts
• Game server hosting
• Client versus server authentication
• Third-party purchasing and auth providers
• Various backend data sources
IMPLEMENTING OUR SOLUTION
How to wire up the pipeline!
October 5, 2015 PlayFab Confidential 13
Architecture
14
Build Server
 Compiles code
 Runs tests
Production
Deploys
Web Server
 Collects Data
Web Site
 Displays Data
Developer
Writes
Tests
Europe
Microsoft Azure
US-West US-East Asia
Amazon Web Services
Submits Code
Utilized Tech
Test Framework
• VSTest or Junit or custom executor
• Must output a predictable, machine-readable format
(.TRX from VSTest comes with an XSD for easy parsing)
Execution + Communication Layer
• Consul or custom cross-DC chatter
• Consul API is in many languages, easy to secure and simple configure
• Regularly executes the test executable
• Shares test results as ‘service health checks’ across DCs
Custom Data Bridge
• Transform test framework output into Consul input
Picking Monitoring Tests
October 5, 2015 PlayFab Confidential 16
Full App
Integration Test
Suite
Internal Service A
Test Suite
Library Unit
Test Suite
Integration
Suite
Internal Service B
Test Suite
Integration
Suite
Picking Monitoring Tests, con’t
Must-haves:
• Happen at same layer clients access (HTTP,
generally)
• Cover key ‘P0’ functionality areas
• Cover areas with lots of ‘moving parts’
Nice-to-haves:
• All exposed APIs
• Third-party integrations
• Full success-testing run
Ideal world:
• Full integration test suite
Scenario Must-Have Test Cases
REST API
• Login/Authenticate
• Logout
• One test per downstream
service
• Stretch: one test per API
MVC Website
• One test per login method
(OAuth, Facebook)
• Key pages
• Basic SQL coverage
Deployment Pipeline
The fewer manual steps the better!
Sample flow:
Submit Code
to Repo
CI Runs
Build
CI Runs Tests
Deployment
Packages
Created
Tests
Deployed
into Monitor
Cloud
Storage
Cloud
Storage
Distributes
to VMs
Monitoring Cloud
Any cloud will do!
Number of regions is important
• Azure has https://azure.microsoft.com/en-us/regions/#services
• AWS has http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region
VMs can be teeny – no need for heavy compute or memory usage
Test Execution Frequency
How complex is it to run your tests?
• Run a simple executable?
• Have to download a lot of data?
• Long setup phase?
• How long does a full test pass take?
Periodic execution (every N seconds)
Faster is better! Pingdom ‘free’ tier is every 15 minutes per check
Ideal range is between 30 seconds and 5 minutes
Be careful not to drown your ‘real traffic’
• Test traffic hiding problems with real users is a legitimate issue!
• Try to stay under 10% of total traffic if possible
Collecting Results
Execute Tests
Put machine-readable test results into collator
• Consul accepts Datacenter, CaseName, Pass/Warn/Fail, Note (we store latency)
• Agents may be updated using SDK or direct to HTTP interface
• Example: http://localhost:8500/v1/agent/check/pass/mytestcase
• Full HTTP API: https://www.consul.io/docs/agent/http.html
Small adapter program reads test results and outputs to Consul Agent
(SDK or HTTP)
Output!
Alerting
Ideal to hear about outages as a push rather than a pull
Determine what ‘failure’ means to you
• Balance between false alarms and missing real alarms
Many options!
• Post alerts into VictorOps for paging
• Send email from monitoring website
• Send push notification through your cloud
Questions?
Melissa Benua
mbenua@gmail.com
https://www.linkedin.com/in/mbenua
http://www.slideshare.net/MelissaBenua
APPENDIX
Technical Details and Sample Config
October 5, 2015 PlayFab Confidential 26
Partial Consul Configuration
{
"datacenter": "prd-uswest1",
"retry_join_wan": [ “west.cloudapp.net",
“east.cloudapp.net" ],
"server": true,
"service": {
"name": "pfmonitor",
"checks": [
{
"script":
"C:WindowsSystem32WindowsPowerShellv1.0powershell
.exe -file c:runtests.ps1",
"interval": "120s"
}
]
}
}
Consul Commands
Full HTTP API: https://www.consul.io/docs/agent/http.html
Add a health check:
$body =
{
"ID": “mypath",
"Name": "Path Works",
"Notes": "Checking uptime and latency",
"HTTP": "http://my.service.com/path",
"TTL": "45s"
}
• Invoke-WebRequest http://localhost:8500/v1/agent/check/register -Body $body
List the health checks:
• Invoke-WebRequest http://localhost:8500/v1/health/checks/myservice
[
{
"Node": "somenode",
"CheckID": “mypath",
"Name": “Path Works",
"Status": "passing",
},
]
Consul Commands
Update a health check:
• Can add ?note=foo to pass details like latency
• Invoke-WebRequest
http://localhost:8500/v1/agent/check/pass/mypath
• Invoke-WebRequest
http://localhost:8500/v1/agent/check/warn/mypath
• Invoke-WebRequest
http://localhost:8500/v1/agent/check/fail/mypath

Weitere ähnliche Inhalte

Was ist angesagt?

Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable productJulian Simpson
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationhugo lu
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery appliedMike McGarr
 
Continuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioContinuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioDavide Benvegnù
 
Continuous Integration and Builds
Continuous Integration and BuildsContinuous Integration and Builds
Continuous Integration and BuildsBhavin Javia
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitAlexander Vanwynsberghe
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationamscanne
 
Why NXTware Remote for Jenkins
Why NXTware Remote for JenkinsWhy NXTware Remote for Jenkins
Why NXTware Remote for Jenkinsecubemarketing
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Amazon Web Services
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha
 
Deploy applications with TFS Build
Deploy applications with TFS BuildDeploy applications with TFS Build
Deploy applications with TFS BuildGian Maria Ricci
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014David Funaro
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013David Funaro
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportSencha
 
#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360Derek Chan
 
Standardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins TeamStandardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins TeamDeborah Schalm
 

Was ist angesagt? (20)

Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
 
Continuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioContinuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenario
 
Continuous Integration 101
Continuous Integration 101Continuous Integration 101
Continuous Integration 101
 
CI with TFS
CI with TFSCI with TFS
CI with TFS
 
Continuous Integration and Builds
Continuous Integration and BuildsContinuous Integration and Builds
Continuous Integration and Builds
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and Git
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Why NXTware Remote for Jenkins
Why NXTware Remote for JenkinsWhy NXTware Remote for Jenkins
Why NXTware Remote for Jenkins
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Deploy applications with TFS Build
Deploy applications with TFS BuildDeploy applications with TFS Build
Deploy applications with TFS Build
 
The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014The Continuous delivery Value @ codemotion 2014
The Continuous delivery Value @ codemotion 2014
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360
 
Standardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins TeamStandardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins Team
 

Andere mochten auch

Commander's Intent: Managing Through Uncertainty
Commander's Intent: Managing Through UncertaintyCommander's Intent: Managing Through Uncertainty
Commander's Intent: Managing Through UncertaintyJames Gwertzman
 
PlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptPlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptThomas Robbins
 
Say hello to the new PlayFab!
Say hello to the new PlayFab!Say hello to the new PlayFab!
Say hello to the new PlayFab!Thomas Robbins
 
Owning Web Performance with PhantomJS 2 - Fluent 2016
Owning Web Performance with PhantomJS 2 - Fluent 2016Owning Web Performance with PhantomJS 2 - Fluent 2016
Owning Web Performance with PhantomJS 2 - Fluent 2016Wesley Hales
 
No Free Lunch: Transactions in Online Games
No Free Lunch: Transactions in Online GamesNo Free Lunch: Transactions in Online Games
No Free Lunch: Transactions in Online GamesJames Gwertzman
 
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...ProductNation/iSPIRT
 
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game GloballyBehind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game GloballyJames Gwertzman
 
Building the pipeline for FUN - Game Development
 Building the pipeline for FUN - Game Development Building the pipeline for FUN - Game Development
Building the pipeline for FUN - Game DevelopmentFaunaFace, Inc
 
The Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsThe Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsJames Gwertzman
 
Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Amazon Web Services
 

Andere mochten auch (11)

Commander's Intent: Managing Through Uncertainty
Commander's Intent: Managing Through UncertaintyCommander's Intent: Managing Through Uncertainty
Commander's Intent: Managing Through Uncertainty
 
PlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptPlayFab Advanced Cloud Script
PlayFab Advanced Cloud Script
 
Say hello to the new PlayFab!
Say hello to the new PlayFab!Say hello to the new PlayFab!
Say hello to the new PlayFab!
 
Owning Web Performance with PhantomJS 2 - Fluent 2016
Owning Web Performance with PhantomJS 2 - Fluent 2016Owning Web Performance with PhantomJS 2 - Fluent 2016
Owning Web Performance with PhantomJS 2 - Fluent 2016
 
No Free Lunch: Transactions in Online Games
No Free Lunch: Transactions in Online GamesNo Free Lunch: Transactions in Online Games
No Free Lunch: Transactions in Online Games
 
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...
Nuts and Bolts of Marketing & selling SaaS products to US customers from Indi...
 
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game GloballyBehind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
 
Building the pipeline for FUN - Game Development
 Building the pipeline for FUN - Game Development Building the pipeline for FUN - Game Development
Building the pipeline for FUN - Game Development
 
The Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsThe Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need Backends
 
Epic Fails in LiveOps
Epic Fails in LiveOpsEpic Fails in LiveOps
Epic Fails in LiveOps
 
Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout Deploying a Low-Latency Multiplayer Game Globally: Loadout
Deploying a Low-Latency Multiplayer Game Globally: Loadout
 

Ähnlich wie Integration Testing as Validation and Monitoring

Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectDevOps.com
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service FabricDavide Benvegnù
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAmazon Web Services
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)CIVEL Benoit
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1CIVEL Benoit
 
Performance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSPerformance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSMatthias Matook
 
Presentation on 3 Pillars of DevOps - Kovair DevOps
Presentation on 3 Pillars of DevOps - Kovair DevOpsPresentation on 3 Pillars of DevOps - Kovair DevOps
Presentation on 3 Pillars of DevOps - Kovair DevOpsKovair
 
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...Amazon Web Services
 
Continuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerContinuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerAmazon Web Services
 
Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401Amazon Web Services
 
Continuous Integration Testing for SAP
Continuous Integration Testing for SAPContinuous Integration Testing for SAP
Continuous Integration Testing for SAPWorksoft
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Shelley Lambert
 
15-factor-apps.pdf
15-factor-apps.pdf15-factor-apps.pdf
15-factor-apps.pdfNilesh Gule
 
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Startupfest
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPhil Leggetter
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkinsecubemarketing
 

Ähnlich wie Integration Testing as Validation and Monitoring (20)

Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
Next-gen Automation Framework
Next-gen Automation FrameworkNext-gen Automation Framework
Next-gen Automation Framework
 
Performance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWSPerformance testing with 100,000 concurrent users in AWS
Performance testing with 100,000 concurrent users in AWS
 
Presentation on 3 Pillars of DevOps - Kovair DevOps
Presentation on 3 Pillars of DevOps - Kovair DevOpsPresentation on 3 Pillars of DevOps - Kovair DevOps
Presentation on 3 Pillars of DevOps - Kovair DevOps
 
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
 
Continuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerContinuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and Docker
 
Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401
 
Continuous Integration Testing for SAP
Continuous Integration Testing for SAPContinuous Integration Testing for SAP
Continuous Integration Testing for SAP
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014
 
15-factor-apps.pdf
15-factor-apps.pdf15-factor-apps.pdf
15-factor-apps.pdf
 
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 

Kürzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Integration Testing as Validation and Monitoring

  • 1. INTEGRATION TESTING AS VALIDATION AND MONITORING Melissa Benua Senior Backend Engineer PlayFab, Inc STARWEST 2015
  • 2. The challenge: Monitoring SaaS products Software as a service is exploding, and so is testing complexity: 1. Not enough just to run tests at build time, now you also need need deploy-time integration tests and continuous network monitoring 2. Every layer of tests adds complexity & maintenance costs 3. There are a limited amount of engineer-hours in the day 4. Engineers want to use their time with maximum efficiency Time spent writing the same tests over again is time that could be spent doing more interesting and important stuff!
  • 4. Cloud Monitoring Services Providers: • Keynote • Gomez • Pingdom Pros: • Lightweight • Integrated alerting • Public vs. private status pages Cons: • Difficult to manage multiple contributors • Can’t do complex checks easily (log in a user and verify inventory) • Can get expensive or require enterprise contracts
  • 5. Hosted Monitoring Services Providers: • Sensu • System Center Operations Manager (SCOM) • Nagios Pros: • Extremely powerful • Older technology Cons: • Complex to set up • Single centralized server • Overkill for many services hosted in the cloud
  • 6. OUR APPROACH Do it the PlayFab way! October 5, 2015 PlayFab Confidential 6
  • 7. Our Solution 1. Author one set of HTTP-level tests • Same as how clients connect • Self-contained and self-initializing • Repeatable and reliable 2. Deploy tests both within the build environment and within the monitoring cloud 3. Collect data from tests into one central location 4. Present data for use by both devops and customers Pros: • Efficient use of engineering resources • VM hosting bill is very small • Can run complex tests without worrying about maintainability Cons: • Pipeline requires some maintenance • Requires knowing how to use two different clouds • Must be able to do test setup from within a different ecosystem
  • 8. Our solution, cont’d Goals: • Minimize number of lines of code duplicated per functional piece • Reliable & trustworthy reporting • Affordable cost • Adequate geo-location • Very low maintenance time cost • Easy to access • More free time for engineering! Limitations: • Smaller # of monitoring leaf nodes (~10 instead of ~100 or ~1000) • Vulnerable to gaps in dev logic • Not as straightforward to set up • Monitoring is only as good as your testing!
  • 9. TESTING SCENARIOS One of these may look familiar! October 5, 2015 PlayFab Confidential 9
  • 10. Scenario A – RESTful API Sample characteristics: • Custom service in Java layered on Apache • Private hosting • Tests via Junit • Authenticates using private login • Connects to several different backend services (mongodb, sql, analytics, queueing, etc)
  • 11. Scenario B – MVC Website Sample characteristics: • Built on .net MVC • Hosted in Azure • Testing via custom harness • Authenticates using OAuth and Facebook • Backends into locally-hosted SQL server
  • 12. Scenario C - PlayFab Characteristics: • JSON API built on C# + management website • https://api.playfab.com/documentation • Hosted in Windows on AWS • Tests via VSTest • Many moving parts • Game server hosting • Client versus server authentication • Third-party purchasing and auth providers • Various backend data sources
  • 13. IMPLEMENTING OUR SOLUTION How to wire up the pipeline! October 5, 2015 PlayFab Confidential 13
  • 14. Architecture 14 Build Server  Compiles code  Runs tests Production Deploys Web Server  Collects Data Web Site  Displays Data Developer Writes Tests Europe Microsoft Azure US-West US-East Asia Amazon Web Services Submits Code
  • 15. Utilized Tech Test Framework • VSTest or Junit or custom executor • Must output a predictable, machine-readable format (.TRX from VSTest comes with an XSD for easy parsing) Execution + Communication Layer • Consul or custom cross-DC chatter • Consul API is in many languages, easy to secure and simple configure • Regularly executes the test executable • Shares test results as ‘service health checks’ across DCs Custom Data Bridge • Transform test framework output into Consul input
  • 16. Picking Monitoring Tests October 5, 2015 PlayFab Confidential 16 Full App Integration Test Suite Internal Service A Test Suite Library Unit Test Suite Integration Suite Internal Service B Test Suite Integration Suite
  • 17. Picking Monitoring Tests, con’t Must-haves: • Happen at same layer clients access (HTTP, generally) • Cover key ‘P0’ functionality areas • Cover areas with lots of ‘moving parts’ Nice-to-haves: • All exposed APIs • Third-party integrations • Full success-testing run Ideal world: • Full integration test suite
  • 18. Scenario Must-Have Test Cases REST API • Login/Authenticate • Logout • One test per downstream service • Stretch: one test per API MVC Website • One test per login method (OAuth, Facebook) • Key pages • Basic SQL coverage
  • 19. Deployment Pipeline The fewer manual steps the better! Sample flow: Submit Code to Repo CI Runs Build CI Runs Tests Deployment Packages Created Tests Deployed into Monitor Cloud Storage Cloud Storage Distributes to VMs
  • 20. Monitoring Cloud Any cloud will do! Number of regions is important • Azure has https://azure.microsoft.com/en-us/regions/#services • AWS has http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region VMs can be teeny – no need for heavy compute or memory usage
  • 21. Test Execution Frequency How complex is it to run your tests? • Run a simple executable? • Have to download a lot of data? • Long setup phase? • How long does a full test pass take? Periodic execution (every N seconds) Faster is better! Pingdom ‘free’ tier is every 15 minutes per check Ideal range is between 30 seconds and 5 minutes Be careful not to drown your ‘real traffic’ • Test traffic hiding problems with real users is a legitimate issue! • Try to stay under 10% of total traffic if possible
  • 22. Collecting Results Execute Tests Put machine-readable test results into collator • Consul accepts Datacenter, CaseName, Pass/Warn/Fail, Note (we store latency) • Agents may be updated using SDK or direct to HTTP interface • Example: http://localhost:8500/v1/agent/check/pass/mytestcase • Full HTTP API: https://www.consul.io/docs/agent/http.html Small adapter program reads test results and outputs to Consul Agent (SDK or HTTP)
  • 24. Alerting Ideal to hear about outages as a push rather than a pull Determine what ‘failure’ means to you • Balance between false alarms and missing real alarms Many options! • Post alerts into VictorOps for paging • Send email from monitoring website • Send push notification through your cloud
  • 26. APPENDIX Technical Details and Sample Config October 5, 2015 PlayFab Confidential 26
  • 27. Partial Consul Configuration { "datacenter": "prd-uswest1", "retry_join_wan": [ “west.cloudapp.net", “east.cloudapp.net" ], "server": true, "service": { "name": "pfmonitor", "checks": [ { "script": "C:WindowsSystem32WindowsPowerShellv1.0powershell .exe -file c:runtests.ps1", "interval": "120s" } ] } }
  • 28. Consul Commands Full HTTP API: https://www.consul.io/docs/agent/http.html Add a health check: $body = { "ID": “mypath", "Name": "Path Works", "Notes": "Checking uptime and latency", "HTTP": "http://my.service.com/path", "TTL": "45s" } • Invoke-WebRequest http://localhost:8500/v1/agent/check/register -Body $body List the health checks: • Invoke-WebRequest http://localhost:8500/v1/health/checks/myservice [ { "Node": "somenode", "CheckID": “mypath", "Name": “Path Works", "Status": "passing", }, ]
  • 29. Consul Commands Update a health check: • Can add ?note=foo to pass details like latency • Invoke-WebRequest http://localhost:8500/v1/agent/check/pass/mypath • Invoke-WebRequest http://localhost:8500/v1/agent/check/warn/mypath • Invoke-WebRequest http://localhost:8500/v1/agent/check/fail/mypath