Skip to content

Commit 8a2faff

Browse files
committed
Remove comment and fix BisectTest config construction
Configuration#initialize does not accept failing_test as a keyword; set it via the accessor instead, and use a Tempfile rather than a hardcoded /tmp path. Assisted-By: devx/a7dfa242-697c-48e5-8e5d-65c25452ceff
1 parent ee66645 commit 8a2faff

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎ruby/lib/ci/queue/bisect.rb‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ def succeeded!
4747
@tests = second_half
4848
end
4949

50-
# Public like every other queue's config (CI::Queue::Common), since consumers
51-
# configure the queue while tests load.
5250
attr_reader :config
5351

5452
private

‎ruby/test/ci/queue/bisect_test.rb‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# frozen_string_literal: true
22
require 'test_helper'
3+
require 'tempfile'
34

45
class CI::Queue::BisectTest < Minitest::Test
5-
TEST_LIST_PATH = '/tmp/bisect-queue-test.txt'.freeze
6-
76
def test_config_is_public
8-
config = CI::Queue::Configuration.new(failing_test: 'ATest#test_bar')
9-
File.write(TEST_LIST_PATH, "ATest#test_foo\nATest#test_bar\n")
7+
config = CI::Queue::Configuration.new
8+
config.failing_test = 'ATest#test_bar'
9+
10+
Tempfile.create('test_order') do |file|
11+
file.write("ATest#test_foo\nATest#test_bar\n")
12+
file.flush
1013

11-
assert_same(config, CI::Queue::Bisect.new(TEST_LIST_PATH, config).config)
14+
assert_same(config, CI::Queue::Bisect.new(file.path, config).config)
15+
end
1216
end
1317
end

0 commit comments

Comments
 (0)