test-queue 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/test_queue/runner/minitest.rb +5 -7
- data/lib/test_queue/runner/rspec.rb +4 -9
- data/lib/test_queue/runner.rb +1 -7
- data/lib/test_queue/version.rb +1 -1
- metadata +3 -5
- data/lib/test_queue/runner/minitest4.rb +0 -93
- data/lib/test_queue/runner/rspec2.rb +0 -44
- /data/lib/test_queue/runner/{rspec3.rb → rspec_ext.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0270d50dbfc6b383940e726188a854e9cbba7b9fa5f1979f85e04ade484f04f9
|
4
|
+
data.tar.gz: 36990b90f5f47ccddabea471dd858aee75f29892640d4513e8023315a3dd71b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7aba755710f56ae58b21e4bfbbc07b0b3832a54933ec74555fd28ae9f101a957c8c3d6950def76b63c56f54217d7fecc0638909a98ac71d83c88236b43e6951
|
7
|
+
data.tar.gz: c9435e822ed3abbec345791994be8aa8aa926bc8028bf1c14749f70a7e0a4821b92899dc89209e808f52c413e5073f07489aeb1096a58ecb77ed191a33c0f2d9
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
require_relative '../runner/minitest4'
|
9
|
-
end
|
3
|
+
require 'minitest'
|
4
|
+
|
5
|
+
raise 'requires Minitest version 5' unless Minitest::VERSION.to_i == 5
|
6
|
+
|
7
|
+
require_relative '../runner/minitest5'
|
10
8
|
|
11
9
|
module TestQueue
|
12
10
|
class Runner
|
@@ -1,16 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '../runner'
|
4
3
|
require 'rspec/core'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require_relative 'rspec3'
|
11
|
-
else
|
12
|
-
raise 'requires rspec version 2, 3, or 4'
|
13
|
-
end
|
5
|
+
raise 'requires RSpec version 3 or 4' unless [3, 4].include?(RSpec::Core::Version::STRING.to_i)
|
6
|
+
|
7
|
+
require_relative 'rspec_ext'
|
8
|
+
require_relative '../runner'
|
14
9
|
|
15
10
|
module TestQueue
|
16
11
|
class Runner
|
data/lib/test_queue/runner.rb
CHANGED
@@ -90,13 +90,7 @@ module TestQueue
|
|
90
90
|
@run_token = ENV['TEST_QUEUE_RELAY_TOKEN'] || SecureRandom.hex(8)
|
91
91
|
@socket = socket || ENV['TEST_QUEUE_SOCKET'] || "/tmp/test_queue_#{$$}_#{object_id}.sock"
|
92
92
|
@relay = relay || ENV['TEST_QUEUE_RELAY']
|
93
|
-
|
94
|
-
@remote_master_message = if ENV.key?('TEST_QUEUE_REMOTE_MASTER_MESSAGE')
|
95
|
-
ENV['TEST_QUEUE_REMOTE_MASTER_MESSAGE']
|
96
|
-
elsif ENV.key?('TEST_QUEUE_SLAVE_MESSAGE')
|
97
|
-
warn('`TEST_QUEUE_SLAVE_MESSAGE` is deprecated. Use `TEST_QUEUE_REMOTE_MASTER_MESSAGE` instead.')
|
98
|
-
ENV['TEST_QUEUE_SLAVE_MESSAGE']
|
99
|
-
end
|
93
|
+
@remote_master_message = ENV['TEST_QUEUE_REMOTE_MASTER_MESSAGE'] if ENV.key?('TEST_QUEUE_REMOTE_MASTER_MESSAGE')
|
100
94
|
|
101
95
|
if @relay == @socket
|
102
96
|
warn '*** Detected TEST_QUEUE_RELAY == TEST_QUEUE_SOCKET. Disabling relay mode.'
|
data/lib/test_queue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: minitest/rspec parallel test runner for CI environments
|
14
14
|
email: ruby@tmm1.net
|
@@ -33,12 +33,10 @@ files:
|
|
33
33
|
- lib/test_queue/runner/cucumber.rb
|
34
34
|
- lib/test_queue/runner/example.rb
|
35
35
|
- lib/test_queue/runner/minitest.rb
|
36
|
-
- lib/test_queue/runner/minitest4.rb
|
37
36
|
- lib/test_queue/runner/minitest5.rb
|
38
37
|
- lib/test_queue/runner/puppet_lint.rb
|
39
38
|
- lib/test_queue/runner/rspec.rb
|
40
|
-
- lib/test_queue/runner/
|
41
|
-
- lib/test_queue/runner/rspec3.rb
|
39
|
+
- lib/test_queue/runner/rspec_ext.rb
|
42
40
|
- lib/test_queue/runner/testunit.rb
|
43
41
|
- lib/test_queue/stats.rb
|
44
42
|
- lib/test_queue/test_framework.rb
|
@@ -1,93 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../runner'
|
4
|
-
require 'set'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
class MiniTestQueueRunner < MiniTest::Unit
|
8
|
-
def _run_suites(suites, type)
|
9
|
-
self.class.output = $stdout
|
10
|
-
|
11
|
-
if defined?(ParallelEach)
|
12
|
-
# Ignore its _run_suites implementation since we don't handle it gracefully.
|
13
|
-
# If we don't do this #partition is called on the iterator and all suites
|
14
|
-
# distributed immediately, instead of picked up as workers are available.
|
15
|
-
suites.map { |suite| _run_suite suite, type }
|
16
|
-
else
|
17
|
-
super
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def _run_anything(*)
|
22
|
-
ret = super
|
23
|
-
output.puts
|
24
|
-
ret
|
25
|
-
end
|
26
|
-
|
27
|
-
def _run_suite(suite, type)
|
28
|
-
output.print ' '
|
29
|
-
output.print suite
|
30
|
-
output.print ': '
|
31
|
-
|
32
|
-
start = Time.now
|
33
|
-
ret = super
|
34
|
-
diff = Time.now - start
|
35
|
-
|
36
|
-
output.puts(' <%.3f>' % diff)
|
37
|
-
ret
|
38
|
-
end
|
39
|
-
|
40
|
-
self.runner = new
|
41
|
-
self.output = StringIO.new
|
42
|
-
end
|
43
|
-
|
44
|
-
class MiniTest::Unit::TestCase
|
45
|
-
class << self
|
46
|
-
attr_accessor :test_suites
|
47
|
-
|
48
|
-
def original_test_suites
|
49
|
-
@@test_suites.keys.reject { |s| s.test_methods.empty? }
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def failure_count
|
54
|
-
failures.length
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
module TestQueue
|
59
|
-
class Runner
|
60
|
-
class Minitest < Runner
|
61
|
-
def initialize
|
62
|
-
if ::MiniTest::Unit::TestCase.original_test_suites.any?
|
63
|
-
raise 'Do not `require` test files. Pass them via ARGV instead and they will be required as needed.'
|
64
|
-
end
|
65
|
-
|
66
|
-
super(TestFramework::Minitest.new)
|
67
|
-
end
|
68
|
-
|
69
|
-
def run_worker(iterator)
|
70
|
-
::MiniTest::Unit::TestCase.test_suites = iterator
|
71
|
-
::MiniTest::Unit.new.run
|
72
|
-
end
|
73
|
-
end
|
74
|
-
MiniTest = Minitest # For compatibility with test-queue 0.7.0 and earlier.
|
75
|
-
end
|
76
|
-
|
77
|
-
class TestFramework
|
78
|
-
class Minitest < TestFramework
|
79
|
-
def all_suite_files
|
80
|
-
ARGV
|
81
|
-
end
|
82
|
-
|
83
|
-
def suites_from_file(path)
|
84
|
-
::MiniTest::Unit::TestCase.reset
|
85
|
-
require File.absolute_path(path)
|
86
|
-
::MiniTest::Unit::TestCase.original_test_suites.map { |suite|
|
87
|
-
[suite.name, suite]
|
88
|
-
}
|
89
|
-
end
|
90
|
-
end
|
91
|
-
MiniTest = Minitest # For compatibility with test-queue 0.7.0 and earlier.
|
92
|
-
end
|
93
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class ::RSpec::Core::ExampleGroup
|
4
|
-
def self.failure_count
|
5
|
-
examples.map { |e| e.execution_result[:status] == 'failed' }.length
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module RSpec::Core
|
10
|
-
class QueueRunner < CommandLine
|
11
|
-
def initialize
|
12
|
-
super(ARGV)
|
13
|
-
@configuration.output_stream = $stdout
|
14
|
-
@configuration.error_stream = $stderr
|
15
|
-
end
|
16
|
-
|
17
|
-
def run_each(iterator)
|
18
|
-
@configuration.reporter.report(0, @configuration.randomize? ? @configuration.seed : nil) do |reporter|
|
19
|
-
@configuration.run_hook(:before, :suite)
|
20
|
-
iterator.map { |g|
|
21
|
-
if g.is_a? ::RSpec::Core::Example
|
22
|
-
print " #{g.full_description}: "
|
23
|
-
example = g
|
24
|
-
g = example.example_group
|
25
|
-
::RSpec.world.filtered_examples.clear
|
26
|
-
examples = [example]
|
27
|
-
examples.extend(::RSpec::Core::Extensions::Ordered::Examples)
|
28
|
-
::RSpec.world.filtered_examples[g] = examples
|
29
|
-
else
|
30
|
-
print " #{g.description}: "
|
31
|
-
end
|
32
|
-
start = Time.now
|
33
|
-
ret = g.run(reporter)
|
34
|
-
diff = Time.now - start
|
35
|
-
puts(' <%.3f>' % diff)
|
36
|
-
|
37
|
-
ret
|
38
|
-
}.all? ? 0 : @configuration.failure_exit_code
|
39
|
-
ensure
|
40
|
-
@configuration.run_hook(:after, :suite)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
File without changes
|