ci-queue 0.13.6 → 0.14.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
- SHA256:
3
- metadata.gz: 51999072c7493dd67d4e45e86bfa5b80aac05d84927cd759e5cd0cbb01ad943d
4
- data.tar.gz: b7183cbdb6f0364d079b92b6186f7987d9ffe6e4cf0aba46ebfdeaa146d6e181
2
+ SHA1:
3
+ metadata.gz: 69f2c43d6407cb468d6f0288aa8b32c1a41435b2
4
+ data.tar.gz: '018ef68ddc3ddb821053174180c2380aefcb24f8'
5
5
  SHA512:
6
- metadata.gz: b5339fc47648c6d7f38325ea8c5474c535df2fff3c3d3c15083698b28146d60de616e83baa0bbf82ea11a4c8d76ffb776a626c6d3358db242e05fb802216ac83
7
- data.tar.gz: 277b48daa9d63af660117f953da9a6ccd839ff3be6162c77cf867bc9af74fa083d67d310fa69f23592e027c7374ed061c4155889539ab946e4eef24b17e140b2
6
+ metadata.gz: 5cff6680090e17d0d342a44b73239b2a0075fbbecab53aa534b5e18722ca363e79398ab5685ba5e103b5e672f7b3a1150d0029275669407ede79c9b0df0f2ba0
7
+ data.tar.gz: f14aba376b3d2484f80273e7020b650cad4c8dff046a139eafac1273160646e1676d083f3252938e12882d3cbddac64cc33542d6fd81f37affc4c82646a8e4a3
@@ -16,6 +16,10 @@ module CI
16
16
  @queue.exhausted?
17
17
  end
18
18
 
19
+ def failed_tests
20
+ redis.hkeys(key('error-reports'))
21
+ end
22
+
19
23
  def record_error(id, payload, stats: nil)
20
24
  redis.pipelined do
21
25
  redis.hset(
@@ -55,7 +55,11 @@ module CI
55
55
  end
56
56
 
57
57
  def retry_queue
58
- log = redis.lrange(key('worker', worker_id, 'queue'), 0, -1).reverse.uniq
58
+ failures = build.failed_tests.to_set
59
+ log = redis.lrange(key('worker', worker_id, 'queue'), 0, -1)
60
+ log.select! { |id| failures.include?(id) }
61
+ log.uniq!
62
+ log.reverse!
59
63
  Retry.new(log, config, redis: redis)
60
64
  end
61
65
 
@@ -1,6 +1,6 @@
1
1
  module CI
2
2
  module Queue
3
- VERSION = '0.13.6'
3
+ VERSION = '0.14.0'
4
4
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
5
5
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
6
6
  end
@@ -37,7 +37,10 @@ module Minitest
37
37
  end
38
38
 
39
39
  def retry_command
40
- self.queue = queue.retry_queue
40
+ retry_queue = queue.retry_queue
41
+ unless retry_queue.exhausted?
42
+ self.queue = retry_queue
43
+ end
41
44
  run_command
42
45
  end
43
46
 
@@ -58,7 +61,9 @@ module Minitest
58
61
  trap('TERM') { Minitest.queue.shutdown! }
59
62
  trap('INT') { Minitest.queue.shutdown! }
60
63
 
61
- unless queue.rescue_connection_errors { queue.exhausted? }
64
+ if queue.rescue_connection_errors { queue.exhausted? }
65
+ puts green("All tests were ran already")
66
+ else
62
67
  load_tests
63
68
  populate_queue
64
69
  end
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.13.6
4
+ version: 0.14.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: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2018-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.7.6
229
+ rubygems_version: 2.6.14
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Distribute tests over many workers using a queue