ci-queue 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 612d0f2f3077fdd5b7e74b343649a162101c2961c8b4cda8329ca10fbd831e6b
4
- data.tar.gz: bdd01c95971bcbfab5999b3754f8d019be35a7202e5f766d5df19191462e5563
3
+ metadata.gz: 24f5d0ca5b0d0391a953c6f0014635eec1b6ea541e7ac46a944ac413952777e0
4
+ data.tar.gz: aeec01bc647d5fb960449d57362cc6961479f5c6da78177c915c35bd9706f861
5
5
  SHA512:
6
- metadata.gz: 69a03983e12372fe0ab0258ec08262b2672624d49d2d63a0c35d0a89b4c8c85b3fd89ece2ce3c71de112652cd327868ee0fa7633ae283facb3b0bf57035d5724
7
- data.tar.gz: 44ead0bb47b690b19652982496f8a48d698f5bb78ea4f88c01e56b7774d4c79f6b6015b50e91cb70e241fc00a13bf842a72828792c7f716644cacf12bfb8bb2d
6
+ metadata.gz: 896cb4ac3e81d1235581e11ce6a0693565c6089afc441546a94d7211eab24b538279dfd6eb5abe06d7e3187e1b54bfb0f5d4127baa06d49a12baf181b345a444
7
+ data.tar.gz: 0be6036f02910f31672c28e2d6c6eb4cdbd41f066ffb499eed8e10990b2a7a8e6d596ecf9c3da5c57c574fc0a76ac73b430d447781c2929f615a2aa669ecbe74
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci-queue (0.101.0)
4
+ ci-queue (0.102.0)
5
5
  logger
6
6
 
7
7
  GEM
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.101.0'
5
+ VERSION = '0.102.0'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -304,7 +304,11 @@ module Minitest
304
304
  step("Waiting for workers to complete")
305
305
 
306
306
  unless supervisor.wait_for_workers { display_warnings(supervisor.build) }
307
- unless supervisor.queue_initialized?
307
+ # A lazy-load leader only marks the queue as initialized once it has
308
+ # streamed every test, but workers start on the first batch, so the wait
309
+ # can end (e.g. on --max-test-failed) while it is still streaming.
310
+ # Check streaming? first: the status only moves from streaming to ready.
311
+ unless supervisor.streaming? || supervisor.queue_initialized?
308
312
  abort! "No leader was elected. This typically means no worker was able to start. Were there any errors during application boot?", 40
309
313
  end
310
314
 
@@ -314,7 +318,7 @@ module Minitest
314
318
  reporter.write_failure_file(queue_config.failure_file) if queue_config.failure_file
315
319
  reporter.write_flaky_tests_file(queue_config.export_flaky_tests_file) if queue_config.export_flaky_tests_file
316
320
 
317
- abort!("#{supervisor.size} tests weren't run.", exit_code)
321
+ abort!(unrun_tests_message(supervisor), exit_code)
318
322
  end
319
323
  end
320
324
 
@@ -447,6 +451,16 @@ module Minitest
447
451
  Minitest::Queue::WorkerProfileReporter.new(supervisor).print_summary
448
452
  end
449
453
 
454
+ def unrun_tests_message(supervisor)
455
+ # Read the status before the size: tests a streaming leader hasn't pushed
456
+ # yet aren't in the queue, so the size is only a lower bound.
457
+ if supervisor.streaming?
458
+ "At least #{supervisor.size} tests weren't run (the leader hadn't finished streaming tests to the queue)."
459
+ else
460
+ "#{supervisor.size} tests weren't run."
461
+ end
462
+ end
463
+
450
464
  def parser
451
465
  @parser ||= OptionParser.new do |opts|
452
466
  opts.banner = "Usage: minitest-queue [options] COMMAND [ARGS]"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.101.0
4
+ version: 0.102.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier