ci-queue 0.20.9 → 0.21.0
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/redis/worker.rb +1 -0
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/test_data.rb +10 -0
- data/lib/minitest/queue.rb +24 -1
- 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: a9a1d5f8211c29b9993d6ef94acff329a040d7e940b28e8d51eedc01e87c106b
|
4
|
+
data.tar.gz: d584ef67d1f2036b4c8b7880099515ff2a4f0618c2813e9caee099cfe11e587f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ddaa2717da8b9a989fa6d7bf859d509c29d2cf19ade4fcab882f6dfe4b33e1969c5f89121f3b5dfb1439b03e89e41227cf9f9f8e33d7e9295e43c7a2cb8e51
|
7
|
+
data.tar.gz: e7f5753cd1bdfd0f7500ebe00be9e7caf3a342ae931b974971bc95aa8ab27e86744211036a4fe70420a80d374235e1eb1ea6ce6eee4e14da52560502f1c26413
|
data/lib/ci/queue/version.rb
CHANGED
@@ -52,6 +52,14 @@ module Minitest
|
|
52
52
|
@test.time
|
53
53
|
end
|
54
54
|
|
55
|
+
def test_start_timestamp
|
56
|
+
@test.start_timestamp
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_finish_timestamp
|
60
|
+
@test.finish_timestamp
|
61
|
+
end
|
62
|
+
|
55
63
|
def test_file_path
|
56
64
|
path = @test.source_location.first
|
57
65
|
begin
|
@@ -107,6 +115,8 @@ module Minitest
|
|
107
115
|
test_retried: test_retried,
|
108
116
|
test_assertions: test_assertions,
|
109
117
|
test_duration: test_duration,
|
118
|
+
test_start_timestamp: test_start_timestamp,
|
119
|
+
test_finish_timestamp: test_finish_timestamp,
|
110
120
|
test_file_path: test_file_path,
|
111
121
|
test_file_line_number: test_file_line_number,
|
112
122
|
error_class: error_class,
|
data/lib/minitest/queue.rb
CHANGED
@@ -102,6 +102,10 @@ module Minitest
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
module WithTimestamps
|
106
|
+
attr_accessor :start_timestamp, :finish_timestamp
|
107
|
+
end
|
108
|
+
|
105
109
|
module Queue
|
106
110
|
attr_writer :run_command_formatter, :project_root
|
107
111
|
|
@@ -159,13 +163,30 @@ module Minitest
|
|
159
163
|
id <=> other.id
|
160
164
|
end
|
161
165
|
|
166
|
+
def with_timestamps
|
167
|
+
start_timestamp = current_timestamp
|
168
|
+
result = yield
|
169
|
+
result
|
170
|
+
ensure
|
171
|
+
result.start_timestamp = start_timestamp
|
172
|
+
result.finish_timestamp = current_timestamp
|
173
|
+
end
|
174
|
+
|
162
175
|
def run
|
163
|
-
|
176
|
+
with_timestamps do
|
177
|
+
Minitest.run_one_method(@runnable, @method_name)
|
178
|
+
end
|
164
179
|
end
|
165
180
|
|
166
181
|
def flaky?
|
167
182
|
Minitest.queue.flaky?(self)
|
168
183
|
end
|
184
|
+
|
185
|
+
private
|
186
|
+
|
187
|
+
def current_timestamp
|
188
|
+
Time.now.to_i
|
189
|
+
end
|
169
190
|
end
|
170
191
|
|
171
192
|
attr_reader :queue
|
@@ -244,9 +265,11 @@ MiniTest.singleton_class.prepend(MiniTest::Queue)
|
|
244
265
|
if defined? MiniTest::Result
|
245
266
|
MiniTest::Result.prepend(MiniTest::Requeueing)
|
246
267
|
MiniTest::Result.prepend(MiniTest::Flakiness)
|
268
|
+
MiniTest::Result.prepend(MiniTest::WithTimestamps)
|
247
269
|
else
|
248
270
|
MiniTest::Test.prepend(MiniTest::Requeueing)
|
249
271
|
MiniTest::Test.prepend(MiniTest::Flakiness)
|
272
|
+
MiniTest::Test.prepend(MiniTest::WithTimestamps)
|
250
273
|
|
251
274
|
module MinitestBackwardCompatibility
|
252
275
|
def source_location
|
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.
|
4
|
+
version: 0.21.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: 2021-09-
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|