Running Unit Test on Serverless Infrastructure
Adinata Thayib @dieend
Running Unit Test on Serverless Infrastructure Adinata Thayib - - PowerPoint PPT Presentation
Running Unit Test on Serverless Infrastructure Adinata Thayib @dieend source: xkcd.com 85% less Running Unit Test on Serverless Infrastructure Adinata Thayib @dieend About Pocket Gems Mobile Game Company War Dragons & Episode
Running Unit Test on Serverless Infrastructure
Adinata Thayib @dieend
source: xkcd.com
85% less
Running Unit Test on Serverless Infrastructure
Adinata Thayib @dieend
About Pocket Gems
○ War Dragons & Episode
What is the problem?
Running full unit tests suite is slow Is it worth solving?
How to make test suite complete faster?
How to make test suite complete faster?
tests execution
How do we parallelize test execution?
Running locally with multiple CPUs
Nosetests Multiprocess plugin:
Running locally with multiple CPUs
Collect:
Running locally with multiple CPUs
Collect:
The plugin can't know (unless you tell it) if a context fixture can be called many times concurrently (is re-entrant),
default behavior is to dispatch the entire suite to a worker as a unit.
Running with Multiple Machine
No out of the box python solution. Ruby Alternative (Knapsack Pro - for Ruby and JS). Python WIP
Running with Multiple Machine
Running with Multiple Machine
Designing the solution
Constraint:
Opportunity:
Proposed Solution
Running with serverless infrastructure
Running with serverless infrastructure
Running with serverless infrastructure
nosetest plugin with custom selector
Running with serverless infrastructure
Running Test... thread.join() Parse output
What we learned
What we learned
1. AWS Lambda Source File Limits 2. Concurrent Executions 3. Network Bandwidth 4. Longest running unit tests is the weakest link 5. Binary Dependencies 6. No re-entrant fixture support
After 2 years...
faster
executions/month
engineering hours are saved each month
Assuming engineering hour cost $50/month (Bay Area):
Minute saved each execution 21 mins Monthly Execution 1000 execution Hours 350 hr Monthly Saved Engineering Cost ~$17,500
Monthly Impact
monthly cost
Saving per months
Assuming engineering hour cost $50/month (Bay Area): Initial Investment: 4 engineering weeks
Monthly Saved Engineering Cost ~$17,500 Monthly Cost ~$(120) Total ~$17,380 Engineering Cost to Build ~$8,000 Break Even Point < 1 month
engineers adopted it
Others might have the same frustration with you. You might solve everyone's problem.
Channel Discussion: #talk-unit-test-serverless Send me a tweet: @dieend
Thank you
Channel Discussion: #talk-unit-test-serverless Send me a tweet: @dieend