parallel_tests 3.13.0 → 4.1.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 +2 -2
- data/lib/parallel_tests/cli.rb +3 -4
- data/lib/parallel_tests/test/runner.rb +9 -4
- data/lib/parallel_tests/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b91b9c7df92f61cb86647c6de3553e21b0f9119081969d1e1689fb6466e0e4b
|
4
|
+
data.tar.gz: 970e0840ca122f4d1a5c7db0a03aa58d253afbe5a38a42b55d5224cd77feea4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f510fb8f38ba485412aaa65bfab46f1696a91f9ef8d28499da128c598de0aa2ff1542c55c333d9e694c275f06b4eebfbcc770e0e54ea2266b15ceb504881bb59
|
7
|
+
data.tar.gz: 82db6c31fffe3f8faa40e20808e2e6fbd7834d6ad29500f0abf5c58e6aaf1515bb7e358b11f53eef6d1c01f3f541373964721c1c30d66fdb1f2b46a9e5d2f44c
|
data/Readme.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# parallel_tests
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/parallel_tests)
|
4
|
-
[](https://github.com/grosser/parallel_tests/actions?query=workflow%3Awindows)
|
4
|
+
[](https://github.com/grosser/parallel_tests/actions?query=workflow%3Atest)
|
6
5
|
|
7
6
|
Speedup Test::Unit + RSpec + Cucumber + Spinach by running parallel on multiple CPU cores.<br/>
|
8
7
|
ParallelTests splits tests into even groups (by number of lines or runtime) and runs each group in a single process with its own database.
|
@@ -404,6 +403,7 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
|
|
404
403
|
- [Zach Dennis](https://github.com/zdennis)
|
405
404
|
- [Jon Dufresne](https://github.com/jdufresne)
|
406
405
|
- [Eric Kessler](https://github.com/enkessler)
|
406
|
+
- [Adis Osmonov](https://github.com/adis-io)
|
407
407
|
|
408
408
|
[Michael Grosser](http://grosser.it)<br/>
|
409
409
|
michael@grosser.it<br/>
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -131,12 +131,12 @@ module ParallelTests
|
|
131
131
|
failing_sets = test_results.reject { |r| r[:exit_status] == 0 }
|
132
132
|
return if failing_sets.none?
|
133
133
|
|
134
|
-
if options[:verbose] || options[:
|
134
|
+
if options[:verbose] || options[:verbose_command]
|
135
135
|
puts "\n\nTests have failed for a parallel_test group. Use the following command to run the group again:\n\n"
|
136
136
|
failing_sets.each do |failing_set|
|
137
137
|
command = failing_set[:command]
|
138
138
|
command = @runner.command_with_seed(command, failing_set[:seed]) if failing_set[:seed]
|
139
|
-
|
139
|
+
@runner.print_command(command, failing_set[:env] || {})
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
@@ -261,8 +261,7 @@ module ParallelTests
|
|
261
261
|
opts.on("--first-is-1", "Use \"1\" as TEST_ENV_NUMBER to not reuse the default test environment") { options[:first_is_1] = true }
|
262
262
|
opts.on("--fail-fast", "Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported") { options[:fail_fast] = true }
|
263
263
|
opts.on("--verbose", "Print debug output") { options[:verbose] = true }
|
264
|
-
opts.on("--verbose-
|
265
|
-
opts.on("--verbose-rerun-command", "When there are failures, displays the command executed by each process that failed") { options[:verbose_rerun_command] = true }
|
264
|
+
opts.on("--verbose-command", "Displays the command that will be executed by each process and when there are failures displays the command executed by each process that failed") { options[:verbose_command] = true }
|
266
265
|
opts.on("--quiet", "Print only tests output") { options[:quiet] = true }
|
267
266
|
opts.on("-v", "--version", "Show Version") do
|
268
267
|
puts ParallelTests::VERSION
|
@@ -97,15 +97,20 @@ module ParallelTests
|
|
97
97
|
# being able to run with for example `-output foo-$TEST_ENV_NUMBER` worked originally and is convenient
|
98
98
|
cmd.map! { |c| c.gsub("$TEST_ENV_NUMBER", number).gsub("${TEST_ENV_NUMBER}", number) }
|
99
99
|
|
100
|
-
|
100
|
+
print_command(cmd, env) if report_process_command?(options) && !options[:serialize_stdout]
|
101
101
|
|
102
102
|
execute_command_and_capture_output(env, cmd, options)
|
103
103
|
end
|
104
104
|
|
105
|
+
def print_command(command, env)
|
106
|
+
env_str = ['TEST_ENV_NUMBER', 'PARALLEL_TEST_GROUPS'].map { |e| "#{e}=#{env[e]}" }.join(' ')
|
107
|
+
puts [env_str, Shellwords.shelljoin(command)].compact.join(' ')
|
108
|
+
end
|
109
|
+
|
105
110
|
def execute_command_and_capture_output(env, cmd, options)
|
106
111
|
pid = nil
|
107
112
|
|
108
|
-
popen_options = {}
|
113
|
+
popen_options = { pgroup: true }
|
109
114
|
popen_options[:err] = [:child, :out] if options[:combine_stderr]
|
110
115
|
|
111
116
|
output = IO.popen(env, cmd, popen_options) do |io|
|
@@ -119,7 +124,7 @@ module ParallelTests
|
|
119
124
|
|
120
125
|
output = "#{Shellwords.shelljoin(cmd)}\n#{output}" if report_process_command?(options) && options[:serialize_stdout]
|
121
126
|
|
122
|
-
{ stdout: output, exit_status: exitstatus, command: cmd, seed: seed }
|
127
|
+
{ env: env, stdout: output, exit_status: exitstatus, command: cmd, seed: seed }
|
123
128
|
end
|
124
129
|
|
125
130
|
def find_results(test_output)
|
@@ -286,7 +291,7 @@ module ParallelTests
|
|
286
291
|
end
|
287
292
|
|
288
293
|
def report_process_command?(options)
|
289
|
-
options[:verbose] || options[:
|
294
|
+
options[:verbose] || options[:verbose_command]
|
290
295
|
end
|
291
296
|
end
|
292
297
|
end
|
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:
|
4
|
+
version: 4.1.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:
|
11
|
+
date: 2023-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -68,8 +68,8 @@ licenses:
|
|
68
68
|
- MIT
|
69
69
|
metadata:
|
70
70
|
bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
|
71
|
-
documentation_uri: https://github.com/grosser/parallel_tests/blob/
|
72
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/
|
71
|
+
documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.1.0/Readme.md
|
72
|
+
source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.1.0
|
73
73
|
wiki_uri: https://github.com/grosser/parallel_tests/wiki
|
74
74
|
post_install_message:
|
75
75
|
rdoc_options: []
|
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
82
|
+
version: 2.7.0
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - ">="
|