Skip to content

Allow fast specs to use RSpec's `--only-failures`

What does this MR do and why?

This MR move the configuration to persist example status config.example_status_persistence_file_path from spec/spec_helper to spec/support/rspec which is loaded by all spec helpers include fast_spec_helper.

Contributes to #372849.

How to set up and validate locally

Before 💥

bin/rspec --only-failure spec/rubocop/todo_dir_spec.rb
To use `--only-failures`, you must first set `config.example_status_persistence_file_path`.

After

bin/rspec --only-failure spec/rubocop/todo_dir_spec.rb
Run options: include {:focus=>true, :last_run_status=>"failed"}

All examples were filtered out

Randomized with seed 36515


Finished in 0.00028 seconds (files took 0.80302 seconds to load)
0 examples, 0 failures

Randomized with seed 36515

It still works with "slow specs":

bin/rspec --only-failures spec/models/project_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports