Skip to content

Ignore :locations when targeting quarantine specs

Malcolm Locke requested to merge mallocke/qa-ignore-locations-on-quarantine into master

What does this MR do and why?

Ignore :locations when targeting quarantine specs

When rspec is run targetting a line number an implicit :locations filter is created containing the file(s) and line number(s) requested.

This breaks the handling we have in place for forcably running a quarantined test when it's specific line number is provided.

So if a quarantined spec is present on line 123 of foo_spec.rb

$ rspec --tag quarantine ./foo_spec.rb

will run the test, but

$ rspec --tag quarantine ./foo_spec.rb:123

will skip it.

This change ignores the :locations filter so the latter will run the spec.

How to set up and validate locally

On master run a quarantined spec including the line number of the spec, e.g.

$ bundle exec rspec --tag quarantine ./qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb:137

The spec will be skipped.

Checkout this branch and repeat, the spec should run.

Merge request reports