Skip to content

Commit

Permalink
Run the failing test after every test in the test order
Browse files Browse the repository at this point in the history
  • Loading branch information
zarifmahfuz committed Apr 17, 2024
1 parent 869166e commit 246e687
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ruby/lib/ci/queue/bisect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def initialize(path, config)
@tests = ::File.readlines(path).map(&:strip).reject(&:empty?).take_while { |t| t != config.failing_test }
@config = config
@iterator = 0
@leaky_index = nil
end

def size
Expand All @@ -21,6 +22,7 @@ def to_a
end

def suspects_left
return 0 if @leaky_index != nil and @leaky_index >= 0
@tests.size - @iterator
end

Expand All @@ -30,8 +32,11 @@ def failing_test

def candidates
# Static.new(first_half + [config.failing_test], config).populate(@all_tests)
if @leaky_index != nil and @leaky_index >= 0
return Static.new(@tests[@leaky_index] + [config.failing_test], config).populate(@all_tests)
end
@iterator += 1
Static.new(@tests.first(@iterator) + [config.failing_test], config).populate(@all_tests)
Static.new(@tests[@iterator] + [config.failing_test], config).populate(@all_tests)
end

def release!
Expand All @@ -40,7 +45,7 @@ def release!

def failed!
# @tests = first_half
@tests = @tests.first(@iterator)
@leaky_index = @iterator
end

def succeeded!
Expand Down

0 comments on commit 246e687

Please sign in to comment.