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

tests and the database

tests and the database

making some tests faster by starting from test database dumps

8d96626e52beb1ff90f57a8e189e1e6f?s=128

John Mettraux

November 29, 2018
Tweet

Transcript

  1. None
  2. tests and
 the database

  3. hiro shima .rb #67 • Sinatra • Sequel • JRuby

  4. hiro shima .rb #67

  5. hiro shima .rb #67

  6. hiro shima .rb #67 took 20s.

  7. hiro shima .rb #67 took 20s.

  8. hiro shima .rb #67 bxs spec/functional/models/sg_mandate_spec.rb:210 bxs spec/functional/models/sg_mandate_spec.rb -e fubar

    bxs spec/functional/models/sg_mandate_spec.rb bxs spec/functional/models/ alias bxs=“bundle exec rspec” bxs
  9. hiro shima .rb #67 bxs spec/functional/models/sg_mandate_spec.rb:210 bxs spec/functional/models/sg_mandate_spec.rb -e fubar

    bxs spec/functional/models/sg_mandate_spec.rb bxs spec/functional/models/ alias bxs=“bundle exec rspec” bxs 30s to 2m 20m to 30m
  10. hiro shima .rb #67 bxs spec/functional/models/sg_mandate_spec.rb:210 bxs spec/functional/models/sg_mandate_spec.rb -e fubar

    bxs spec/functional/models/sg_mandate_spec.rb bxs spec/functional/models/ alias bxs=“bundle exec rspec” bxs focus control
  11. hiro shima .rb #67 bxs spec/functional/models/sg_mandate_spec.rb:210 bxs spec/functional/models/sg_mandate_spec.rb -e fubar

    bxs spec/functional/models/sg_mandate_spec.rb bxs spec/functional/models/ alias bxs=“bundle exec rspec” bxs focus control
  12. hiro shima .rb #67 bxs spec/functional/models/sg_mandate_spec.rb:210 bxs spec/functional/models/sg_mandate_spec.rb -e fubar

    bxs spec/functional/models/sg_mandate_spec.rb bxs spec/functional/models/ alias bxs=“bundle exec rspec” bxs focus control unit (no db access) functional (no browser) integration (selenium)
  13. hiro shima .rb #67

  14. hiro shima .rb #67

  15. hiro shima .rb #67 what if we had a dump

    of the test database, right after load_integration_fixtures()
 ?
  16. hiro shima .rb #67 what if we had a dump

    of the test database, right after load_integration_fixtures()
 ?
  17. hiro shima .rb #67 what if we had a dump

    of the test database, right after load_integration_fixtures()
 ?
  18. hiro shima .rb #67 what if we had a dump

    of the test database, right after load_integration_fixtures()
 ?
  19. hiro shima .rb #67 what if we had a dump

    of the test database, right after load_integration_fixtures()
 ? dump: 0.2s dump: 61M load: 1.8s
  20. hiro shima .rb #67

  21. hiro shima .rb #67

  22. hiro shima .rb #67

  23. hiro shima .rb #67

  24. hiro shima .rb #67 still
 20s cost remains

  25. hiro shima .rb #67 still
 20s cost remains

  26. hiro shima .rb #67 still
 20s cost remains

  27. hiro shima .rb #67 still
 20s cost remains

  28. hiro shima .rb #67 still
 20s cost remains

  29. hiro shima .rb #67

  30. hiro shima .rb #67

  31. hiro shima .rb #67 the end