parallel_tests 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel_tests/cli.rb +15 -4
- data/lib/parallel_tests/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8126226af76d2ce93824461837f808b5e098af09
|
4
|
+
data.tar.gz: 802444bf82a369e183f8aa0b8e5c4c788f659d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec9c6cedfd0c129d4556fd6a44ffeea0d083bc7d1f8dbbdc5e3577b4a0a035bffc33ed7d9df80e3f9284458b590e7dc9e53f10f3ebf5535bf5209e68081cd241
|
7
|
+
data.tar.gz: 81e5fa727c44da60db4b81e8ca1ce056a7567625b996351860d7110e2ffb726aa894014be93c170b51e4a1b5adf5d30bfb1a1025b4c1d85296348d671cafcd86
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -23,7 +23,7 @@ module ParallelTests
|
|
23
23
|
Tempfile.open 'parallel_tests-lock' do |lock|
|
24
24
|
return Parallel.map(items, :in_threads => num_processes) do |item|
|
25
25
|
result = yield(item)
|
26
|
-
|
26
|
+
reprint_output(result, lock.path) if options[:serialize_stdout]
|
27
27
|
result
|
28
28
|
end
|
29
29
|
end
|
@@ -63,14 +63,25 @@ module ParallelTests
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
67
|
-
|
68
|
-
open_lock.flock File::LOCK_EX
|
66
|
+
def reprint_output(result, lockfile)
|
67
|
+
lock(lockfile) do
|
69
68
|
$stdout.puts result[:stdout]
|
70
69
|
$stdout.flush
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
73
|
+
def lock(lockfile)
|
74
|
+
File.open(lockfile) do |lock|
|
75
|
+
begin
|
76
|
+
lock.flock File::LOCK_EX
|
77
|
+
yield
|
78
|
+
ensure
|
79
|
+
# This shouldn't be necessary, but appears to be
|
80
|
+
lock.flock File::LOCK_UN
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
74
85
|
def report_results(test_results)
|
75
86
|
results = @runner.find_results(test_results.map { |result| result[:stdout] }*"")
|
76
87
|
puts ""
|
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: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|