hydra 0.23.1 → 0.23.2
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.
- data/VERSION +1 -1
- data/hydra.gemspec +6 -4
- data/lib/hydra/runner.rb +12 -1
- data/test/fixtures/conflicting.rb +10 -0
- data/test/master_test.rb +29 -0
- data/test/test_helper.rb +4 -0
- metadata +19 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.23.
|
|
1
|
+
0.23.2
|
data/hydra.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{hydra}
|
|
8
|
-
s.version = "0.23.
|
|
8
|
+
s.version = "0.23.2"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Nick Gauthier"]
|
|
12
|
-
s.date = %q{2010-
|
|
12
|
+
s.date = %q{2010-11-03}
|
|
13
13
|
s.default_executable = %q{warmsnake.rb}
|
|
14
14
|
s.description = %q{Spread your tests over multiple machines to test your code faster.}
|
|
15
15
|
s.email = %q{nick@smartlogicsolutions.com}
|
|
@@ -61,6 +61,7 @@ Gem::Specification.new do |s|
|
|
|
61
61
|
"lib/hydra/worker.rb",
|
|
62
62
|
"test/fixtures/assert_true.rb",
|
|
63
63
|
"test/fixtures/config.yml",
|
|
64
|
+
"test/fixtures/conflicting.rb",
|
|
64
65
|
"test/fixtures/features/step_definitions.rb",
|
|
65
66
|
"test/fixtures/features/write_alternate_file.feature",
|
|
66
67
|
"test/fixtures/features/write_file.feature",
|
|
@@ -85,7 +86,7 @@ Gem::Specification.new do |s|
|
|
|
85
86
|
s.homepage = %q{http://github.com/ngauthier/hydra}
|
|
86
87
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
87
88
|
s.require_paths = ["lib"]
|
|
88
|
-
s.rubygems_version = %q{1.3.
|
|
89
|
+
s.rubygems_version = %q{1.3.7}
|
|
89
90
|
s.summary = %q{Distributed testing toolkit}
|
|
90
91
|
s.test_files = [
|
|
91
92
|
"test/pipe_test.rb",
|
|
@@ -98,6 +99,7 @@ Gem::Specification.new do |s|
|
|
|
98
99
|
"test/fixtures/assert_true.rb",
|
|
99
100
|
"test/fixtures/slow.rb",
|
|
100
101
|
"test/fixtures/write_file_spec.rb",
|
|
102
|
+
"test/fixtures/conflicting.rb",
|
|
101
103
|
"test/fixtures/write_file_with_pending_spec.rb",
|
|
102
104
|
"test/fixtures/write_file.rb",
|
|
103
105
|
"test/message_test.rb",
|
|
@@ -111,7 +113,7 @@ Gem::Specification.new do |s|
|
|
|
111
113
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
112
114
|
s.specification_version = 3
|
|
113
115
|
|
|
114
|
-
if Gem::Version.new(Gem::
|
|
116
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
115
117
|
s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
|
|
116
118
|
s.add_development_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
|
|
117
119
|
s.add_development_dependency(%q<cucumber>, ["= 0.9.2"])
|
data/lib/hydra/runner.rb
CHANGED
|
@@ -79,6 +79,14 @@ module Hydra #:nodoc:
|
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
def format_ex_in_file(file, ex)
|
|
83
|
+
"Error in #{file}:\n #{format_exception(ex)}"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def format_exception(ex)
|
|
87
|
+
"#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"
|
|
88
|
+
end
|
|
89
|
+
|
|
82
90
|
# Run all the Test::Unit Suites in a ruby file
|
|
83
91
|
def run_test_unit_file(file)
|
|
84
92
|
begin
|
|
@@ -86,6 +94,9 @@ module Hydra #:nodoc:
|
|
|
86
94
|
rescue LoadError => ex
|
|
87
95
|
trace "#{file} does not exist [#{ex.to_s}]"
|
|
88
96
|
return ex.to_s
|
|
97
|
+
rescue Exception => ex
|
|
98
|
+
trace "Error requiring #{file} [#{ex.to_s}]"
|
|
99
|
+
return format_ex_in_file(file, ex)
|
|
89
100
|
end
|
|
90
101
|
output = []
|
|
91
102
|
@result = Test::Unit::TestResult.new
|
|
@@ -97,7 +108,7 @@ module Hydra #:nodoc:
|
|
|
97
108
|
begin
|
|
98
109
|
klasses.each{|klass| klass.suite.run(@result){|status, name| ;}}
|
|
99
110
|
rescue => ex
|
|
100
|
-
output << ex
|
|
111
|
+
output << format_ex_in_file(file, ex)
|
|
101
112
|
end
|
|
102
113
|
|
|
103
114
|
return output.join("\n")
|
data/test/master_test.rb
CHANGED
|
@@ -20,6 +20,35 @@ class MasterTest < Test::Unit::TestCase
|
|
|
20
20
|
assert_equal "HYDRA", File.read(target_file)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
# this test simulates what happens when we have 2 tests with the same
|
|
24
|
+
# class name but with different parent classes. This can happen when
|
|
25
|
+
# we have a functional and an integration test class with the same name.
|
|
26
|
+
should "run even with a test that will not require" do
|
|
27
|
+
class FileOutputListener < Hydra::Listener::Abstract
|
|
28
|
+
attr_accessor :output
|
|
29
|
+
def initialize(&block)
|
|
30
|
+
self.output = {}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def file_end(file, output)
|
|
34
|
+
self.output[file] = output
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
listener = FileOutputListener.new
|
|
39
|
+
sync_test = File.join(File.dirname(__FILE__), 'fixtures', 'sync_test.rb')
|
|
40
|
+
Hydra::Master.new(
|
|
41
|
+
# we want the actual test to run last to make sure the runner can still run tests
|
|
42
|
+
:files => [sync_test, conflicting_test_file, test_file],
|
|
43
|
+
:autosort => false,
|
|
44
|
+
:listeners => [listener]
|
|
45
|
+
)
|
|
46
|
+
assert_match /superclass mismatch for class SyncTest/, listener.output[conflicting_test_file]
|
|
47
|
+
assert_match conflicting_test_file, listener.output[conflicting_test_file]
|
|
48
|
+
assert File.exists?(target_file)
|
|
49
|
+
assert_equal "HYDRA", File.read(target_file)
|
|
50
|
+
end
|
|
51
|
+
|
|
23
52
|
should "run a spec with pending examples" do
|
|
24
53
|
progress_bar = Hydra::Listener::ProgressBar.new(StringIO.new)
|
|
25
54
|
Hydra::Master.new(
|
data/test/test_helper.rb
CHANGED
|
@@ -50,6 +50,10 @@ class Test::Unit::TestCase
|
|
|
50
50
|
def json_file
|
|
51
51
|
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'json_data.json'))
|
|
52
52
|
end
|
|
53
|
+
|
|
54
|
+
def conflicting_test_file
|
|
55
|
+
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'conflicting.rb'))
|
|
56
|
+
end
|
|
53
57
|
end
|
|
54
58
|
|
|
55
59
|
module Hydra #:nodoc:
|
metadata
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hydra
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 71
|
|
4
5
|
prerelease: false
|
|
5
6
|
segments:
|
|
6
7
|
- 0
|
|
7
8
|
- 23
|
|
8
|
-
-
|
|
9
|
-
version: 0.23.
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.23.2
|
|
10
11
|
platform: ruby
|
|
11
12
|
authors:
|
|
12
13
|
- Nick Gauthier
|
|
@@ -14,16 +15,18 @@ autorequire:
|
|
|
14
15
|
bindir: bin
|
|
15
16
|
cert_chain: []
|
|
16
17
|
|
|
17
|
-
date: 2010-
|
|
18
|
+
date: 2010-11-03 00:00:00 -04:00
|
|
18
19
|
default_executable: warmsnake.rb
|
|
19
20
|
dependencies:
|
|
20
21
|
- !ruby/object:Gem::Dependency
|
|
21
22
|
name: shoulda
|
|
22
23
|
prerelease: false
|
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
24
26
|
requirements:
|
|
25
27
|
- - "="
|
|
26
28
|
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 33
|
|
27
30
|
segments:
|
|
28
31
|
- 2
|
|
29
32
|
- 10
|
|
@@ -35,9 +38,11 @@ dependencies:
|
|
|
35
38
|
name: rspec
|
|
36
39
|
prerelease: false
|
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
38
42
|
requirements:
|
|
39
43
|
- - "="
|
|
40
44
|
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 62196421
|
|
41
46
|
segments:
|
|
42
47
|
- 2
|
|
43
48
|
- 0
|
|
@@ -51,9 +56,11 @@ dependencies:
|
|
|
51
56
|
name: cucumber
|
|
52
57
|
prerelease: false
|
|
53
58
|
requirement: &id003 !ruby/object:Gem::Requirement
|
|
59
|
+
none: false
|
|
54
60
|
requirements:
|
|
55
61
|
- - "="
|
|
56
62
|
- !ruby/object:Gem::Version
|
|
63
|
+
hash: 63
|
|
57
64
|
segments:
|
|
58
65
|
- 0
|
|
59
66
|
- 9
|
|
@@ -65,9 +72,11 @@ dependencies:
|
|
|
65
72
|
name: therubyracer
|
|
66
73
|
prerelease: false
|
|
67
74
|
requirement: &id004 !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
68
76
|
requirements:
|
|
69
77
|
- - "="
|
|
70
78
|
- !ruby/object:Gem::Version
|
|
79
|
+
hash: 11
|
|
71
80
|
segments:
|
|
72
81
|
- 0
|
|
73
82
|
- 7
|
|
@@ -127,6 +136,7 @@ files:
|
|
|
127
136
|
- lib/hydra/worker.rb
|
|
128
137
|
- test/fixtures/assert_true.rb
|
|
129
138
|
- test/fixtures/config.yml
|
|
139
|
+
- test/fixtures/conflicting.rb
|
|
130
140
|
- test/fixtures/features/step_definitions.rb
|
|
131
141
|
- test/fixtures/features/write_alternate_file.feature
|
|
132
142
|
- test/fixtures/features/write_file.feature
|
|
@@ -157,23 +167,27 @@ rdoc_options:
|
|
|
157
167
|
require_paths:
|
|
158
168
|
- lib
|
|
159
169
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
|
+
none: false
|
|
160
171
|
requirements:
|
|
161
172
|
- - ">="
|
|
162
173
|
- !ruby/object:Gem::Version
|
|
174
|
+
hash: 3
|
|
163
175
|
segments:
|
|
164
176
|
- 0
|
|
165
177
|
version: "0"
|
|
166
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
|
+
none: false
|
|
167
180
|
requirements:
|
|
168
181
|
- - ">="
|
|
169
182
|
- !ruby/object:Gem::Version
|
|
183
|
+
hash: 3
|
|
170
184
|
segments:
|
|
171
185
|
- 0
|
|
172
186
|
version: "0"
|
|
173
187
|
requirements: []
|
|
174
188
|
|
|
175
189
|
rubyforge_project:
|
|
176
|
-
rubygems_version: 1.3.
|
|
190
|
+
rubygems_version: 1.3.7
|
|
177
191
|
signing_key:
|
|
178
192
|
specification_version: 3
|
|
179
193
|
summary: Distributed testing toolkit
|
|
@@ -188,6 +202,7 @@ test_files:
|
|
|
188
202
|
- test/fixtures/assert_true.rb
|
|
189
203
|
- test/fixtures/slow.rb
|
|
190
204
|
- test/fixtures/write_file_spec.rb
|
|
205
|
+
- test/fixtures/conflicting.rb
|
|
191
206
|
- test/fixtures/write_file_with_pending_spec.rb
|
|
192
207
|
- test/fixtures/write_file.rb
|
|
193
208
|
- test/message_test.rb
|