rspec geo minimal jobs are running non-geo tests
Seen in at least a few jobs:
-
rspec-ee unit geo minimal
https://gitlab.com/gitlab-org/gitlab/-/jobs/917091718 -
rspec-ee system geo minimal
https://gitlab.com/gitlab-org/gitlab/-/jobs/916865368
Problem
When there is no geo tests detected in detect-tests
job, the rspec command flags --tag geo
will not result in any tests. In spec_helper, there is the following configuration:
config.run_all_when_everything_filtered = true
These 2 conditions coupled together will result in rspec
running all tests, as seen in the example below:
$ bundle exec rspec spec/lib/gitlab/ci/pipeline/expression/lexeme/and_spec.rb --tag foo
Run options: include {:focus=>true, :foo=>true}
All examples were filtered out; ignoring {:focus=>true, :foo=>true}
..........................
Finished in 0.02526 seconds (files took 3.76 seconds to load)
26 examples, 0 failures
With the configuration set to false, it does not run any tests when nothing matches the tag:
$ bundle exec rspec spec/lib/gitlab/ci/pipeline/expression/lexeme/and_spec.rb --tag foo
Run options: include {:focus=>true, :foo=>true}
All examples were filtered out
Finished in 0.00024 seconds (files took 3.73 seconds to load)
0 examples, 0 failures
Potential fix
Disable run_all_when_everything_filtered
when running rspec in CI.
Edited by Albert