parallel_tests 4.1.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +1 -2
- data/lib/parallel_tests/cli.rb +17 -3
- data/lib/parallel_tests/grouper.rb +0 -4
- data/lib/parallel_tests/test/runner.rb +3 -4
- data/lib/parallel_tests/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9044c95c595a48f89a621563c609a4c9fa89d851792ca694a30fcaf947a2119
|
4
|
+
data.tar.gz: 248e38e467b9070c1666819e2c1dc9149b791644b42e8a90cd53df82ebb80eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363e8d317a43d03043a270c19d05f60071bd05a9b435a0545454e81b96d875b694dd4fadc74669ba136990d57d863883132a19ff7fd1c9c4169e2c16a8e2db38
|
7
|
+
data.tar.gz: ef251fa00adf1310c5281ee4985119ce6b4810d121d87a3a4a7f6b6a03aa968ed9be7847eec127e74a118983e4454b181635d1538b1a17b5f242fbb11839caa9
|
data/Readme.md
CHANGED
@@ -249,8 +249,7 @@ Options are:
|
|
249
249
|
--first-is-1 Use "1" as TEST_ENV_NUMBER to not reuse the default test environment
|
250
250
|
--fail-fast Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported
|
251
251
|
--verbose Print debug output
|
252
|
-
--verbose-
|
253
|
-
--verbose-rerun-command When there are failures, displays the command executed by each process that failed
|
252
|
+
--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
|
254
253
|
--quiet Print only tests output
|
255
254
|
-v, --version Show Version
|
256
255
|
-h, --help Show this.
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -32,9 +32,23 @@ module ParallelTests
|
|
32
32
|
@graceful_shutdown_attempted ||= false
|
33
33
|
Kernel.exit if @graceful_shutdown_attempted
|
34
34
|
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
35
|
+
# In a shell, all sub-processes also get an interrupt, so they shut themselves down.
|
36
|
+
# In a background process this does not happen and we need to do it ourselves.
|
37
|
+
# We cannot always send the interrupt since then the sub-processes would get interrupted twice when in foreground
|
38
|
+
# and that messes with interrupt handling.
|
39
|
+
#
|
40
|
+
# (can simulate detached with `(bundle exec parallel_rspec test/a_spec.rb -n 2 &)`)
|
41
|
+
# also the integration test "passes on int signal to child processes" is detached.
|
42
|
+
#
|
43
|
+
# On windows getpgid does not work so we resort to always killing which is the smaller bug.
|
44
|
+
#
|
45
|
+
# The ParallelTests::Pids `synchronize` method can't be called directly from a trap,
|
46
|
+
# using Thread workaround https://github.com/ddollar/foreman/issues/332
|
47
|
+
Thread.new do
|
48
|
+
if Gem.win_platform? || ((child_pid = ParallelTests.pids.all.first) && Process.getpgid(child_pid) != Process.pid)
|
49
|
+
ParallelTests.stop_all_processes
|
50
|
+
end
|
51
|
+
end
|
38
52
|
|
39
53
|
@graceful_shutdown_attempted = true
|
40
54
|
end
|
@@ -26,10 +26,6 @@ module ParallelTests
|
|
26
26
|
|
27
27
|
isolate_count = isolate_count(options)
|
28
28
|
|
29
|
-
if isolate_count >= num_groups
|
30
|
-
raise 'Number of isolated processes must be less than total the number of processes'
|
31
|
-
end
|
32
|
-
|
33
29
|
if isolate_count >= num_groups
|
34
30
|
raise 'Number of isolated processes must be >= total number of processes'
|
35
31
|
end
|
@@ -95,7 +95,7 @@ module ParallelTests
|
|
95
95
|
cmd = ["nice", *cmd] if options[:nice]
|
96
96
|
|
97
97
|
# being able to run with for example `-output foo-$TEST_ENV_NUMBER` worked originally and is convenient
|
98
|
-
cmd.map
|
98
|
+
cmd = 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
|
|
@@ -108,11 +108,10 @@ module ParallelTests
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def execute_command_and_capture_output(env, cmd, options)
|
111
|
-
|
112
|
-
|
113
|
-
popen_options = { pgroup: true }
|
111
|
+
popen_options = {} # do not add `pgroup: true`, it will break `binding.irb` inside the test
|
114
112
|
popen_options[:err] = [:child, :out] if options[:combine_stderr]
|
115
113
|
|
114
|
+
pid = nil
|
116
115
|
output = IO.popen(env, cmd, popen_options) do |io|
|
117
116
|
pid = io.pid
|
118
117
|
ParallelTests.pids.add(pid)
|
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.1
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-12 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/v4.1
|
72
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.1
|
71
|
+
documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.2.1/Readme.md
|
72
|
+
source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.2.1
|
73
73
|
wiki_uri: https://github.com/grosser/parallel_tests/wiki
|
74
74
|
post_install_message:
|
75
75
|
rdoc_options: []
|