rails_parallel 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/rails_parallel/rake.rb
CHANGED
@@ -6,6 +6,21 @@ require 'rails_parallel/schema'
|
|
6
6
|
|
7
7
|
module RailsParallel
|
8
8
|
class Rake
|
9
|
+
class UnexpectedResponse < StandardError
|
10
|
+
attr_reader :expected, :received
|
11
|
+
|
12
|
+
def initialize(expected, received)
|
13
|
+
@expected = expected
|
14
|
+
@received = received
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_s
|
18
|
+
"Expected #{@expected}, got #{received}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class SuiteFailure < StandardError; end
|
23
|
+
|
9
24
|
include Singleton
|
10
25
|
|
11
26
|
SCHEMA_DIR = 'tmp/rails_parallel/schema'
|
@@ -57,7 +72,13 @@ module RailsParallel
|
|
57
72
|
:options => options,
|
58
73
|
:files => files.to_a
|
59
74
|
}
|
60
|
-
|
75
|
+
|
76
|
+
begin
|
77
|
+
expect(:success)
|
78
|
+
rescue UnexpectedResponse => e
|
79
|
+
raise SuiteFailure.new("Test suite '#{name}' failed") if e.received == :failure
|
80
|
+
raise e
|
81
|
+
end
|
61
82
|
end
|
62
83
|
|
63
84
|
def shutdown
|
@@ -77,7 +98,7 @@ module RailsParallel
|
|
77
98
|
|
78
99
|
def expect(want)
|
79
100
|
got = @socket.next_object
|
80
|
-
raise
|
101
|
+
raise UnexpectedResponse.new(want, got) unless want == got
|
81
102
|
end
|
82
103
|
|
83
104
|
def parse_options(ruby_opts)
|
@@ -17,8 +17,8 @@ module RailsParallel
|
|
17
17
|
@socket << :ready
|
18
18
|
@socket.each_object do |obj|
|
19
19
|
break if obj == :shutdown
|
20
|
-
run_suite(obj)
|
21
|
-
@socket << :
|
20
|
+
@socket << run_suite(obj) ? :success : :failure
|
21
|
+
@socket << :ready
|
22
22
|
end
|
23
23
|
rescue EOFError
|
24
24
|
# shutdown
|
@@ -58,7 +58,9 @@ module RailsParallel
|
|
58
58
|
output_result(Time.now - start)
|
59
59
|
end
|
60
60
|
end
|
61
|
+
|
61
62
|
wait_for(pid)
|
63
|
+
@faults.empty?
|
62
64
|
end
|
63
65
|
|
64
66
|
private
|
@@ -137,6 +139,7 @@ module RailsParallel
|
|
137
139
|
while pid = wait_any(true)
|
138
140
|
child = @by_pid[pid]
|
139
141
|
close_child(child) if child
|
142
|
+
break if @children.empty?
|
140
143
|
end
|
141
144
|
end
|
142
145
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Adrian Irving-Beer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-10 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|