Commit 69985326 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'caalberts-fix-parallel-rspec-runner' into 'master'

Fix parallel_rspec_runner not to run all tests

See merge request gitlab-org/gitlab!48733
parents 73a0449c 0ba51628
...@@ -43,6 +43,16 @@ RSpec.describe Tooling::ParallelRSpecRunner do # rubocop:disable RSpec/FilePath ...@@ -43,6 +43,16 @@ RSpec.describe Tooling::ParallelRSpecRunner do # rubocop:disable RSpec/FilePath
subject.run subject.run
end end
context 'when there is no intersect between allocated tests and filtered tests' do
let(:filter_tests) { '99_spec.rb' }
it 'does not run rspec' do
expect(subject).not_to receive(:exec)
subject.run
end
end
end end
context 'with empty filter tests file' do context 'with empty filter tests file' do
......
...@@ -38,6 +38,11 @@ module Tooling ...@@ -38,6 +38,11 @@ module Tooling
Knapsack.logger.info tests_to_run Knapsack.logger.info tests_to_run
Knapsack.logger.info Knapsack.logger.info
if tests_to_run.empty?
Knapsack.logger.info 'No tests to run on this node, exiting.'
return
end
exec(*rspec_command) exec(*rspec_command)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment