forking_test_runner 1.5.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forking_test_runner.rb +10 -3
- data/lib/forking_test_runner/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4305afeb107804af380e5b6bcd47f2898f9eab13c278a0ceb7f9f0c38ef43e08
|
4
|
+
data.tar.gz: 0cac2bb33fa7aa9e95773d954f2dd79525afde18820eddc61463f2d4e1f9f00a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e61dd68b3d49db51c47b6c1634fb4868c0ba1da8abe04eef24c89729ea6286a96c1c1c7211270e57e4a3fa945b5be9ed0eb89662d9a1f1fbd7aaea30d0486a2
|
7
|
+
data.tar.gz: 607c539c59aba33a07aa8cee7eafcd079326e9ca7c94cb6fd8e3b70fc2467e5a367a04b6166c3a3d8e86cd73185ef14a9068435d219f0cf77e3779b9b742fd5c
|
data/lib/forking_test_runner.rb
CHANGED
@@ -21,6 +21,7 @@ module ForkingTestRunner
|
|
21
21
|
if parallel && !@options.fetch(:group)
|
22
22
|
Array.new(parallel) { |i| find_tests_for_group(i + 1, parallel, tests, runtime_log) }
|
23
23
|
else
|
24
|
+
raise ArgumentError, "Use the same amount of processors as groups" if parallel && parallel != groups.count
|
24
25
|
groups.map { |group| find_tests_for_group(group, group_count, tests, runtime_log) }
|
25
26
|
end
|
26
27
|
|
@@ -251,8 +252,7 @@ module ForkingTestRunner
|
|
251
252
|
|
252
253
|
child = fork do
|
253
254
|
rpipe.close
|
254
|
-
$stdout.reopen(wpipe)
|
255
|
-
|
255
|
+
preserve_tty { $stdout.reopen(wpipe) }
|
256
256
|
yield
|
257
257
|
end
|
258
258
|
|
@@ -269,6 +269,13 @@ module ForkingTestRunner
|
|
269
269
|
buffer
|
270
270
|
end
|
271
271
|
|
272
|
+
# not tested via CI
|
273
|
+
def preserve_tty
|
274
|
+
was_tty = $stdout.tty?
|
275
|
+
yield
|
276
|
+
def $stdout.tty?; true; end if was_tty
|
277
|
+
end
|
278
|
+
|
272
279
|
def run_test(file)
|
273
280
|
stdout = change_program_name_to file do
|
274
281
|
fork_with_captured_stdout do
|
@@ -340,7 +347,7 @@ module ForkingTestRunner
|
|
340
347
|
|
341
348
|
if value
|
342
349
|
minitest_class.autorun
|
343
|
-
|
350
|
+
load file
|
344
351
|
end
|
345
352
|
end
|
346
353
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forking_test_runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.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: 2020-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel_tests
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.1.3
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Run every test in a fork to avoid pollution and get clean output per test
|