ci-queue 0.20.3 → 0.20.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/ci-queue.gemspec +1 -1
- data/lib/ci/queue/configuration.rb +8 -1
- data/lib/ci/queue/redis/supervisor.rb +2 -2
- data/lib/ci/queue/redis/worker.rb +12 -4
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/error_report.rb +4 -0
- data/lib/minitest/queue/failure_formatter.rb +1 -0
- data/lib/minitest/queue/junit_reporter.rb +4 -0
- data/lib/minitest/queue/runner.rb +10 -1
- data/lib/minitest/queue/test_data.rb +5 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd585604a08da7bee0d9d3c019eea70d0a1aa0d934602c3530e41e9c4b879571
|
4
|
+
data.tar.gz: c5ba76f4cfe81750ab92fb8c68e8ad67cee9501774674b62603eacab9cbd8b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1906a348bf0c73fa66a6d9fda1fa891676659cdc71de21f7279d436cd7562c58e5c02caa60a4259e6e6c3c6d3564bb945bfcb7b27275baaaa6864405654f7538
|
7
|
+
data.tar.gz: e63d5ca5acfc44c402434925519b464f00c95ea45a29cf5379013cade928985d2a976f4e34c35da2835cf8bb254bc28eb37f5f4b11e072bbf85f80dd134fec9b
|
data/README.md
CHANGED
@@ -51,7 +51,9 @@ The runner also comes with a tool to investigate leaky tests:
|
|
51
51
|
minitest-queue --queue path/to/test_order.log --failing-test 'SomeTest#test_something' bisect -Itest test/**/*_test.rb
|
52
52
|
```
|
53
53
|
|
54
|
-
### RSpec
|
54
|
+
### RSpec [DEPRECATED]
|
55
|
+
|
56
|
+
The rspec-queue runner is deprecated. The minitest-queue runner continues to be supported and is actively being improved. At Shopify, we strongly recommend that new projects set up their test suite using Minitest rather than RSpec.
|
55
57
|
|
56
58
|
Assuming you use one of the supported CI providers, the command can be as simple as:
|
57
59
|
|
@@ -67,4 +69,4 @@ rspec-queue --queue redis://example.com --timeout 600 --report
|
|
67
69
|
|
68
70
|
#### Limitations
|
69
71
|
|
70
|
-
Because of how `ci-queue`
|
72
|
+
Because of how `ci-queue` executes the examples, `before(:all)` and `after(:all)` hooks are not supported. `rspec-queue` will explicitly reject them.
|
data/ci-queue.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency 'rake'
|
34
34
|
spec.add_development_dependency 'minitest', ENV.fetch('MINITEST_VERSION', '~> 5.11')
|
35
35
|
spec.add_development_dependency 'rspec', '~> 3.7.0'
|
36
|
-
spec.add_development_dependency 'redis'
|
36
|
+
spec.add_development_dependency 'redis'
|
37
37
|
spec.add_development_dependency 'simplecov', '~> 0.12'
|
38
38
|
spec.add_development_dependency 'minitest-reporters', '~> 1.1'
|
39
39
|
|
@@ -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.
|
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
|
-
|
20
|
+
wait_for_master(timeout: config.queue_init_timeout)
|
21
21
|
|
22
22
|
yield if block_given?
|
23
23
|
|
@@ -56,10 +56,18 @@ module CI
|
|
56
56
|
rescue *CONNECTION_ERRORS
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
if ::Redis.method_defined?(:exists?)
|
60
|
+
def retrying?
|
61
|
+
redis.exists?(key('worker', worker_id, 'queue'))
|
62
|
+
rescue *CONNECTION_ERRORS
|
63
|
+
false
|
64
|
+
end
|
65
|
+
else
|
66
|
+
def retrying?
|
67
|
+
redis.exists(key('worker', worker_id, 'queue'))
|
68
|
+
rescue *CONNECTION_ERRORS
|
69
|
+
false
|
70
|
+
end
|
63
71
|
end
|
64
72
|
|
65
73
|
def retry_queue
|
data/lib/ci/queue/version.rb
CHANGED
@@ -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
|
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
|
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.
|
4
|
+
version: 0.20.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: redis
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|