ci-queue 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ci/queue/configuration.rb +3 -2
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/runner.rb +27 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27cf10eb673c561ed2dac70e1c0d91ac026aafd331902f5e71fb278dcac953d6
|
4
|
+
data.tar.gz: 75df09bcd1018694fd49c05432a08d2904032baedce5bd24a9a07b6d46be6a28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd15e57e3c5298ecfce7dc8fa881b98e2c7406ba7f43832f6746035e9fe850ff015ee5494bef13515195a4fc778ef7181fd670c0bd1ff037b6b755d26e5ac43
|
7
|
+
data.tar.gz: 642c70bc89150e8f48826b3167598f5da0cfc3eff18124331a6abbaaea9b0a6fe6295d5d131ce31afb06fbca8812a5f5fd40f406f01b61d87991a9bf862f1369
|
@@ -4,7 +4,7 @@ module CI
|
|
4
4
|
class Configuration
|
5
5
|
attr_accessor :timeout, :build_id, :worker_id, :max_requeues, :grind_count, :failure_file
|
6
6
|
attr_accessor :requeue_tolerance, :namespace, :seed, :failing_test, :statsd_endpoint
|
7
|
-
attr_accessor :max_test_duration, :max_test_duration_percentile
|
7
|
+
attr_accessor :max_test_duration, :max_test_duration_percentile, :track_test_duration
|
8
8
|
attr_reader :circuit_breakers
|
9
9
|
|
10
10
|
class << self
|
@@ -30,7 +30,7 @@ module CI
|
|
30
30
|
timeout: 30, build_id: nil, worker_id: nil, max_requeues: 0, requeue_tolerance: 0,
|
31
31
|
namespace: nil, seed: nil, flaky_tests: [], statsd_endpoint: nil, max_consecutive_failures: nil,
|
32
32
|
grind_count: nil, max_duration: nil, failure_file: nil, max_test_duration: nil,
|
33
|
-
max_test_duration_percentile: 0.5
|
33
|
+
max_test_duration_percentile: 0.5, track_test_duration: false
|
34
34
|
)
|
35
35
|
@circuit_breakers = [CircuitBreaker::Disabled]
|
36
36
|
@build_id = build_id
|
@@ -46,6 +46,7 @@ module CI
|
|
46
46
|
@worker_id = worker_id
|
47
47
|
@max_test_duration = max_test_duration
|
48
48
|
@max_test_duration_percentile = max_test_duration_percentile
|
49
|
+
@track_test_duration = track_test_duration
|
49
50
|
self.max_duration = max_duration
|
50
51
|
self.max_consecutive_failures = max_consecutive_failures
|
51
52
|
end
|
data/lib/ci/queue/version.rb
CHANGED
@@ -91,14 +91,18 @@ module Minitest
|
|
91
91
|
queue_config.grind_count = grind_count
|
92
92
|
|
93
93
|
reporter_queue = CI::Queue::Redis::Grind.new(queue_url, queue_config)
|
94
|
-
test_time_record = CI::Queue::Redis::TestTimeRecord.new(queue_url, queue_config)
|
95
94
|
|
96
95
|
Minitest.queue = queue
|
97
96
|
reporters = [
|
98
97
|
GrindRecorder.new(build: reporter_queue.build),
|
99
98
|
TestDataReporter.new(namespace: queue_config&.namespace),
|
100
|
-
TestTimeRecorder.new(build: test_time_record)
|
101
99
|
]
|
100
|
+
|
101
|
+
if queue_config.track_test_duration
|
102
|
+
test_time_record = CI::Queue::Redis::TestTimeRecord.new(queue_url, queue_config)
|
103
|
+
reporters << TestTimeRecorder.new(build: test_time_record)
|
104
|
+
end
|
105
|
+
|
102
106
|
if queue_config.statsd_endpoint
|
103
107
|
reporters << Minitest::Reporters::StatsdReporter.new(statsd_endpoint: queue_config.statsd_endpoint)
|
104
108
|
end
|
@@ -205,15 +209,21 @@ module Minitest
|
|
205
209
|
grind_reporter = GrindReporter.new(build: supervisor.build)
|
206
210
|
grind_reporter.report
|
207
211
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
212
|
+
test_time_reporter_success = if queue_config.track_test_duration
|
213
|
+
test_time_record = CI::Queue::Redis::TestTimeRecord.new(queue_url, queue_config)
|
214
|
+
test_time_reporter = Minitest::Queue::TestTimeReporter.new(
|
215
|
+
build: test_time_record,
|
216
|
+
limit: queue_config.max_test_duration,
|
217
|
+
percentile: queue_config.max_test_duration_percentile,
|
218
|
+
)
|
219
|
+
test_time_reporter.report
|
220
|
+
|
221
|
+
test_time_reporter.success?
|
222
|
+
else
|
223
|
+
true
|
224
|
+
end
|
215
225
|
|
216
|
-
exit! grind_reporter.success? &&
|
226
|
+
exit! grind_reporter.success? && test_time_reporter_success ? 0 : 1
|
217
227
|
end
|
218
228
|
|
219
229
|
private
|
@@ -416,6 +426,13 @@ module Minitest
|
|
416
426
|
queue_config.max_consecutive_failures = max
|
417
427
|
end
|
418
428
|
|
429
|
+
help = <<~EOS
|
430
|
+
Must set this option in report and report_grind command if you set --max-test-duration in the report_grind
|
431
|
+
EOS
|
432
|
+
opts.on('--track-test-duration', help) do
|
433
|
+
queue_config.track_test_duration = true
|
434
|
+
end
|
435
|
+
|
419
436
|
help = <<~EOS
|
420
437
|
Set the time limit of the execution time from grinds on a given test.
|
421
438
|
For example, when max-test-duration is set to 10 and
|
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.17.
|
4
|
+
version: 0.17.1
|
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-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi
|