Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KEEPING DEVELOPERS HAPPY WITH A FAST CI

Christian Bruckmayer
November 08, 2021
220

KEEPING DEVELOPERS HAPPY WITH A FAST CI

When talking about performance, most developers think application speed, faster algorithms or better data structures. But what about your test suite? CI time is developer waiting time!

At Shopify we have more than 170,000 Ruby tests and we add 30,000 more annually. The sheer amount of tests and their growth requires some aggressive methods. We will illustrate some of our techniques including monitoring, test selection, timeouts and the 80/20 rule. If you have experience in writing tests and want to learn tricks on how to speed up your test suite, this talk is for you!

Christian Bruckmayer

November 08, 2021
Tweet

Transcript

  1. Ensure that our 
 CI Systems are 
 Scalable, Robust,

    and Usable with an emphasis on our Monolith
  2. ~2.8M Lines Of Code 
 > 1500 Engineers ~210k Ruby

    Tests 
 ~40 Hours to Execute Sequentially 
 >1000 Builds per Day 
 ~100Mil Test Runs per Day
  3. Data driven means progress in an activity is compelled by

    data, rather than by intuition or by personal experience.
  4. 1. Map App Files to Test Files 
 
 2.

    Use Map to Run Tests Related to PR Changes
  5. 1.

  6. 2.

  7. 3.

  8. 3.

  9. 3.

  10. redirect_to.action_controller halted_callback.action_controller unpermitted_parameters.action_controller process_middleware.action_dispatch render_template.action_view render_partial.action_view render_collection.action_view sql.active_record instantiation.active_record …

    write_fragment.action_controller read_fragment.action_controller expire_fragment.action_controller exist_fragment?.action_controller write_page.action_controller expire_page.action_controller start_processing.action_controller process_action.action_controller send_ fi le.action_controller send_data.action_controller 51 Hooks
  11. 40%

  12. Time To First Failure Duration Churn Complexity Coverage Random Failure

    Rate 12 min 10 min 8 min 6 min 3 min Outliers
  13. Tests Executed Faults Detected 10% 10% 100% 100% Random Failure

    Rate Median C.R. Fang, Z.Y. Chen, B.W. Xu, Comparing logic coverage criteria on test case prioritization, Sci. China Inf. Sci., 55 (2012), pp. 2826-2840
  14. Tests Executed Faults Detected 10% 10% 100% 100% Random Failure

    Rate p95 C.R. Fang, Z.Y. Chen, B.W. Xu, Comparing logic coverage criteria on test case prioritization, Sci. China Inf. Sci., 55 (2012), pp. 2826-2840