Skip to content

Commit

Permalink
Incrementally run test order in leakbot
Browse files Browse the repository at this point in the history
  • Loading branch information
zarifmahfuz committed Apr 16, 2024
1 parent 8307ec2 commit 9e7eea4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ruby/lib/ci/queue/bisect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Bisect
def initialize(path, config)
@tests = ::File.readlines(path).map(&:strip).reject(&:empty?).take_while { |t| t != config.failing_test }
@config = config
@iterator = 0
end

def size
Expand All @@ -20,27 +21,29 @@ def to_a
end

def suspects_left
@tests.size
@tests.size - @iterator
end

def failing_test
Static.new([config.failing_test], config).populate(@all_tests)
end

def candidates
Static.new(first_half + [config.failing_test], config).populate(@all_tests)
# Static.new(first_half + [config.failing_test], config).populate(@all_tests)
@iterator += 1
Static.new(@tests.first(@iterator) + [config.failing_test], config).populate(@all_tests)
end

def release!
# noop
end

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

def succeeded!
@tests = second_half
# @tests = second_half
end

private
Expand Down

0 comments on commit 9e7eea4

Please sign in to comment.