ci-queue 0.18.0 → 0.19.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
2
  SHA256:
3
- metadata.gz: c9c3ef16af71af28cb4ba0a1b1cc6333549b29c59be0b4a5d81d04820c2b9b09
4
- data.tar.gz: 3b7f66435ec75625bb68af73917bea553815ac76f526efb0bb954252fac35bc3
3
+ metadata.gz: 436b1f0bca2725e6f532cbd4a4df9a880e6b1dd2e11a80b9587178d213fe6137
4
+ data.tar.gz: 93fe3b4055e7c99e6c61af1f106e63157e79dd2fe3717d5b1cfc74e096195e9a
5
5
  SHA512:
6
- metadata.gz: 110d276a4d4a44cf98cba68be7e895991d510e14236fdad601fc9887ea13f6b1f67b3ec3df48b5210cac8b2185be2528cd39c1c9da67a0649660300594801878
7
- data.tar.gz: 103c204787a1f3b29e9ebb676f5847eac789acd806f5eaabbce84a5e2f47e6af27ea48d7a6f6d725c25dbf78061d38e5cb10feb62586a0b8d0ea1d32f5230af5
6
+ metadata.gz: 2bc328cd567173a875bc8273a812d2ad48ea32bad0eb0f7b0a586b279a80c4eaf08eede41a15e98d71929776dc1a5d59e7fee94b844b55a1924b3f1aa0be4272
7
+ data.tar.gz: fab60979f729dd77fbf8661d8e1b644deb7e9c126a5ea27a97537e0fb960416b71c69b2b01b4123e6f19216b6a764a136079412875686c93f949a6323ebf0a63
@@ -29,8 +29,6 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
31
31
 
32
- spec.add_dependency 'ansi'
33
-
34
32
  spec.add_development_dependency 'bundler'
35
33
  spec.add_development_dependency 'rake'
36
34
  spec.add_development_dependency 'minitest', ENV.fetch('MINITEST_VERSION', '~> 5.11')
@@ -18,12 +18,16 @@ module CI
18
18
  module Queue
19
19
  extend self
20
20
 
21
- attr_accessor :shuffler
21
+ attr_accessor :shuffler, :requeueable
22
22
 
23
23
  module Warnings
24
24
  RESERVED_LOST_TEST = :RESERVED_LOST_TEST
25
25
  end
26
26
 
27
+ def requeueable?(test_result)
28
+ requeueable.nil? || requeueable.call(test_result)
29
+ end
30
+
27
31
  def shuffle(tests, random)
28
32
  if shuffler
29
33
  shuffler.call(tests, random)
@@ -1,11 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'ansi'
3
-
4
2
  module CI
5
3
  module Queue
6
4
  module OutputHelpers
7
- include ANSI::Code
8
-
9
5
  private
10
6
 
11
7
  def step(*args, **kwargs)
@@ -28,6 +24,22 @@ module CI
28
24
  end
29
25
  end
30
26
 
27
+ def red(text)
28
+ colorize(text, 31)
29
+ end
30
+
31
+ def green(text)
32
+ colorize(text, 32)
33
+ end
34
+
35
+ def yellow(text)
36
+ colorize(text, 33)
37
+ end
38
+
39
+ def colorize(text, color_code)
40
+ "\e[#{color_code}m#{text}\e[0m"
41
+ end
42
+
31
43
  module DefaultOutput
32
44
  extend self
33
45
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.18.0'
5
+ VERSION = '0.19.0'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -180,7 +180,7 @@ module Minitest
180
180
  end
181
181
 
182
182
  requeued = false
183
- if failed && queue.requeue(example)
183
+ if failed && CI::Queue.requeueable?(result) && queue.requeue(example)
184
184
  requeued = true
185
185
  result.requeue!
186
186
  reporter.record(result)
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  require 'delegate'
3
- require 'ansi'
3
+ require 'ci/queue/output_helpers'
4
4
 
5
5
  module Minitest
6
6
  module Queue
7
7
  class FailureFormatter < SimpleDelegator
8
- include ANSI::Code
8
+ include ::CI::Queue::OutputHelpers
9
9
 
10
10
  def initialize(test)
11
11
  @test = test
@@ -211,7 +211,7 @@ module RSpec
211
211
  reporter.report_success!
212
212
  end
213
213
 
214
- if @exception && reporter.requeue
214
+ if @exception && CI::Queue.requeueable?(@exception) && reporter.requeue
215
215
  reporter.cancel_run!
216
216
  dup.mark_as_requeued!(reporter)
217
217
  return true
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.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: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: ansi
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement