ci-queue 0.30.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38ef31e58e85eed042bdfd90ceb5b6bb02adc6a842ad6a553730325235433af2
4
- data.tar.gz: 629e6617553d6a59468b45eda582502960e335312be212edd39e931ebc883a93
3
+ metadata.gz: ffbfc433f36b0b8dcb19d9c2f17ab4227815dc1a7211b111d33a98fbc0ae6bf8
4
+ data.tar.gz: b84dc1389720a40520c74d57ae65d3161e5b00b91762d8ffc3a6cb4734d2d7dd
5
5
  SHA512:
6
- metadata.gz: d1a67bfd6f6e3943a11e0033c0f1d11f8d187fa082c6f9de3c0bcb97049a6093cde2ac49dfb39a66cd79b352f20227a35aa0a011223a61fd4bb213d225bf1fe4
7
- data.tar.gz: 833ba58c0c2b05780f5edc709eae9f2e1b78c72a8c49dbadb1ebc376d5cde0352d7fdc3f0e9b8e96dc27f8a53c01ec3ba8527b6435d50f085a0f8042abb88a86
6
+ metadata.gz: 3c7207ab7fa5995ea934212f5c5a2dac179b8bcdf67221040fc8e6e41e4653570b34e9aff18e4bbb647797ea4792e93d962c71d4a354ba57399a4114c6de7e61
7
+ data.tar.gz: '027848c07795e66c33fccb820465e9df3ff1fe2c75864192159e9e8902bbc679fcb21963a272b4f0d15ad0844b7524799ade11a02e3a8e45c276ec705f367a7c'
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in ci-queue.gemspec
4
4
  gemspec
5
5
 
6
- gem 'activesupport', '~> 5.2.0'
6
+ gem 'activesupport'
data/dev.yml CHANGED
@@ -5,7 +5,7 @@ name: ci-queue
5
5
  up:
6
6
  - ruby: 2.6.5
7
7
  - bundler
8
- - isogun
8
+ - redis
9
9
 
10
10
  commands:
11
11
  test: REDIS_URL=${REDIS_URL:-redis://ci-queue.railgun/0} bundle exec rake test TEST_FILES="$*"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.30.0'
5
+ VERSION = '0.32.0'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -4,7 +4,7 @@ require 'minitest/reporters'
4
4
 
5
5
  module Minitest
6
6
  module Queue
7
- class LocalRequeueReporter < Minitest::Reporters::BaseReporter
7
+ class LocalRequeueReporter < Minitest::Reporters::DefaultReporter
8
8
  include ::CI::Queue::OutputHelpers
9
9
  attr_accessor :requeues
10
10
 
@@ -68,7 +68,7 @@ module Minitest
68
68
  set_load_path
69
69
  Minitest.queue = queue
70
70
  reporters = [
71
- LocalRequeueReporter.new,
71
+ LocalRequeueReporter.new(verbose: verbose),
72
72
  BuildStatusRecorder.new(build: queue.build),
73
73
  JUnitReporter.new,
74
74
  TestDataReporter.new(namespace: queue_config&.namespace),
@@ -88,9 +88,36 @@ module Minitest
88
88
  load_tests
89
89
  populate_queue
90
90
  end
91
+
92
+ at_exit {
93
+ verify_reporters!(reporters)
94
+ }
91
95
  # Let minitest's at_exit hook trigger
92
96
  end
93
97
 
98
+ def verify_reporters!(reporters)
99
+ return unless reporters.any? { |r| !Minitest::Reporters.reporters.include?(r) }
100
+
101
+ warn <<~WARNING
102
+ WARNING!
103
+
104
+ ci-queue requires several custom minitest reporters.
105
+ Please do not overwrite them.
106
+ If you have a statement in your test suite like this
107
+
108
+ Minitest::Reporters.use!(SomeReporter.new)
109
+
110
+ you should only run it when other reporters have not been configured
111
+ to avoid breaking ci-queue's functionality and getting false test summaries.
112
+
113
+ Use something like this:
114
+
115
+ if Minitest::Reporters.reporters.nil?
116
+ Minitest::Reporters.use!(SomeReporter.new)
117
+ end
118
+ WARNING
119
+ end
120
+
94
121
  def release_command
95
122
  require_worker_id!
96
123
  queue.release!
@@ -148,6 +175,7 @@ module Minitest
148
175
  unless run_tests_in_fork(queue.failing_test)
149
176
  puts reopen_previous_step
150
177
  puts red("The test fail when ran alone, no need to bisect.")
178
+ File.write('log/test_order.log', queue_config.failing_test)
151
179
  exit! 0
152
180
  end
153
181
 
@@ -167,6 +195,7 @@ module Minitest
167
195
  step("Final validation")
168
196
  status = if run_tests_in_fork(failing_order)
169
197
  step(yellow("The bisection was inconclusive, there might not be any leaky test here."))
198
+ File.write('log/test_order.log', "")
170
199
  exit! 1
171
200
  else
172
201
  step(green('The following command should reproduce the leak on your machine:'), collapsed: false)
@@ -257,7 +286,7 @@ module Minitest
257
286
  private
258
287
 
259
288
  attr_reader :queue_config, :options, :command, :argv
260
- attr_accessor :queue, :queue_url, :grind_list, :grind_count, :load_paths
289
+ attr_accessor :queue, :queue_url, :grind_list, :grind_count, :load_paths, :verbose
261
290
 
262
291
  def require_worker_id!
263
292
  if queue.distributed?
@@ -421,7 +450,7 @@ module Minitest
421
450
  EOS
422
451
  opts.separator ""
423
452
  opts.on('-IPATHS', help) do |paths|
424
- self.load_paths = paths
453
+ self.load_paths = [load_paths, paths].compact.join(':')
425
454
  end
426
455
 
427
456
  help = <<~EOS
@@ -547,6 +576,10 @@ module Minitest
547
576
  queue.config.redis_ttl = time
548
577
  end
549
578
 
579
+ opts.on("-v", "--verbose", "Verbose. Show progress processing files.") do
580
+ self.verbose = true
581
+ end
582
+
550
583
  opts.separator ""
551
584
  opts.separator " retry: Replays a previous run in the same order."
552
585
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
241
  requirements: []
242
- rubygems_version: 3.4.13
242
+ rubygems_version: 3.4.16
243
243
  signing_key:
244
244
  specification_version: 4
245
245
  summary: Distribute tests over many workers using a queue