test-queue-patched 0.4.3
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 +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +18 -0
- data/Gemfile +5 -0
- data/Gemfile-cucumber1-3 +4 -0
- data/Gemfile-cucumber1-3.lock +33 -0
- data/Gemfile-cucumber2-4 +4 -0
- data/Gemfile-cucumber2-4.lock +37 -0
- data/Gemfile-minitest4 +3 -0
- data/Gemfile-minitest4.lock +19 -0
- data/Gemfile-minitest5 +3 -0
- data/Gemfile-minitest5.lock +19 -0
- data/Gemfile-rspec2-1 +3 -0
- data/Gemfile-rspec2-1.lock +27 -0
- data/Gemfile-rspec3-0 +3 -0
- data/Gemfile-rspec3-0.lock +31 -0
- data/Gemfile-rspec3-1 +3 -0
- data/Gemfile-rspec3-1.lock +31 -0
- data/Gemfile-rspec3-2 +3 -0
- data/Gemfile-rspec3-2.lock +32 -0
- data/Gemfile-testunit +3 -0
- data/Gemfile-testunit.lock +21 -0
- data/Gemfile.lock +41 -0
- data/README.md +126 -0
- data/bin/cucumber-queue +4 -0
- data/bin/minitest-queue +4 -0
- data/bin/rspec-queue +4 -0
- data/bin/testunit-queue +4 -0
- data/lib/test-queue.rb +1 -0
- data/lib/test_queue/iterator.rb +107 -0
- data/lib/test_queue/runner/cucumber.rb +115 -0
- data/lib/test_queue/runner/minitest.rb +21 -0
- data/lib/test_queue/runner/minitest4.rb +88 -0
- data/lib/test_queue/runner/minitest5.rb +87 -0
- data/lib/test_queue/runner/puppet_lint.rb +31 -0
- data/lib/test_queue/runner/rspec.rb +79 -0
- data/lib/test_queue/runner/rspec2.rb +44 -0
- data/lib/test_queue/runner/rspec3.rb +54 -0
- data/lib/test_queue/runner/sample.rb +74 -0
- data/lib/test_queue/runner/testunit.rb +74 -0
- data/lib/test_queue/runner.rb +632 -0
- data/lib/test_queue/stats.rb +95 -0
- data/lib/test_queue/test_framework.rb +29 -0
- data/lib/test_queue.rb +8 -0
- data/script/bootstrap +12 -0
- data/script/cibuild +19 -0
- data/script/spec +7 -0
- data/spec/stats_spec.rb +76 -0
- data/test/cucumber.bats +57 -0
- data/test/minitest4.bats +34 -0
- data/test/minitest5.bats +194 -0
- data/test/rspec.bats +46 -0
- data/test/samples/features/bad.feature +5 -0
- data/test/samples/features/sample.feature +25 -0
- data/test/samples/features/sample2.feature +29 -0
- data/test/samples/features/step_definitions/common.rb +19 -0
- data/test/samples/sample_minispec.rb +37 -0
- data/test/samples/sample_minitest4.rb +25 -0
- data/test/samples/sample_minitest5.rb +33 -0
- data/test/samples/sample_rspec_helper.rb +1 -0
- data/test/samples/sample_shared_examples_for_spec.rb +5 -0
- data/test/samples/sample_spec.rb +25 -0
- data/test/samples/sample_split_spec.rb +17 -0
- data/test/samples/sample_testunit.rb +25 -0
- data/test/samples/sample_use_shared_example1_spec.rb +8 -0
- data/test/samples/sample_use_shared_example2_spec.rb +8 -0
- data/test/sleepy_runner.rb +14 -0
- data/test/testlib.bash +89 -0
- data/test/testunit.bats +20 -0
- data/test-queue-patched.gemspec +21 -0
- metadata +117 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
describe 'RSpecEqual' do
|
4
|
+
it 'checks equality' do
|
5
|
+
expect(1).to eq 1
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
30.times do |i|
|
10
|
+
describe "RSpecSleep(#{i})" do
|
11
|
+
it "sleeps" do
|
12
|
+
start = Time.now
|
13
|
+
sleep(0.25)
|
14
|
+
expect(Time.now-start).to be_within(0.02).of(0.25)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
if ENV["FAIL"]
|
20
|
+
describe 'RSpecFailure' do
|
21
|
+
it 'fails' do
|
22
|
+
expect(:foo).to eq :bar
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rspec"
|
2
|
+
|
3
|
+
describe 'SplittableGroup', :no_split => !!ENV["NOSPLIT"] do
|
4
|
+
2.times do |i|
|
5
|
+
it "runs test #{i}" do
|
6
|
+
# Sleep longer in CI to make the distribution of examples across workers
|
7
|
+
# more deterministic.
|
8
|
+
if ENV["CI"]
|
9
|
+
sleep(5)
|
10
|
+
else
|
11
|
+
sleep(1)
|
12
|
+
end
|
13
|
+
|
14
|
+
expect(1).to eq 1
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
class TestUnitEqual < Test::Unit::TestCase
|
4
|
+
def test_equal
|
5
|
+
assert_equal 1, 1
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
30.times do |i|
|
10
|
+
Object.const_set("TestUnitSleep#{i}", Class.new(Test::Unit::TestCase) do
|
11
|
+
define_method('test_sleep') do
|
12
|
+
start = Time.now
|
13
|
+
sleep(0.25)
|
14
|
+
assert_in_delta Time.now-start, 0.25, 0.02
|
15
|
+
end
|
16
|
+
end)
|
17
|
+
end
|
18
|
+
|
19
|
+
if ENV["FAIL"]
|
20
|
+
class TestUnitFailure < Test::Unit::TestCase
|
21
|
+
def test_fail
|
22
|
+
assert_equal 0, 1
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'test_queue'
|
2
|
+
require 'test_queue/runner/minitest'
|
3
|
+
|
4
|
+
class SleepyTestRunner < TestQueue::Runner::MiniTest
|
5
|
+
def after_fork(num)
|
6
|
+
if ENV['SLEEP_AS_RELAY'] && relay?
|
7
|
+
sleep 5
|
8
|
+
elsif ENV['SLEEP_AS_MASTER'] && !relay?
|
9
|
+
sleep 5
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
SleepyTestRunner.new.execute
|
data/test/testlib.bash
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# Skip this test unless the bundle contains a gem matching the required
|
2
|
+
# version. Example:
|
3
|
+
#
|
4
|
+
# require_gem "minitest" "~> 5.3"
|
5
|
+
require_gem() {
|
6
|
+
name=$1
|
7
|
+
requirement=$2
|
8
|
+
|
9
|
+
set +e
|
10
|
+
version=$(bundle exec ruby - <<RUBY
|
11
|
+
spec = Gem.loaded_specs['$name']
|
12
|
+
exit unless spec
|
13
|
+
puts spec.version
|
14
|
+
exit Gem::Dependency.new('$name', '$requirement').match?(spec)
|
15
|
+
RUBY
|
16
|
+
)
|
17
|
+
result=$?
|
18
|
+
set -e
|
19
|
+
|
20
|
+
if [ "$version" = "" ]; then
|
21
|
+
skip "$name is not installed"
|
22
|
+
elif [ $result -ne 0 ]; then
|
23
|
+
skip "$name $version is not $requirement"
|
24
|
+
fi
|
25
|
+
}
|
26
|
+
|
27
|
+
assert_status() {
|
28
|
+
expected=$1
|
29
|
+
[ "$status" -eq "$expected" ] || {
|
30
|
+
echo "Expected status to be $expected but was $status. Full output:"
|
31
|
+
echo "$output"
|
32
|
+
return 1
|
33
|
+
}
|
34
|
+
return 0
|
35
|
+
}
|
36
|
+
|
37
|
+
refute_status() {
|
38
|
+
expected=$1
|
39
|
+
[ "$status" -ne "$expected" ] || {
|
40
|
+
echo "Expected status not to be $expected. Full output:"
|
41
|
+
echo "$output"
|
42
|
+
return 1
|
43
|
+
}
|
44
|
+
return 0
|
45
|
+
}
|
46
|
+
|
47
|
+
assert_output_contains() {
|
48
|
+
echo "$output" | fgrep --quiet "$@" || {
|
49
|
+
echo "Expected to find \"$@\" in:"
|
50
|
+
echo "$output"
|
51
|
+
return 1
|
52
|
+
}
|
53
|
+
return 0
|
54
|
+
}
|
55
|
+
|
56
|
+
refute_output_contains() {
|
57
|
+
assert_output_contains "$@" && {
|
58
|
+
echo "Expected not to find \"$@\" in:"
|
59
|
+
echo "$output"
|
60
|
+
return 1
|
61
|
+
}
|
62
|
+
return 0
|
63
|
+
}
|
64
|
+
|
65
|
+
assert_output_matches() {
|
66
|
+
echo "$output" | egrep --quiet "$@" || {
|
67
|
+
echo "Expected to \"$@\" to match within:"
|
68
|
+
echo "$output"
|
69
|
+
return 1
|
70
|
+
}
|
71
|
+
return 0
|
72
|
+
}
|
73
|
+
|
74
|
+
refute_output_matches() {
|
75
|
+
assert_output_matches "$@" && {
|
76
|
+
echo "Expected \"$@\" not to match within:"
|
77
|
+
echo "$output"
|
78
|
+
return 1
|
79
|
+
}
|
80
|
+
return 0
|
81
|
+
}
|
82
|
+
|
83
|
+
assert_equal() {
|
84
|
+
[ "$1" = "$2" ] || {
|
85
|
+
echo "Expected \"$1\" to equal \"$2\""
|
86
|
+
return 1
|
87
|
+
}
|
88
|
+
return 0
|
89
|
+
}
|
data/test/testunit.bats
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
load "testlib"
|
2
|
+
|
3
|
+
setup() {
|
4
|
+
require_gem "test-unit" ">= 3.0"
|
5
|
+
}
|
6
|
+
|
7
|
+
@test "testunit-queue succeeds when all tests pass" {
|
8
|
+
run bundle exec testunit-queue ./test/samples/*_testunit.rb
|
9
|
+
assert_status 0
|
10
|
+
assert_output_contains "Starting test-queue master"
|
11
|
+
}
|
12
|
+
|
13
|
+
@test "testunit-queue fails when a test fails" {
|
14
|
+
export FAIL=1
|
15
|
+
run bundle exec testunit-queue ./test/samples/*_testunit.rb
|
16
|
+
assert_status 1
|
17
|
+
assert_output_contains "Starting test-queue master"
|
18
|
+
assert_output_contains "Failure:"
|
19
|
+
assert_output_contains "test_fail(TestUnitFailure)"
|
20
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = 'test-queue-patched'
|
3
|
+
s.version = '0.4.3'
|
4
|
+
s.summary = 'parallel test runner'
|
5
|
+
s.description = 'minitest/rspec parallel test runner for CI environments'
|
6
|
+
|
7
|
+
s.homepage = "http://github.com/tmm1/test-queue"
|
8
|
+
|
9
|
+
s.authors = ["Aman Gupta"]
|
10
|
+
s.email = "ruby@tmm1.net"
|
11
|
+
s.license = 'MIT'
|
12
|
+
|
13
|
+
s.has_rdoc = false
|
14
|
+
s.bindir = 'bin'
|
15
|
+
s.executables << 'rspec-queue'
|
16
|
+
s.executables << 'minitest-queue'
|
17
|
+
s.executables << 'testunit-queue'
|
18
|
+
s.executables << 'cucumber-queue'
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: test-queue-patched
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aman Gupta
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: minitest/rspec parallel test runner for CI environments
|
14
|
+
email: ruby@tmm1.net
|
15
|
+
executables:
|
16
|
+
- rspec-queue
|
17
|
+
- minitest-queue
|
18
|
+
- testunit-queue
|
19
|
+
- cucumber-queue
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- ".gitignore"
|
24
|
+
- ".travis.yml"
|
25
|
+
- Gemfile
|
26
|
+
- Gemfile-cucumber1-3
|
27
|
+
- Gemfile-cucumber1-3.lock
|
28
|
+
- Gemfile-cucumber2-4
|
29
|
+
- Gemfile-cucumber2-4.lock
|
30
|
+
- Gemfile-minitest4
|
31
|
+
- Gemfile-minitest4.lock
|
32
|
+
- Gemfile-minitest5
|
33
|
+
- Gemfile-minitest5.lock
|
34
|
+
- Gemfile-rspec2-1
|
35
|
+
- Gemfile-rspec2-1.lock
|
36
|
+
- Gemfile-rspec3-0
|
37
|
+
- Gemfile-rspec3-0.lock
|
38
|
+
- Gemfile-rspec3-1
|
39
|
+
- Gemfile-rspec3-1.lock
|
40
|
+
- Gemfile-rspec3-2
|
41
|
+
- Gemfile-rspec3-2.lock
|
42
|
+
- Gemfile-testunit
|
43
|
+
- Gemfile-testunit.lock
|
44
|
+
- Gemfile.lock
|
45
|
+
- README.md
|
46
|
+
- bin/cucumber-queue
|
47
|
+
- bin/minitest-queue
|
48
|
+
- bin/rspec-queue
|
49
|
+
- bin/testunit-queue
|
50
|
+
- lib/test-queue.rb
|
51
|
+
- lib/test_queue.rb
|
52
|
+
- lib/test_queue/iterator.rb
|
53
|
+
- lib/test_queue/runner.rb
|
54
|
+
- lib/test_queue/runner/cucumber.rb
|
55
|
+
- lib/test_queue/runner/minitest.rb
|
56
|
+
- lib/test_queue/runner/minitest4.rb
|
57
|
+
- lib/test_queue/runner/minitest5.rb
|
58
|
+
- lib/test_queue/runner/puppet_lint.rb
|
59
|
+
- lib/test_queue/runner/rspec.rb
|
60
|
+
- lib/test_queue/runner/rspec2.rb
|
61
|
+
- lib/test_queue/runner/rspec3.rb
|
62
|
+
- lib/test_queue/runner/sample.rb
|
63
|
+
- lib/test_queue/runner/testunit.rb
|
64
|
+
- lib/test_queue/stats.rb
|
65
|
+
- lib/test_queue/test_framework.rb
|
66
|
+
- script/bootstrap
|
67
|
+
- script/cibuild
|
68
|
+
- script/spec
|
69
|
+
- spec/stats_spec.rb
|
70
|
+
- test-queue-patched.gemspec
|
71
|
+
- test/cucumber.bats
|
72
|
+
- test/minitest4.bats
|
73
|
+
- test/minitest5.bats
|
74
|
+
- test/rspec.bats
|
75
|
+
- test/samples/features/bad.feature
|
76
|
+
- test/samples/features/sample.feature
|
77
|
+
- test/samples/features/sample2.feature
|
78
|
+
- test/samples/features/step_definitions/common.rb
|
79
|
+
- test/samples/sample_minispec.rb
|
80
|
+
- test/samples/sample_minitest4.rb
|
81
|
+
- test/samples/sample_minitest5.rb
|
82
|
+
- test/samples/sample_rspec_helper.rb
|
83
|
+
- test/samples/sample_shared_examples_for_spec.rb
|
84
|
+
- test/samples/sample_spec.rb
|
85
|
+
- test/samples/sample_split_spec.rb
|
86
|
+
- test/samples/sample_testunit.rb
|
87
|
+
- test/samples/sample_use_shared_example1_spec.rb
|
88
|
+
- test/samples/sample_use_shared_example2_spec.rb
|
89
|
+
- test/sleepy_runner.rb
|
90
|
+
- test/testlib.bash
|
91
|
+
- test/testunit.bats
|
92
|
+
homepage: http://github.com/tmm1/test-queue
|
93
|
+
licenses:
|
94
|
+
- MIT
|
95
|
+
metadata: {}
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
requirements: []
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 2.6.11
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: parallel test runner
|
116
|
+
test_files: []
|
117
|
+
has_rdoc: false
|