Skip to content

Commit c70a177

Browse files
authored
Merge pull request #209 from Shopify/borysbabusenko/fix-leakbot-instructions
Fix leakbot command instruction for Spin.
2 parents 10d895f + 075533e commit c70a177

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

ruby/lib/ci/queue/common.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ module Common
77
# to override in classes including this module
88
CONNECTION_ERRORS = [].freeze
99

10+
def distributed?
11+
raise NotImplementedError
12+
end
13+
1014
def retrying?
1115
false
1216
end

ruby/lib/ci/queue/redis/worker.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def initialize(redis, config)
2121
super(redis, config)
2222
end
2323

24+
def distributed?
25+
true
26+
end
27+
2428
def populate(tests, random: Random.new)
2529
@index = tests.map { |t| [t.id, t] }.to_h
2630
tests = Queue.shuffle(tests, random)

ruby/lib/ci/queue/static.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ def initialize(tests, config)
2222
@total = tests.size
2323
end
2424

25+
def distributed?
26+
false
27+
end
28+
2529
def build
2630
@build ||= BuildRecord.new(self)
2731
end

ruby/lib/minitest/queue/runner.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ def report_grind_command
253253
attr_accessor :queue, :queue_url, :grind_list, :grind_count, :load_paths
254254

255255
def require_worker_id!
256-
invalid_usage!("build-id couldn't be inferred from ENV and wasn't set via --build") unless queue_config.build_id
257-
invalid_usage!("worker-id couldn't be inferred from ENV and wasn't set via --worker") unless queue_config.worker_id
256+
if queue.distributed?
257+
invalid_usage!("build-id couldn't be inferred from ENV and wasn't set via --build") unless queue_config.build_id
258+
invalid_usage!("worker-id couldn't be inferred from ENV and wasn't set via --worker") unless queue_config.worker_id
259+
end
258260
end
259261

260262
def display_warnings(build)

0 commit comments

Comments
 (0)