Evergreen Build Dima Kovalenko
About me Likes cheese @dimacus www.agilesoftwaretesting.com
Where I worked
Where I work www.groupon.ru
Why am I here
Why am I here
Why am I here
Why am I here Green build Auto merge Auto revert
Why have automated tests? Expensive
Expensive
Why have automated tests? Expensive A lot of work
Why have automated tests? Expensive A lot of work Always breaking
Always breaking
Why have automated tests? Expensive A lot of work Always breaking Cannot make money from them
Advantages of green build A healthy way of life
 
Advantages of green build A healthy way of life Confidence in the code base
Advantages of green build A healthy way of life Confidence in the code base Release new features faster
Advantages of green build EASY TO SEE WHEN THINGS GO WRONG!!
 
Quick Overview Test Driven Development (TDD) Continuos Integration (CI) Trunk Based Development (TBD) Continuos Deployment
Continuos Deployment http://bit.ly/OxJv
“YES!” 1 Developer on the team is not enough Manager says “we have to” is not enough Majority of the team needs to agree to improve
Let’s make the build green Speed Always running Accurate Readable Reject broken build
Speed 10 mins or less Parallel Tests Split Build Ramdisk Headless Browser
Parallel Tests Most modern computers can run more then 1 test at the time Many tools parallel_tests (github)
Simple Parallel test_groups = [ "group 1" ,  "group 2" ,  "group 3" ] Parallel .map(test_groups)  do  | parallel_build | run_test parallel_build end
Our Tests Cucumber: 300 Selenium: 170 Rspec: 14,110
Cucumber: 8 Parallel RSpec: 21 Parallel Selenium: 10 Parallel
Use more computers Run each group, on a different computer in parallel (Double parallel) Split into smaller groups if computers are slow
 
Jenkins Conductor
 
Jenkins Conductor http://bit.ly/tF8E5c
Google’s Idea Run the tests that only apply to current module If test fail, they fail super fast Always run the whole suite right after http://bit.ly/jUBirG
 
 
RAMdisk Faster then Hard Disk Faster then SSD (Wikipedia)
 
Headless Browser Webrat Mechanize Firefox Capybara-Webkit
 
Capybara-Webkit http://bit.ly/o0tHp1 Biggest boost if only testing Javascript Database prevented us from using it
Reliability Flaky tests Test dependencies Test pollution
Flaky Test Worse then no test at all Make you lose confidence in build Most noticeable on Selenium Run multiple times in row to debug
Selenium Tips Use element IDs to click on Check element exists before clicking Wait for AJAX to load
Test the test for i in {1..20}; do run_test; done
Accurate Test fails when it should Test passes when it should Test actually tests something
Readable Cucumber Rspec Keep them clean
Reject broken build Groupon setup Master Release Any-Branch
Any-Branch Test Merge/Rebase
Test New Branch Has to start with test/..... Can choose to run only a single item
 
 
 
 
 
Merge/Rebase Starts with merge/... or rebase/... If tests fail, ignore If tests pass, merge into master
 
 
 
 
 
 
 
Questions?

Evergreen build