test-queue 0.2.13 → 0.3.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 +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +18 -0
- data/Gemfile +2 -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.lock +4 -23
- 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.lock +4 -13
- data/Gemfile-rspec3-1.lock +4 -13
- data/Gemfile-rspec3-2.lock +4 -13
- data/Gemfile-testunit.lock +4 -27
- data/Gemfile.lock +4 -1
- data/README.md +4 -0
- data/bin/minitest-queue +0 -1
- data/bin/testunit-queue +0 -1
- data/lib/test_queue/iterator.rb +41 -10
- data/lib/test_queue/runner.rb +167 -58
- data/lib/test_queue/runner/cucumber.rb +81 -12
- data/lib/test_queue/runner/minitest.rb +0 -4
- data/lib/test_queue/runner/minitest4.rb +25 -2
- data/lib/test_queue/runner/minitest5.rb +36 -11
- data/lib/test_queue/runner/rspec.rb +55 -7
- data/lib/test_queue/runner/rspec2.rb +11 -8
- data/lib/test_queue/runner/rspec3.rb +10 -7
- data/lib/test_queue/runner/sample.rb +0 -2
- data/lib/test_queue/runner/testunit.rb +25 -7
- data/lib/test_queue/stats.rb +95 -0
- data/lib/test_queue/test_framework.rb +29 -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-queue.gemspec +1 -4
- data/test/cucumber.bats +57 -0
- data/test/minitest4.bats +34 -0
- data/test/minitest5.bats +111 -0
- data/test/rspec.bats +38 -0
- data/{features → test/samples/features}/bad.feature +0 -0
- data/{features → test/samples/features}/sample.feature +0 -0
- data/{features → test/samples/features}/sample2.feature +0 -0
- data/{features → test/samples/features}/step_definitions/common.rb +5 -1
- data/test/{sample_minispec.rb → samples/sample_minispec.rb} +6 -0
- data/test/{sample_minitest4.rb → samples/sample_minitest4.rb} +5 -3
- data/test/{sample_minitest5.rb → samples/sample_minitest5.rb} +5 -3
- data/test/{sample_spec.rb → samples/sample_spec.rb} +5 -3
- data/test/samples/sample_split_spec.rb +17 -0
- data/test/{sample_testunit.rb → samples/sample_testunit.rb} +5 -3
- data/test/testlib.bash +81 -0
- data/test/testunit.bats +20 -0
- metadata +40 -60
- data/test-multi.sh +0 -8
- data/test.sh +0 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fbdc02f98f8e6e07a67693e13a244f5d50f5b6e5
|
4
|
+
data.tar.gz: 377d47b3e6b54fd3bbcb5d526d749480df6265dc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6bc6bc66ba5d4e4fe5a5a7c6a19522f0cf5dc1e3d044d33c9b462b36ad01097cdbaf133102f53bc61e0559bb33419574a10f4d17af0e20449b80a346eeb36440
|
7
|
+
data.tar.gz: 90885077e4c321b0f7c576b3ff7814e46aa43a98e7fb723cfbd770a2874f7655639cc5d4e8e1e943247779a31d092941303a03ebd8b3e886197ffbb09cd44033
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.test_queue_stats
|
data/.travis.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
language: ruby
|
2
|
+
install: script/bootstrap
|
3
|
+
rvm:
|
4
|
+
- 2.2
|
5
|
+
env:
|
6
|
+
- SUITE=ruby
|
7
|
+
- SUITE=cucumber1-3
|
8
|
+
- SUITE=cucumber2-4
|
9
|
+
- SUITE=minitest4
|
10
|
+
- SUITE=minitest5
|
11
|
+
- SUITE=rspec2-1
|
12
|
+
- SUITE=rspec3-0
|
13
|
+
- SUITE=rspec3-1
|
14
|
+
- SUITE=rspec3-2
|
15
|
+
- SUITE=testunit
|
16
|
+
script: script/cibuild
|
17
|
+
notifications:
|
18
|
+
email: false
|
data/Gemfile
CHANGED
data/Gemfile-cucumber1-3
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
test-queue (0.3.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
builder (3.2.2)
|
10
|
+
cucumber (1.3.20)
|
11
|
+
builder (>= 2.1.2)
|
12
|
+
diff-lcs (>= 1.1.3)
|
13
|
+
gherkin (~> 2.12)
|
14
|
+
multi_json (>= 1.7.5, < 2.0)
|
15
|
+
multi_test (>= 0.1.2)
|
16
|
+
diff-lcs (1.2.5)
|
17
|
+
gherkin (2.12.2)
|
18
|
+
multi_json (~> 1.3)
|
19
|
+
multi_json (1.12.1)
|
20
|
+
multi_test (0.1.2)
|
21
|
+
rspec-expectations (2.14.5)
|
22
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
ruby
|
26
|
+
|
27
|
+
DEPENDENCIES
|
28
|
+
cucumber (~> 1.3.10)
|
29
|
+
rspec-expectations (~> 2.14.4)
|
30
|
+
test-queue!
|
31
|
+
|
32
|
+
BUNDLED WITH
|
33
|
+
1.13.1
|
data/Gemfile-cucumber2-4
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
test-queue (0.3.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
builder (3.2.2)
|
10
|
+
cucumber (2.4.0)
|
11
|
+
builder (>= 2.1.2)
|
12
|
+
cucumber-core (~> 1.5.0)
|
13
|
+
cucumber-wire (~> 0.0.1)
|
14
|
+
diff-lcs (>= 1.1.3)
|
15
|
+
gherkin (~> 4.0)
|
16
|
+
multi_json (>= 1.7.5, < 2.0)
|
17
|
+
multi_test (>= 0.1.2)
|
18
|
+
cucumber-core (1.5.0)
|
19
|
+
gherkin (~> 4.0)
|
20
|
+
cucumber-wire (0.0.1)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
gherkin (4.0.0)
|
23
|
+
multi_json (1.12.1)
|
24
|
+
multi_test (0.1.2)
|
25
|
+
rspec-expectations (2.14.4)
|
26
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
cucumber (= 2.4.0)
|
33
|
+
rspec-expectations (= 2.14.4)
|
34
|
+
test-queue!
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
1.13.1
|
data/Gemfile-minitest4.lock
CHANGED
@@ -1,38 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-queue (0.
|
4
|
+
test-queue (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (1.3.15)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
diff-lcs (>= 1.1.3)
|
13
|
-
gherkin (~> 2.12)
|
14
|
-
multi_json (>= 1.7.5, < 2.0)
|
15
|
-
multi_test (>= 0.1.1)
|
16
|
-
diff-lcs (1.2.5)
|
17
|
-
gherkin (2.12.2)
|
18
|
-
multi_json (~> 1.3)
|
19
9
|
minitest (4.7.3)
|
20
|
-
multi_json (1.10.1)
|
21
|
-
multi_test (0.1.1)
|
22
|
-
rspec (2.99.0)
|
23
|
-
rspec-core (~> 2.99.0)
|
24
|
-
rspec-expectations (~> 2.99.0)
|
25
|
-
rspec-mocks (~> 2.99.0)
|
26
|
-
rspec-core (2.99.1)
|
27
|
-
rspec-expectations (2.99.1)
|
28
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
29
|
-
rspec-mocks (2.99.1)
|
30
10
|
|
31
11
|
PLATFORMS
|
32
12
|
ruby
|
33
13
|
|
34
14
|
DEPENDENCIES
|
35
|
-
cucumber (~> 1.3.10)
|
36
15
|
minitest (= 4.7.3)
|
37
|
-
rspec (>= 2.13, < 4.0)
|
38
16
|
test-queue!
|
17
|
+
|
18
|
+
BUNDLED WITH
|
19
|
+
1.13.1
|
data/Gemfile-minitest5
ADDED
data/Gemfile-rspec2-1
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
test-queue (0.3.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.2.5)
|
10
|
+
rspec (2.13.0)
|
11
|
+
rspec-core (~> 2.13.0)
|
12
|
+
rspec-expectations (~> 2.13.0)
|
13
|
+
rspec-mocks (~> 2.13.0)
|
14
|
+
rspec-core (2.13.1)
|
15
|
+
rspec-expectations (2.13.0)
|
16
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
17
|
+
rspec-mocks (2.13.1)
|
18
|
+
|
19
|
+
PLATFORMS
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
rspec (= 2.13.0)
|
24
|
+
test-queue!
|
25
|
+
|
26
|
+
BUNDLED WITH
|
27
|
+
1.13.1
|
data/Gemfile-rspec3-0.lock
CHANGED
@@ -1,23 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-queue (0.
|
4
|
+
test-queue (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (1.3.19)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
diff-lcs (>= 1.1.3)
|
13
|
-
gherkin (~> 2.12)
|
14
|
-
multi_json (>= 1.7.5, < 2.0)
|
15
|
-
multi_test (>= 0.1.2)
|
16
9
|
diff-lcs (1.2.5)
|
17
|
-
gherkin (2.12.2)
|
18
|
-
multi_json (~> 1.3)
|
19
|
-
multi_json (1.11.0)
|
20
|
-
multi_test (0.1.2)
|
21
10
|
rspec (3.0.0)
|
22
11
|
rspec-core (~> 3.0.0)
|
23
12
|
rspec-expectations (~> 3.0.0)
|
@@ -35,6 +24,8 @@ PLATFORMS
|
|
35
24
|
ruby
|
36
25
|
|
37
26
|
DEPENDENCIES
|
38
|
-
cucumber (~> 1.3.10)
|
39
27
|
rspec (~> 3.0.0)
|
40
28
|
test-queue!
|
29
|
+
|
30
|
+
BUNDLED WITH
|
31
|
+
1.13.1
|
data/Gemfile-rspec3-1.lock
CHANGED
@@ -1,23 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-queue (0.
|
4
|
+
test-queue (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (1.3.19)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
diff-lcs (>= 1.1.3)
|
13
|
-
gherkin (~> 2.12)
|
14
|
-
multi_json (>= 1.7.5, < 2.0)
|
15
|
-
multi_test (>= 0.1.2)
|
16
9
|
diff-lcs (1.2.5)
|
17
|
-
gherkin (2.12.2)
|
18
|
-
multi_json (~> 1.3)
|
19
|
-
multi_json (1.11.0)
|
20
|
-
multi_test (0.1.2)
|
21
10
|
rspec (3.1.0)
|
22
11
|
rspec-core (~> 3.1.0)
|
23
12
|
rspec-expectations (~> 3.1.0)
|
@@ -35,6 +24,8 @@ PLATFORMS
|
|
35
24
|
ruby
|
36
25
|
|
37
26
|
DEPENDENCIES
|
38
|
-
cucumber (~> 1.3.10)
|
39
27
|
rspec (~> 3.1.0)
|
40
28
|
test-queue!
|
29
|
+
|
30
|
+
BUNDLED WITH
|
31
|
+
1.13.1
|
data/Gemfile-rspec3-2.lock
CHANGED
@@ -1,23 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-queue (0.
|
4
|
+
test-queue (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (1.3.19)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
diff-lcs (>= 1.1.3)
|
13
|
-
gherkin (~> 2.12)
|
14
|
-
multi_json (>= 1.7.5, < 2.0)
|
15
|
-
multi_test (>= 0.1.2)
|
16
9
|
diff-lcs (1.2.5)
|
17
|
-
gherkin (2.12.2)
|
18
|
-
multi_json (~> 1.3)
|
19
|
-
multi_json (1.11.0)
|
20
|
-
multi_test (0.1.2)
|
21
10
|
rspec (3.2.0)
|
22
11
|
rspec-core (~> 3.2.0)
|
23
12
|
rspec-expectations (~> 3.2.0)
|
@@ -36,6 +25,8 @@ PLATFORMS
|
|
36
25
|
ruby
|
37
26
|
|
38
27
|
DEPENDENCIES
|
39
|
-
cucumber (~> 1.3.10)
|
40
28
|
rspec (~> 3.2.0)
|
41
29
|
test-queue!
|
30
|
+
|
31
|
+
BUNDLED WITH
|
32
|
+
1.13.1
|
data/Gemfile-testunit.lock
CHANGED
@@ -1,36 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-queue (0.
|
4
|
+
test-queue (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (1.3.18)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
diff-lcs (>= 1.1.3)
|
13
|
-
gherkin (~> 2.12)
|
14
|
-
multi_json (>= 1.7.5, < 2.0)
|
15
|
-
multi_test (>= 0.1.1)
|
16
|
-
diff-lcs (1.2.5)
|
17
|
-
gherkin (2.12.2)
|
18
|
-
multi_json (~> 1.3)
|
19
|
-
multi_json (1.10.1)
|
20
|
-
multi_test (0.1.1)
|
21
9
|
power_assert (0.2.2)
|
22
|
-
rspec (3.1.0)
|
23
|
-
rspec-core (~> 3.1.0)
|
24
|
-
rspec-expectations (~> 3.1.0)
|
25
|
-
rspec-mocks (~> 3.1.0)
|
26
|
-
rspec-core (3.1.7)
|
27
|
-
rspec-support (~> 3.1.0)
|
28
|
-
rspec-expectations (3.1.2)
|
29
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.1.0)
|
31
|
-
rspec-mocks (3.1.3)
|
32
|
-
rspec-support (~> 3.1.0)
|
33
|
-
rspec-support (3.1.2)
|
34
10
|
test-unit (3.0.8)
|
35
11
|
power_assert
|
36
12
|
|
@@ -38,7 +14,8 @@ PLATFORMS
|
|
38
14
|
ruby
|
39
15
|
|
40
16
|
DEPENDENCIES
|
41
|
-
cucumber (~> 1.3.10)
|
42
|
-
rspec (>= 2.13, < 4.0)
|
43
17
|
test-queue!
|
44
18
|
test-unit (= 3.0.8)
|
19
|
+
|
20
|
+
BUNDLED WITH
|
21
|
+
1.13.1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## test-queue
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/test-queue)
|
4
|
+
[](https://travis-ci.org/tmm1/test-queue)
|
5
|
+
|
3
6
|
Yet another parallel test runner, built using a centralized queue to ensure
|
4
7
|
optimal distribution of tests between workers.
|
5
8
|
|
@@ -35,6 +38,7 @@ the workload and relay results back to a central master.
|
|
35
38
|
- `TEST_QUEUE_RELAY_TIMEOUT`: when using remote workers, the amount of time a worker will try to reconnect to start work
|
36
39
|
- `TEST_QUEUE_RELAY_TOKEN`: when using remote workers, this must be the same on both workers and the server for remote workers to run tests.
|
37
40
|
- `TEST_QUEUE_SLAVE_MESSAGE`: when using remote workers, set this on a slave worker and it will appear on the slave's connection message on the master.
|
41
|
+
- `TEST_QUEUE_SPLIT_GROUPS`: split tests up by example rather than example group. Faster for tests with short setup time such as selenium. RSpec only. Add the :no_split tag to ExampleGroups you don't want split.
|
38
42
|
|
39
43
|
### usage
|
40
44
|
|
data/bin/minitest-queue
CHANGED
data/bin/testunit-queue
CHANGED
data/lib/test_queue/iterator.rb
CHANGED
@@ -1,34 +1,53 @@
|
|
1
1
|
module TestQueue
|
2
2
|
class Iterator
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :sock
|
4
4
|
|
5
|
-
def initialize(
|
5
|
+
def initialize(test_framework, sock, filter=nil, early_failure_limit: nil)
|
6
|
+
@test_framework = test_framework
|
6
7
|
@done = false
|
7
|
-
@
|
8
|
+
@suite_stats = []
|
8
9
|
@procline = $0
|
9
10
|
@sock = sock
|
10
|
-
@suites = suites
|
11
11
|
@filter = filter
|
12
12
|
if @sock =~ /^(.+):(\d+)$/
|
13
13
|
@tcp_address = $1
|
14
14
|
@tcp_port = $2.to_i
|
15
15
|
end
|
16
|
+
@failures = 0
|
17
|
+
@early_failure_limit = early_failure_limit
|
16
18
|
end
|
17
19
|
|
18
20
|
def each
|
19
21
|
fail "already used this iterator. previous caller: #@done" if @done
|
20
22
|
|
21
23
|
while true
|
22
|
-
|
24
|
+
# If we've hit too many failures in one worker, assume the entire
|
25
|
+
# test suite is broken, and notify master so the run
|
26
|
+
# can be immediately halted.
|
27
|
+
if @early_failure_limit && @failures >= @early_failure_limit
|
28
|
+
connect_to_master("KABOOM")
|
29
|
+
break
|
30
|
+
else
|
31
|
+
client = connect_to_master('POP')
|
32
|
+
end
|
23
33
|
break if client.nil?
|
24
|
-
|
34
|
+
_r, _w, e = IO.select([client], nil, [client], nil)
|
25
35
|
break if !e.empty?
|
26
36
|
|
27
37
|
if data = client.read(65536)
|
28
38
|
client.close
|
29
39
|
item = Marshal.load(data)
|
30
40
|
break if item.nil? || item.empty?
|
31
|
-
|
41
|
+
if item == "WAIT"
|
42
|
+
$0 = "#{@procline} - Waiting for work"
|
43
|
+
sleep 0.1
|
44
|
+
next
|
45
|
+
end
|
46
|
+
suite_name, path = item
|
47
|
+
suite = load_suite(suite_name, path)
|
48
|
+
|
49
|
+
# Maybe we were told to load a suite that doesn't exist anymore.
|
50
|
+
next unless suite
|
32
51
|
|
33
52
|
$0 = "#{@procline} - #{suite.respond_to?(:description) ? suite.description : suite}"
|
34
53
|
start = Time.now
|
@@ -37,7 +56,8 @@ module TestQueue
|
|
37
56
|
else
|
38
57
|
yield suite
|
39
58
|
end
|
40
|
-
@
|
59
|
+
@suite_stats << TestQueue::Stats::Suite.new(suite_name, path, Time.now - start, Time.now)
|
60
|
+
@failures += suite.failure_count if suite.respond_to? :failure_count
|
41
61
|
else
|
42
62
|
break
|
43
63
|
end
|
@@ -45,8 +65,8 @@ module TestQueue
|
|
45
65
|
rescue Errno::ENOENT, Errno::ECONNRESET, Errno::ECONNREFUSED
|
46
66
|
ensure
|
47
67
|
@done = caller.first
|
48
|
-
File.open("/tmp/test_queue_worker_#{$$}
|
49
|
-
|
68
|
+
File.open("/tmp/test_queue_worker_#{$$}_suites", "wb") do |f|
|
69
|
+
Marshal.dump(@suite_stats, f)
|
50
70
|
end
|
51
71
|
end
|
52
72
|
|
@@ -68,5 +88,16 @@ module TestQueue
|
|
68
88
|
def empty?
|
69
89
|
false
|
70
90
|
end
|
91
|
+
|
92
|
+
def load_suite(suite_name, path)
|
93
|
+
@loaded_suites ||= {}
|
94
|
+
suite = @loaded_suites[suite_name]
|
95
|
+
return suite if suite
|
96
|
+
|
97
|
+
@test_framework.suites_from_file(path).each do |name, suite|
|
98
|
+
@loaded_suites[name] = suite
|
99
|
+
end
|
100
|
+
@loaded_suites[suite_name]
|
101
|
+
end
|
71
102
|
end
|
72
103
|
end
|