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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01b6de7a12281670eb21d414bac185726fab522f49a17260cfc6e18e0b120c2b
4
- data.tar.gz: 8eafb297389404e96a76cf62ef574b785879d530d0b8d771b8d983e8c5f808cf
3
+ metadata.gz: 2c0d037eea7b592064d9d2007adcce250232de16622be3c2f9f256f15c03a1c1
4
+ data.tar.gz: e8a767ea7925b219c963109e7411f07280a21a811d8e0e8c1a5508586653477c
5
5
  SHA512:
6
- metadata.gz: c7e98692653ffb21768c0972e54f804d82da4f8ef4c28e057452162531a9267dbef169a4506d30ccf44ac87a7f97adf067a0c499a3449335556c05b08f442968
7
- data.tar.gz: aa6d92c2345e5ceebc01605717364670045124459550f90dfb0f9225bd20925f8955641e7e43888e3bd4dee57733e71fe68b0868a23574f458aebfc88e58e557
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, appart from test output
227
+ --quiet Do not print anything, apart from test output
228
228
  -v, --version Show Version
229
229
  -h, --help Show this.
230
230
 
@@ -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
- progress_indicator = simulate_output_for_ci if options[:serialize_stdout]
44
-
45
- Parallel.map(items, :in_threads => num_processes) do |item|
46
- result = yield(item)
47
- if progress_indicator && progress_indicator.alive?
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
- Thread.new do
336
- interval = ENV.fetch('PARALLEL_TEST_HEARTBEAT_INTERVAL', 60).to_f
337
- loop do
338
- sleep interval
339
- print '.'
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
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '2.27.0'
2
+ VERSION = Version = '2.27.1'
3
3
  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.0
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: 2018-11-09 00:00:00.000000000 Z
11
+ date: 2019-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel