ci-queue 0.20.1 → 0.20.6

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: c5d3525c5eac10718326a27026a9760509bca1a0d23b15f6ad2b8f5521321c29
4
- data.tar.gz: 05a459ded4b16d60c5dd5e58ed3e175b97467193894d6f64acbdb3d071e971a9
3
+ metadata.gz: fdf8ce628f8d7b21a66f614c867dbd2f568b011f22a467a6d274c51e81294a63
4
+ data.tar.gz: c591e50cf510e91d6aa6d6bbf39573b38581002c2dcf2e07f1b57e9edb2abef6
5
5
  SHA512:
6
- metadata.gz: e1589714a963162803a93e134b671026c90910d7a645057d58dafa785f97408f94562d43d4545c7123b63feb93a0966710b43acf63cc1d7aa727684db7a952e7
7
- data.tar.gz: da902c68164c997ebbda25d6305742059c101d08a23d084b3b0bedeb3e2f4bace623e1241c4298dff24b0061a846be201b9ae4edda4d3df3537ae40642bab276
6
+ metadata.gz: 9b5b2c9fe39aa132bda26cc98387349eaddcfb2074e37ed225f675a3e8fb3c50f42dab761f0620b54d1df48ae285b10d75f1b66f07456e05d4bccbfb01116414
7
+ data.tar.gz: f92b07076fc21b13efe3a9587f4e57cf7d1d12b1838c37d10fcbeb8b2e4e684a101fd5d9588fa482e06cf45c0e12f1bce212b5d7e9bcf695e4ba8f5fcfdd7864
data/README.md CHANGED
@@ -51,7 +51,9 @@ The runner also comes with a tool to investigate leaky tests:
51
51
  minitest-queue --queue path/to/test_order.log --failing-test 'SomeTest#test_something' bisect -Itest test/**/*_test.rb
52
52
  ```
53
53
 
54
- ### RSpec
54
+ ### RSpec [DEPRECATED]
55
+
56
+ The rspec-queue runner is deprecated. The minitest-queue runner continues to be supported and is actively being improved. At Shopify, we strongly recommend that new projects set up their test suite using Minitest rather than RSpec.
55
57
 
56
58
  Assuming you use one of the supported CI providers, the command can be as simple as:
57
59
 
@@ -67,4 +69,4 @@ rspec-queue --queue redis://example.com --timeout 600 --report
67
69
 
68
70
  #### Limitations
69
71
 
70
- Because of how `ci-queue` execute the examples, `before(:all)` and `after(:all)` hooks are not supported. `rspec-queue` will explicitly reject them.
72
+ Because of how `ci-queue` executes the examples, `before(:all)` and `after(:all)` hooks are not supported. `rspec-queue` will explicitly reject them.
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'rake'
34
34
  spec.add_development_dependency 'minitest', ENV.fetch('MINITEST_VERSION', '~> 5.11')
35
35
  spec.add_development_dependency 'rspec', '~> 3.7.0'
36
- spec.add_development_dependency 'redis', '~> 3.3'
36
+ spec.add_development_dependency 'redis'
37
37
  spec.add_development_dependency 'simplecov', '~> 0.12'
38
38
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
39
39
 
@@ -56,10 +56,18 @@ module CI
56
56
  rescue *CONNECTION_ERRORS
57
57
  end
58
58
 
59
- def retrying?
60
- redis.exists(key('worker', worker_id, 'queue'))
61
- rescue *CONNECTION_ERRORS
62
- false
59
+ if ::Redis.method_defined?(:exists?)
60
+ def retrying?
61
+ redis.exists?(key('worker', worker_id, 'queue'))
62
+ rescue *CONNECTION_ERRORS
63
+ false
64
+ end
65
+ else
66
+ def retrying?
67
+ redis.exists(key('worker', worker_id, 'queue'))
68
+ rescue *CONNECTION_ERRORS
69
+ false
70
+ end
63
71
  end
64
72
 
65
73
  def retry_queue
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.20.1'
5
+ VERSION = '0.20.6'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -106,7 +106,7 @@ module Minitest
106
106
  attr_writer :run_command_formatter, :project_root
107
107
 
108
108
  def run_command_formatter
109
- @run_command_formatter ||= if defined?(Railties)
109
+ @run_command_formatter ||= if defined?(Rails) && defined?(Rails::TestUnitRailtie)
110
110
  RAILS_RUN_COMMAND_FORMATTER
111
111
  else
112
112
  DEFAULT_RUN_COMMAND_FORMATTER
@@ -58,6 +58,10 @@ module Minitest
58
58
  @data[:test_and_module_name]
59
59
  end
60
60
 
61
+ def test_suite
62
+ @data[:test_suite]
63
+ end
64
+
61
65
  def test_file
62
66
  @data[:test_file]
63
67
  end
@@ -27,6 +27,7 @@ module Minitest
27
27
  test_line: test_line,
28
28
  test_and_module_name: "#{test.klass}##{test.name}",
29
29
  test_name: test.name,
30
+ test_suite: test.klass,
30
31
  error_class: test.failure.exception.class.name,
31
32
  output: to_s,
32
33
  }
@@ -96,13 +96,16 @@ module Minitest
96
96
  message.lines.first.chomp.gsub(/\e\[[^m]+m/, '')
97
97
  end
98
98
 
99
+ def project_root_path_matcher
100
+ @project_root_path_matcher ||= %r{(?<=\s)#{Regexp.escape(Minitest::Queue.project_root)}/}
101
+ end
102
+
99
103
  def message_for(test)
100
104
  suite = test.klass
101
105
  name = test.name
102
106
  error = test.failure
103
107
 
104
- message_with_relative_paths = error.message.gsub("#{Minitest::Queue.project_root}/", '')
105
-
108
+ message_with_relative_paths = error.message.gsub(project_root_path_matcher, '')
106
109
  if test.passed?
107
110
  nil
108
111
  elsif test.skipped?
@@ -54,7 +54,11 @@ module Minitest
54
54
 
55
55
  def test_file_path
56
56
  path = @test.source_location.first
57
- relative_path_for(path)
57
+ begin
58
+ relative_path_for(path)
59
+ rescue ArgumentError
60
+ path # e.g. "(eval)" etc.
61
+ end
58
62
  end
59
63
 
60
64
  def test_file_line_number
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.20.1
4
+ version: 0.20.6
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-05-13 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: redis
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.3'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.3'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement