parallel_tests 1.8.0 → 1.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/Readme.md +1 -0
- data/lib/parallel_tests/cli.rb +15 -1
- data/lib/parallel_tests/cucumber/runner.rb +5 -0
- data/lib/parallel_tests/test/runner.rb +8 -1
- data/lib/parallel_tests/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb10aac687b9a04a4407bfc4fe1e30c5f08ea48
|
4
|
+
data.tar.gz: d931c14e1a5d0a1464ae6d25f5be2d35f104980f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd851e63b561992a2115875ae3155172d2efc7ead6469ee1cc2d9c91360ef3238394615e2d92168592b408a53403edd2a2c6885261d4c66eb57ccea5fcd59063
|
7
|
+
data.tar.gz: 498a0035ed38fa887740a7229ccee841b689027544ac88d4db74c511fb58df4d504a76fe7d4add0414f2476fd5ca0e4eda9fd50b12da327cc38e7fd09988995b
|
data/Readme.md
CHANGED
@@ -325,6 +325,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
325
325
|
- [Ed Slocomb](https://github.com/edslocomb)
|
326
326
|
- [Cezary Baginski](https://github.com/e2)
|
327
327
|
- [Marius Ioana](https://github.com/mariusioana)
|
328
|
+
- [Lukas Oberhuber](https://github.com/lukaso)
|
328
329
|
|
329
330
|
|
330
331
|
[Michael Grosser](http://grosser.it)<br/>
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -59,7 +59,7 @@ module ParallelTests
|
|
59
59
|
|
60
60
|
def run_tests(group, process_number, num_processes, options)
|
61
61
|
if group.empty?
|
62
|
-
{:stdout => '', :exit_status => 0}
|
62
|
+
{:stdout => '', :exit_status => 0, :command => '', :seed => nil}
|
63
63
|
else
|
64
64
|
@runner.run_tests(group, process_number, num_processes, options)
|
65
65
|
end
|
@@ -88,6 +88,20 @@ module ParallelTests
|
|
88
88
|
results = @runner.find_results(test_results.map { |result| result[:stdout] }*"")
|
89
89
|
puts ""
|
90
90
|
puts @runner.summarize_results(results)
|
91
|
+
report_failure_rerun_commmand(test_results)
|
92
|
+
end
|
93
|
+
|
94
|
+
def report_failure_rerun_commmand(test_results)
|
95
|
+
failing_sets = test_results.reject { |r| r[:exit_status] == 0 }
|
96
|
+
return if failing_sets.none?
|
97
|
+
|
98
|
+
puts "\n\nTests have failed for a parallel_test group. Use the following command to run the group again:\n\n"
|
99
|
+
failing_sets.each do |failing_set|
|
100
|
+
command = failing_set[:command]
|
101
|
+
command = command.gsub(/;export [A-Z_]+;/, ' ') # remove ugly export statements
|
102
|
+
command = @runner.command_with_seed(command, failing_set[:seed]) if failing_set[:seed]
|
103
|
+
puts command
|
104
|
+
end
|
91
105
|
end
|
92
106
|
|
93
107
|
def report_number_of_tests(groups)
|
@@ -95,8 +95,9 @@ module ParallelTests
|
|
95
95
|
|
96
96
|
output = open("|#{cmd}", "r") { |output| capture_output(output, silence) }
|
97
97
|
exitstatus = $?.exitstatus
|
98
|
+
seed = output[/seed (\d+)/,1]
|
98
99
|
|
99
|
-
{:stdout => output, :exit_status => exitstatus}
|
100
|
+
{:stdout => output, :exit_status => exitstatus, :command => cmd, :seed => seed}
|
100
101
|
end
|
101
102
|
|
102
103
|
def find_results(test_output)
|
@@ -116,6 +117,12 @@ module ParallelTests
|
|
116
117
|
sums.sort.map{|word, number| "#{number} #{word}#{'s' if number != 1}" }.join(', ')
|
117
118
|
end
|
118
119
|
|
120
|
+
def command_with_seed(cmd, seed)
|
121
|
+
cmd = cmd.sub(/\s--seed(\s\d*){0,1}/, '')
|
122
|
+
cmd = cmd.sub(/\s--order rand(:\d*){0,1}/, '')
|
123
|
+
"#{cmd} --seed #{seed}"
|
124
|
+
end
|
125
|
+
|
119
126
|
protected
|
120
127
|
|
121
128
|
def executable
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|