ci-queue 0.20.5 → 0.20.9

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: 8b3b09a46db2e51a46c56d7621c04519733ae879c654fb1f40b501ee83ccc18e
4
- data.tar.gz: ce5611bebdb7d779a4d4cc9ed5c647445b1f1e11f684739e50d723dc62c9b724
3
+ metadata.gz: ce180525dfe099a326292c007d5654789406e1a4af4ed74455ea036891fd5e3b
4
+ data.tar.gz: 570f697ebc2d320e3a556b0b7323d8a2cc9920e3263e07ebef8fa2fc3517500e
5
5
  SHA512:
6
- metadata.gz: 9ae21355372fd174e00228a23c52ac09dafd7660f0931178602e96ae1b0c38f50d7a931f16781190e8de90b5fcc26715b518c87ff94d75923e26b736eeca6b8a
7
- data.tar.gz: 302a5dc245808eda350733554e87b176e9e5b949a041c09adf3da3dfb119d1cac9e4af7301952aeebc96280c896bb6bb4f7abfc48cf83739cb970a1eaa8d4189
6
+ metadata.gz: abe9a5431c9e61435f8f93ede21eae622c000b27d2359d24171e3e0bc10562d6b9c87f10138ccbd3d12e149aec09601ba2007510e1e629b1564df43a05675ce2
7
+ data.tar.gz: d504aa4e467eba720a2aaa35bb448dbbf13d52502d6e16a491afcfbfa8413face59eefc5b260c5412889b3d7dc0e65c194569e676e6f656147a163e67f622394
@@ -8,6 +8,7 @@ module CI
8
8
  attr_accessor :max_test_failed
9
9
  attr_reader :circuit_breakers
10
10
  attr_writer :seed, :build_id
11
+ attr_writer :queue_init_timeout
11
12
 
12
13
  class << self
13
14
  def from_env(env)
@@ -32,7 +33,8 @@ module CI
32
33
  timeout: 30, build_id: nil, worker_id: nil, max_requeues: 0, requeue_tolerance: 0,
33
34
  namespace: nil, seed: nil, flaky_tests: [], statsd_endpoint: nil, max_consecutive_failures: nil,
34
35
  grind_count: nil, max_duration: nil, failure_file: nil, max_test_duration: nil,
35
- max_test_duration_percentile: 0.5, track_test_duration: false, max_test_failed: nil
36
+ max_test_duration_percentile: 0.5, track_test_duration: false, max_test_failed: nil,
37
+ queue_init_timeout: nil
36
38
  )
37
39
  @build_id = build_id
38
40
  @circuit_breakers = [CircuitBreaker::Disabled]
@@ -48,12 +50,17 @@ module CI
48
50
  @seed = seed
49
51
  @statsd_endpoint = statsd_endpoint
50
52
  @timeout = timeout
53
+ @queue_init_timeout = queue_init_timeout
51
54
  @track_test_duration = track_test_duration
52
55
  @worker_id = worker_id
53
56
  self.max_consecutive_failures = max_consecutive_failures
54
57
  self.max_duration = max_duration
55
58
  end
56
59
 
60
+ def queue_init_timeout
61
+ @queue_init_timeout || timeout
62
+ end
63
+
57
64
  def max_consecutive_failures=(max)
58
65
  if max
59
66
  @circuit_breakers << CircuitBreaker::MaxConsecutiveFailures.new(max_consecutive_failures: max)
@@ -8,7 +8,7 @@ module CI
8
8
  end
9
9
 
10
10
  def total
11
- wait_for_master(timeout: config.timeout)
11
+ wait_for_master(timeout: config.queue_init_timeout)
12
12
  redis.get(key('total')).to_i
13
13
  end
14
14
 
@@ -17,7 +17,7 @@ module CI
17
17
  end
18
18
 
19
19
  def wait_for_workers
20
- return false unless wait_for_master(timeout: config.timeout)
20
+ wait_for_master(timeout: config.queue_init_timeout)
21
21
 
22
22
  yield if block_given?
23
23
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.20.5'
5
+ VERSION = '0.20.9'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -7,6 +7,8 @@ require 'fileutils'
7
7
  module Minitest
8
8
  module Queue
9
9
  class JUnitReporter < Minitest::Reporters::BaseReporter
10
+ include ::CI::Queue::OutputHelpers
11
+
10
12
  def initialize(report_path = 'log/junit.xml', options = {})
11
13
  super({})
12
14
  @report_path = File.absolute_path(report_path)
@@ -76,6 +78,8 @@ module Minitest
76
78
 
77
79
  testcase = testsuite.add_element('testcase', attributes)
78
80
  add_xml_message_for(testcase, test) unless test.passed?
81
+ rescue REXML::ParseException, RuntimeError => error
82
+ step(red("Skipping adding '#{suite}##{test.name}' to JUnit report: #{error.message}"))
79
83
  end
80
84
  end
81
85
 
@@ -352,7 +352,7 @@ module Minitest
352
352
 
353
353
  help = <<~EOS
354
354
  Specify a timeout after which if a test haven't completed, it will be picked up by another worker.
355
- It is very important to set this vlaue higher than the slowest test in the suite, otherwise performance will be impacted.
355
+ It is very important to set this value higher than the slowest test in the suite, otherwise performance will be impacted.
356
356
  Defaults to 30 seconds.
357
357
  EOS
358
358
  opts.separator ""
@@ -360,6 +360,15 @@ module Minitest
360
360
  queue_config.timeout = timeout
361
361
  end
362
362
 
363
+ help = <<~EOS
364
+ Specify a timeout to elect the leader and populate the queue.
365
+ Defaults to the value set for --timeout.
366
+ EOS
367
+ opts.separator ""
368
+ opts.on('--queue-init-timeout TIMEOUT', Float, help) do |timeout|
369
+ queue_config.queue_init_timeout = timeout
370
+ end
371
+
363
372
  help = <<~EOS
364
373
  Specify $LOAD_PATH directory, similar to Ruby's -I
365
374
  EOS
@@ -54,7 +54,11 @@ module Minitest
54
54
 
55
55
  def test_file_path
56
56
  path = @test.source_location.first
57
- relative_path_for(path)
57
+ begin
58
+ relative_path_for(path)
59
+ rescue ArgumentError
60
+ path # e.g. "(eval)" etc.
61
+ end
58
62
  end
59
63
 
60
64
  def test_file_line_number
@@ -78,7 +82,11 @@ module Minitest
78
82
  return nil unless @test.failure
79
83
 
80
84
  path = error_location(@test.failure).first
81
- relative_path_for(path)
85
+ begin
86
+ relative_path_for(path)
87
+ rescue ArgumentError
88
+ path # e.g. "(eval)" etc.
89
+ end
82
90
  end
83
91
 
84
92
  def error_file_number
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.20.5
4
+ version: 0.20.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubygems_version: 3.0.3
241
+ rubygems_version: 3.2.20
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Distribute tests over many workers using a queue