ci-queue 0.14.1 → 0.15.0.beta1

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
- SHA1:
3
- metadata.gz: e9c5f96cd424f499c6a46f3ffbfa21023547b4cc
4
- data.tar.gz: 39d18875123ae38c81c8788a7776aa99faf4c532
2
+ SHA256:
3
+ metadata.gz: 6ec83e0947a4bb046b27a52b6b701909b79e4ee3143d65f92a4ecf7f2bc96560
4
+ data.tar.gz: c974a1aacd13149f737120a4dc25777a9fd1bd916bde9cf6bd58038ef7f72e70
5
5
  SHA512:
6
- metadata.gz: 489781b113ce8f0834516253a49e4135c75a976ebc42d1320a1cca5145c85ff15ab2fd6c4b35456d6d8abf53d8e43ec0d106570a85ce029ebfc750892f990a4d
7
- data.tar.gz: 7e32d21f7bb3ee434a8e86f7ecd4d866bd6c9b42ddfe3f3a241c6030df2ca5f544b2ccfb7d781bf1c35986b7611cedbdf780152b6b8bcd80c9ce7143c82a6105
6
+ metadata.gz: 9341e3a10a483c6837008c9532e7be39ae2238e8a182165271dada1a308ff9aca41e28245ef34fe29391abf1eaab66583ecd9613429dee61d924efea0bf534ee
7
+ data.tar.gz: 920fdc913153b762e8ed9a64ecf851ba17a132048a123064eda0475f38575434f1aa642c5a26e2501916c80007c73126e0addc514fc5bd3bb4d55d8fed7d6857
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency 'ansi'
30
30
 
31
- spec.add_development_dependency 'bundler', '~> 1.13'
31
+ spec.add_development_dependency 'bundler'
32
32
  spec.add_development_dependency 'rake', "~> 10.0"
33
33
  spec.add_development_dependency 'minitest', ENV.fetch('MINITEST_VERSION', '~> 5.11')
34
34
  spec.add_development_dependency 'rspec', '~> 3.7.0'
@@ -6,6 +6,10 @@ module CI
6
6
  # to override in classes including this module
7
7
  CONNECTION_ERRORS = [].freeze
8
8
 
9
+ def retrying?
10
+ false
11
+ end
12
+
9
13
  def flaky?(test)
10
14
  @config.flaky?(test)
11
15
  end
@@ -54,6 +54,12 @@ module CI
54
54
  rescue *CONNECTION_ERRORS
55
55
  end
56
56
 
57
+ def retrying?
58
+ redis.exists(key('worker', worker_id, 'queue'))
59
+ rescue *CONNECTION_ERRORS
60
+ false
61
+ end
62
+
57
63
  def retry_queue
58
64
  failures = build.failed_tests.to_set
59
65
  log = redis.lrange(key('worker', worker_id, 'queue'), 0, -1)
@@ -1,6 +1,6 @@
1
1
  module CI
2
2
  module Queue
3
- VERSION = '0.14.1'
3
+ VERSION = '0.15.0.beta1'
4
4
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
5
5
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
6
6
  end
@@ -14,6 +14,7 @@ class Minitest::Queue::OrderReporter < Minitest::Reporters::BaseReporter
14
14
  def before_test(test)
15
15
  super
16
16
  @file.puts("#{test.class.name}##{test.name}")
17
+ @file.flush
17
18
  end
18
19
 
19
20
  def report
@@ -37,15 +37,22 @@ module Minitest
37
37
  end
38
38
 
39
39
  def retry_command
40
- reset_counters
41
- retry_queue = queue.retry_queue
42
- unless retry_queue.exhausted?
43
- self.queue = retry_queue
44
- end
45
- run_command
40
+ STDERR.puts "Warning: the retry subcommand is deprecated."
41
+ run_command # aliased for backward compatibility purpose
46
42
  end
47
43
 
48
44
  def run_command
45
+ if queue.retrying?
46
+ reset_counters
47
+ retry_queue = queue.retry_queue
48
+ if retry_queue.exhausted?
49
+ puts "The retry queue does not contain any failure, we'll process the main queue instead."
50
+ else
51
+ puts "Retrying failed tests."
52
+ self.queue = retry_queue
53
+ end
54
+ end
55
+
49
56
  set_load_path
50
57
  Minitest.queue = queue
51
58
  reporters = [
@@ -18,10 +18,6 @@ module RSpec
18
18
  configuration.queue_url || ENV['CI_QUEUE_URL']
19
19
  end
20
20
 
21
- def retrying
22
- configuration.retrying
23
- end
24
-
25
21
  def invalid_usage!(message)
26
22
  reopen_previous_step
27
23
  puts red(message)
@@ -52,11 +48,10 @@ module RSpec
52
48
  end
53
49
 
54
50
  Core::Configuration.add_setting(:queue_url)
55
- Core::Configuration.add_setting(:retrying)
56
51
  Core::Configuration.prepend(ConfigurationExtension)
57
52
 
58
53
  module ConfigurationOptionsExtension
59
- attr_accessor :queue_url, :retrying
54
+ attr_accessor :queue_url
60
55
  end
61
56
  Core::ConfigurationOptions.prepend(ConfigurationOptionsExtension)
62
57
 
@@ -90,7 +85,7 @@ module RSpec
90
85
  Replays a previous run in the same order.
91
86
  EOS
92
87
  parser.on('--retry', *help) do |url|
93
- options[:retrying] = true
88
+ STDERR.puts "Warning: The --retry flag is deprecated"
94
89
  end
95
90
 
96
91
  help = split_heredoc(<<-EOS)
@@ -375,7 +370,18 @@ module RSpec
375
370
  end
376
371
 
377
372
  queue = CI::Queue.from_uri(queue_url, RSpec::Queue.config)
378
- queue = queue.retry_queue if retrying
373
+
374
+ if queue.retrying?
375
+ retry_queue = queue.retry_queue
376
+ if retry_queue.exhausted?
377
+ puts "Found 0 tests to retry, processing the main queue."
378
+ else
379
+ puts "Retrying #{retry_queue.size} failed tests."
380
+ reset_counters
381
+ queue = retry_queue
382
+ end
383
+ end
384
+
379
385
  BuildStatusRecorder.build = queue.build
380
386
  queue.populate(examples, random: ordering_seed, &:id)
381
387
  examples_count = examples.size # TODO: figure out which stub value would be best
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.14.1
4
+ version: 0.15.0.beta1
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-09-26 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.13'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.13'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -221,12 +221,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  requirements:
224
- - - ">="
224
+ - - ">"
225
225
  - !ruby/object:Gem::Version
226
- version: '0'
226
+ version: 1.3.1
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.6.14
229
+ rubygems_version: 2.7.6
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Distribute tests over many workers using a queue