parallel_split_test 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
data/bin/parallel_split_test
CHANGED
@@ -28,7 +28,8 @@ module ParallelSplitTest
|
|
28
28
|
begin
|
29
29
|
@configuration.run_hook(:before, :suite)
|
30
30
|
groups = @world.example_groups.ordered
|
31
|
-
groups.map {|g| g.run(reporter)}
|
31
|
+
results = groups.map {|g| g.run(reporter)}
|
32
|
+
results.all? ? 0 : @configuration.failure_exit_code
|
32
33
|
ensure
|
33
34
|
@configuration.run_hook(:after, :suite)
|
34
35
|
end
|
@@ -43,8 +43,8 @@ describe ParallelSplitTest do
|
|
43
43
|
path
|
44
44
|
end
|
45
45
|
|
46
|
-
def parallel_split_test(x)
|
47
|
-
run "PARALLEL_SPLIT_TEST_PROCESSES=2 ../../bin/parallel_split_test #{x}"
|
46
|
+
def parallel_split_test(x, options={})
|
47
|
+
run "PARALLEL_SPLIT_TEST_PROCESSES=2 ../../bin/parallel_split_test #{x}", options
|
48
48
|
end
|
49
49
|
|
50
50
|
def time
|
@@ -142,6 +142,42 @@ describe ParallelSplitTest do
|
|
142
142
|
result = parallel_split_test "xxx_spec.rb"
|
143
143
|
result.scan(/ENV_IS_.?_/).sort.should == ["ENV_IS_2_", "ENV_IS__"]
|
144
144
|
end
|
145
|
+
|
146
|
+
it "fails when one of the processes fail" do
|
147
|
+
write "xxx_spec.rb", <<-RUBY
|
148
|
+
describe "X" do
|
149
|
+
it { sleep 0.1; raise }
|
150
|
+
it { sleep 0.1 }
|
151
|
+
end
|
152
|
+
RUBY
|
153
|
+
|
154
|
+
# test works because if :fail => true does not fail it raises
|
155
|
+
result = parallel_split_test "xxx_spec.rb", :fail => true
|
156
|
+
result.should include('1 example, 1 failure')
|
157
|
+
result.should include('1 example, 0 failures')
|
158
|
+
end
|
159
|
+
|
160
|
+
it "fails when all processes fail" do
|
161
|
+
write "xxx_spec.rb", <<-RUBY
|
162
|
+
describe "X" do
|
163
|
+
it { sleep 0.1; raise }
|
164
|
+
it { sleep 0.1; raise }
|
165
|
+
end
|
166
|
+
RUBY
|
167
|
+
|
168
|
+
# test works because if :fail => true does not fail it raises
|
169
|
+
result = parallel_split_test "xxx_spec.rb", :fail => true
|
170
|
+
result.scan('1 example, 1 failure').size.should == 2
|
171
|
+
end
|
172
|
+
|
173
|
+
it "passes when no tests where run" do
|
174
|
+
write "xxx_spec.rb", <<-RUBY
|
175
|
+
describe "X" do
|
176
|
+
end
|
177
|
+
RUBY
|
178
|
+
result = parallel_split_test "xxx_spec.rb"
|
179
|
+
result.should include('No examples found')
|
180
|
+
end
|
145
181
|
end
|
146
182
|
end
|
147
183
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_split_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &85485570 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *85485570
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: parallel
|
27
|
-
requirement: &
|
27
|
+
requirement: &85485320 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.5.13
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *85485320
|
36
36
|
description:
|
37
37
|
email: michael@grosser.it
|
38
38
|
executables:
|
@@ -69,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
segments:
|
71
71
|
- 0
|
72
|
-
hash: -
|
72
|
+
hash: -731152051
|
73
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
segments:
|
80
80
|
- 0
|
81
|
-
hash: -
|
81
|
+
hash: -731152051
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
84
|
rubygems_version: 1.8.10
|