Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 6a9009e

Browse files
committed
In RSpec::Core::Bisect::ExampleMinimizer#abort_if_ordering_inconsistent, minimizer checks the execution order of the devided ids are the same as the original order. So we need to sort them as the original order before run.
For example, When we have 4 examples: 1.rb, 2.rb, 3.rb, 4.rb and 3.rb is failure order-dependent with 2.rb. We expect to minimizer reproduce command `rspec 2.rb[1] 3.rb[1]`, but minimizer raises 'The example ordering is inconsistent.' This is because the ids to run are in the order 4.rb 2.rb (diffrent from the original), so fixed to sort them in the same order as the original error.
1 parent 6d86835 commit 6a9009e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rspec/core/bisect/example_minimizer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def non_failing_example_ids
136136
end
137137

138138
def get_expected_failures_for?(ids)
139-
ids_to_run = ids + failed_example_ids
139+
ids_to_run = all_example_ids & (ids + failed_example_ids)
140140
notify(
141141
:bisect_individual_run_start,
142142
:command => shell_command.repro_command_from(ids_to_run),

spec/support/fake_bisect_runner.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def run(ids)
1616
failures << failing_example if dependency_satisfied?(depends_upon, ids)
1717
end
1818

19-
RSpec::Core::Bisect::ExampleSetDescriptor.new(ids.sort, failures.sort)
19+
RSpec::Core::Bisect::ExampleSetDescriptor.new(ids, failures.sort)
2020
end
2121

2222
private

0 commit comments

Comments
 (0)