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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_split_test (0.1.4)
4
+ parallel_split_test (0.1.5)
5
5
  parallel (>= 0.5.13)
6
6
  rspec (>= 2)
7
7
 
data/Readme.md CHANGED
@@ -59,7 +59,6 @@ TIPS
59
59
 
60
60
  TODO
61
61
  ====
62
- - combine exit status (1 + 0 == 1)
63
62
  - re-print summary of all test results
64
63
  - Cucumber support
65
64
  - Test::Unit support
@@ -23,4 +23,4 @@ if ARGV.empty?
23
23
  end
24
24
 
25
25
  require 'parallel_split_test/runner'
26
- ParallelSplitTest::Runner.run(ARGV)
26
+ exit ParallelSplitTest::Runner.run(ARGV).max
@@ -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)}.all? ? 0 : @configuration.failure_exit_code
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
@@ -6,6 +6,8 @@ RSpec::Core::Example.class_eval do
6
6
  def run(*args, &block)
7
7
  if ParallelSplitTest.run_example?
8
8
  run_without_parallel_split_test(*args, &block)
9
+ else
10
+ true # example 'passed'
9
11
  end
10
12
  end
11
13
  end
@@ -1,3 +1,3 @@
1
1
  module ParallelSplitTest
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  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
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-02 00:00:00.000000000 Z
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: &78874300 !ruby/object:Gem::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: *78874300
24
+ version_requirements: *85485570
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: parallel
27
- requirement: &78874050 !ruby/object:Gem::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: *78874050
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: -660068355
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: -660068355
81
+ hash: -731152051
82
82
  requirements: []
83
83
  rubyforge_project:
84
84
  rubygems_version: 1.8.10