Reducing Build Time - Aman King

  • View
    423

  • Download
    1

Embed Size (px)

Text of Reducing Build Time - Aman King

  1. 1. Saturday, 26Saturday, 26thth March, 2011March, 2011
  2. 2. Reducing build time when patience is not a virtue Aman King Application Developer ThoughtWorks
  3. 3. Recognize these?
  4. 4. Rank these
  5. 5. Did you choose this? 1 32
  6. 6. Or did you choose this? 1 23
  7. 7. Patience is not always a virtue!
  8. 8. Fail fast! quick feedback
  9. 9. Rank these High functional coverage Short build time
  10. 10. Did you choose this? a.High functional coverage b.Short build time
  11. 11. Or did you choose this? a.Short build time b.High functional coverage
  12. 12. You can choose both! a.Short build time a.High functional coverage
  13. 13. But before we see how
  14. 14. Project background
  15. 15. Content driven, community oriented website
  16. 16. Ruby on Rails Cucumber + Capybara + Selenium
  17. 17. 4 : 1 ratio of Dev : QA Everyone writes functional tests in a common automation suite Acceptance Test Driven Development (ATDD)
  18. 18. Our problems
  19. 19. Long build time ~ 55 minutes
  20. 20. Non-deterministic failures
  21. 21. Manual reruns needed
  22. 22. Our solution: Parallelization
  23. 23. Basic idea
  24. 24. Reduced build time ~ 5 minutes
  25. 25. Build time chart
  26. 26. What we did
  27. 27. Parallelization on a single multicore machine used Ruby library parallel_tests
  28. 28. Report generation in parallel wrote custom report formatter
  29. 29. Isolating databases each process needs its own database
  30. 30. database.yml test: &test adapter: mysql2 encoding: utf8 reconnect: false database: myapp_test pool: 5 username: root password:
  31. 31. Isolating external dependencies (Solr) each process needs its own Solr instance
  32. 32. sunspot.yml test: solr: hostname: localhost port: log_level: INFO #WARNING log_file: data_path: