parallel_tests 2.27.0 → 2.27.1
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 -1
- data/lib/parallel_tests/cli.rb +19 -15
- data/lib/parallel_tests/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c0d037eea7b592064d9d2007adcce250232de16622be3c2f9f256f15c03a1c1
|
4
|
+
data.tar.gz: e8a767ea7925b219c963109e7411f07280a21a811d8e0e8c1a5508586653477c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c79393d94206facc0d7dcb3a4cc9c6a75dcde52a4fc43848340b86f3d0329fe32f08f858e5de663f20a6fff2f78c68245924d812923a075e7222ae61e11dca6c
|
7
|
+
data.tar.gz: 408023256ca77f083d14e8c9c8d88468604b92cbe74bddc64af1597676160afd9dbab68d33e49a9f1638f774f55273f0d78335350eb75517e6797e3e48a1f884
|
data/Readme.md
CHANGED
@@ -224,7 +224,7 @@ Options are:
|
|
224
224
|
--allowed-missing Allowed percentage of missing runtimes (default = 50)
|
225
225
|
--unknown-runtime [FLOAT] Use given number as unknown runtime (otherwise use average time)
|
226
226
|
--verbose Print more output
|
227
|
-
--quiet Do not print anything,
|
227
|
+
--quiet Do not print anything, apart from test output
|
228
228
|
-v, --version Show Version
|
229
229
|
-h, --help Show this.
|
230
230
|
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -40,16 +40,12 @@ module ParallelTests
|
|
40
40
|
def execute_in_parallel(items, num_processes, options)
|
41
41
|
Tempfile.open 'parallel_tests-lock' do |lock|
|
42
42
|
ParallelTests.with_pid_file do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
progress_indicator.exit
|
49
|
-
puts
|
43
|
+
simulate_output_for_ci options[:serialize_stdout] do
|
44
|
+
Parallel.map(items, :in_threads => num_processes) do |item|
|
45
|
+
result = yield(item)
|
46
|
+
reprint_output(result, lock.path) if options[:serialize_stdout]
|
47
|
+
result
|
50
48
|
end
|
51
|
-
reprint_output(result, lock.path) if options[:serialize_stdout]
|
52
|
-
result
|
53
49
|
end
|
54
50
|
end
|
55
51
|
end
|
@@ -98,6 +94,7 @@ module ParallelTests
|
|
98
94
|
|
99
95
|
def reprint_output(result, lockfile)
|
100
96
|
lock(lockfile) do
|
97
|
+
$stdout.puts
|
101
98
|
$stdout.puts result[:stdout]
|
102
99
|
$stdout.flush
|
103
100
|
end
|
@@ -331,13 +328,20 @@ module ParallelTests
|
|
331
328
|
end
|
332
329
|
|
333
330
|
# CI systems often fail when there is no output for a long time, so simulate some output
|
334
|
-
def simulate_output_for_ci
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
331
|
+
def simulate_output_for_ci(simulate)
|
332
|
+
if simulate
|
333
|
+
progress_indicator = Thread.new do
|
334
|
+
interval = Float(ENV.fetch('PARALLEL_TEST_HEARTBEAT_INTERVAL', 60))
|
335
|
+
loop do
|
336
|
+
sleep interval
|
337
|
+
print '.'
|
338
|
+
end
|
340
339
|
end
|
340
|
+
test_results = yield
|
341
|
+
progress_indicator.exit
|
342
|
+
test_results
|
343
|
+
else
|
344
|
+
yield
|
341
345
|
end
|
342
346
|
end
|
343
347
|
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: 2.27.
|
4
|
+
version: 2.27.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:
|
11
|
+
date: 2019-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|