You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, our specs run in the same order each time, which can result in unexpected failures when tests are run out of order. This prevents us from running our tests in parallel (#55), and generally slows down development when unexpected errors occur.
This behavior can be see by running rspec spec/ --order rand.
The default spec_helper.rb file includes information on configuring random ordering:
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
We should:
add those configuration options & notes to our spec_helper.rb to ensure specs are run in random order
fix any specs that are order-dependent
(Note: One reason I've found for some order-dependency is fixtures that are loaded in one test, and then used by subsequent tests that don't explicitly load those fixtures.)
The text was updated successfully, but these errors were encountered:
Currently, our specs run in the same order each time, which can result in unexpected failures when tests are run out of order. This prevents us from running our tests in parallel (#55), and generally slows down development when unexpected errors occur.
This behavior can be see by running
rspec spec/ --order rand
.The default
spec_helper.rb
file includes information on configuring random ordering:We should:
spec_helper.rb
to ensure specs are run in random order(Note: One reason I've found for some order-dependency is fixtures that are loaded in one test, and then used by subsequent tests that don't explicitly load those fixtures.)
The text was updated successfully, but these errors were encountered: