hydra 0.16.0 → 0.16.1

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.
@@ -1,4 +1,4 @@
1
- = Hѱdra
1
+ = Hydra
2
2
 
3
3
  Spread your tests over multiple machines to test your code faster.
4
4
 
@@ -12,42 +12,15 @@ Hydra's goals are to make distributed testing easy. So as long as
12
12
  you can ssh into a computer and run the tests, you can automate
13
13
  the distribution with Hydra.
14
14
 
15
- == Usage
15
+ == Usage and Configuration
16
16
 
17
- In your rakefile:
17
+ Check out the wiki for usage and configuration information:
18
18
 
19
- require 'hydra'
20
- require 'hydra/tasks'
19
+ http://wiki.github.com/ngauthier/hydra/
21
20
 
22
- Hydra::TestTask.new('hydra') do |t|
23
- t.add_files 'test/unit/**/*_test.rb'
24
- t.add_files 'test/functional/**/*_test.rb'
25
- t.add_files 'test/integration/**/*_test.rb'
26
- end
21
+ I've tried hard to keep accurate documentation via RDoc as well:
27
22
 
28
- Run:
29
-
30
- $ rake hydra
31
-
32
- Hydra defaults to Single Core mode, so you may want to configure it
33
- to use two (or more) of your cores if you have a multi-processing machine.
34
-
35
- == Hydra + Cucumber
36
-
37
- Hydra can run cucumber features, but because of cucumber's specialized
38
- environment, cucumber features have to be run after your other tests.
39
-
40
- Hydra::TestTask.new('hydra') do |t|
41
- t.add_files 'test/unit/**/*_test.rb'
42
- t.add_files 'test/functional/**/*_test.rb'
43
- t.add_files 'test/integration/**/*_test.rb'
44
- # cucumber
45
- t.autosort = false
46
- t.add_files 'features/**/*.feature'
47
- end
48
-
49
- Hydra's autosort feature sorts files by their runtime, so we
50
- have to disable it in order to run cucumber features at the end
23
+ http://rdoc.info/projects/ngauthier/hydra
51
24
 
52
25
  == Supported frameworks
53
26
 
@@ -55,146 +28,11 @@ Right now hydra only supports a few frameworks:
55
28
 
56
29
  * Test::Unit
57
30
  * Cucumber
31
+ * RSpec
58
32
 
59
33
  We're working on adding more frameworks, and if you'd like to help, please
60
34
  send me a message and I'll show you where to code!
61
35
 
62
- == Running Remote Tasks
63
-
64
- You can run tasks across all of your remote workers easily with Hydra. In your rake file, add:
65
-
66
- Hydra::RemoteTask.new('db:reset')
67
-
68
- Then you can run:
69
-
70
- rake hydra:remote:db:reset
71
-
72
- == Running Global Tasks
73
-
74
- A Global task is a task run locally *and* remotely. It's used in the same way as RemoteTask:
75
-
76
- Hydra::GlobalTask.new('db:reset')
77
-
78
- But it is invoked in a higher namespace:
79
-
80
- rake hydra:db:reset
81
-
82
- == Configuration
83
-
84
- Place the config file in the main project directory as
85
- 'hydra.yml' or 'config/hydra.yml'.
86
-
87
- === Examples
88
-
89
- ==== Dual Core
90
-
91
- workers:
92
- - type: local
93
- runners: 2
94
-
95
- ==== Dual Core, with a remote Quad Core server
96
-
97
- The -p3022 tells it to connect on a different port
98
-
99
- workers:
100
- - type: local
101
- runners: 2
102
- - type: ssh
103
- connect: user@example.com
104
- ssh_opts: -p3022
105
- directory: /absolute/path/to/project
106
- runners: 4
107
-
108
- ==== Two Remote Quad Cores with Synchronization
109
-
110
- You can use the 'sync' configuration to allow rsync to synchronize
111
- the local and remote directories every time you run hydra.
112
-
113
- workers:
114
- - type: ssh
115
- connect: user@alpha.example.com
116
- directory: /path/to/project/on/alpha/
117
- runners: 4
118
- - type: ssh
119
- connect: user@beta.example.com
120
- directory: /path/to/project/on/beta/
121
- runners: 4
122
-
123
- sync:
124
- directory: /my/local/project/directory
125
- exclude:
126
- - tmp
127
- - log
128
- - doc
129
-
130
- === Workers Options
131
-
132
- ==== type
133
-
134
- Either "local" or "ssh".
135
-
136
- ==== runners
137
-
138
- The *runners* option is how many processes will be running
139
- on the machine. It's best to pick the same number
140
- as the number of cores on that machine (as well as your
141
- own).
142
-
143
- === SSH Options
144
-
145
- ==== connect
146
-
147
- The *connect* option is passed to SSH. So if you've setup an
148
- ssh config alias to a server, you can use that. It is also
149
- used in rsync, so you cannot use options.
150
-
151
- ==== ssh_opts
152
-
153
- The *ssh_opts* option is passed to SSH and to Rsync's RSH so
154
- that you can use the same ssh options for connecting and rsync.
155
- Use ssh_opts to set the port or compression options.
156
-
157
- ==== directory
158
-
159
- The *directory* option is the path for the project directory
160
- where the tests should be run.
161
-
162
- === Using Hydra::Listeners
163
-
164
- Hydra comes with a couple of listeners for the events it fires. By
165
- default, Hydra::Listener::MinimalOutput is used to display the
166
- files being tests and the ./F/E for each file and F/E output.
167
-
168
- It also uses Hydra::Listener::ReportGenerator to generate reports
169
- of the test files to that it can order them by their run times.
170
-
171
- To use another listener, just add a listeners node to the config file.
172
- For example, if you are on Ubuntu Linux (or have access to the
173
- notify-send command) you can add a notifier listener like this:
174
-
175
- listeners:
176
- - Hydra::Listener::Notifier.new
177
-
178
- Note that if you make a listener node, the default listeners will be
179
- overridden, so you will no longer have the standard minimal output
180
- unless you do:
181
-
182
- listeners:
183
- - Hydra::Listener::Notifier.new
184
- - Hydra::Listener::MinimalOutput.new
185
-
186
- Listeners take one argument to their contstructor: an IO object. So,
187
- you can easily output Hydra to a variety of log files. For example:
188
-
189
- listeners:
190
- - Hydra::Listener::ReportGenerator.new(File.new('/home/ngauthier/Desktop/hydra_log.yml', 'w'))
191
-
192
- == More Information
193
-
194
- For more information on Hydra, check out the rdocs:
195
-
196
- http://rdoc.info/projects/ngauthier/hydra
197
-
198
36
  == Copyright
199
37
 
200
38
  Copyright (c) 2010 Nick Gauthier. See LICENSE for details.
data/Rakefile CHANGED
@@ -11,6 +11,8 @@ begin
11
11
  gem.homepage = "http://github.com/ngauthier/hydra"
12
12
  gem.authors = ["Nick Gauthier"]
13
13
  gem.add_development_dependency "shoulda", "= 2.10.3"
14
+ gem.add_development_dependency "rspec", "= 1.3.0"
15
+ gem.add_development_dependency "cucumber", "= 0.6.4"
14
16
  end
15
17
  Jeweler::GemcutterTasks.new
16
18
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.0
1
+ 0.16.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hydra}
8
- s.version = "0.16.0"
8
+ s.version = "0.16.1"
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-04-04}
12
+ s.date = %q{2010-04-06}
13
13
  s.description = %q{Spread your tests over multiple machines to test your code faster.}
14
14
  s.email = %q{nick@smartlogicsolutions.com}
15
15
  s.extra_rdoc_files = [
@@ -46,6 +46,7 @@ Gem::Specification.new do |s|
46
46
  "lib/hydra/pipe.rb",
47
47
  "lib/hydra/runner.rb",
48
48
  "lib/hydra/safe_fork.rb",
49
+ "lib/hydra/spec/autorun_override.rb",
49
50
  "lib/hydra/spec/hydra_formatter.rb",
50
51
  "lib/hydra/ssh.rb",
51
52
  "lib/hydra/stdio.rb",
@@ -78,18 +79,18 @@ Gem::Specification.new do |s|
78
79
  s.summary = %q{Distributed testing toolkit}
79
80
  s.test_files = [
80
81
  "test/pipe_test.rb",
81
- "test/test_helper.rb",
82
82
  "test/ssh_test.rb",
83
- "test/message_test.rb",
84
- "test/master_test.rb",
85
- "test/fixtures/write_file.rb",
86
- "test/fixtures/slow.rb",
87
- "test/fixtures/write_file_spec.rb",
88
- "test/fixtures/features/step_definitions.rb",
89
- "test/fixtures/hello_world.rb",
90
83
  "test/fixtures/write_file_alternate_spec.rb",
91
84
  "test/fixtures/sync_test.rb",
85
+ "test/fixtures/hello_world.rb",
86
+ "test/fixtures/features/step_definitions.rb",
92
87
  "test/fixtures/assert_true.rb",
88
+ "test/fixtures/slow.rb",
89
+ "test/fixtures/write_file_spec.rb",
90
+ "test/fixtures/write_file.rb",
91
+ "test/message_test.rb",
92
+ "test/test_helper.rb",
93
+ "test/master_test.rb",
93
94
  "test/runner_test.rb",
94
95
  "test/worker_test.rb"
95
96
  ]
@@ -100,11 +101,17 @@ Gem::Specification.new do |s|
100
101
 
101
102
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
102
103
  s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
104
+ s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
105
+ s.add_development_dependency(%q<cucumber>, ["= 0.6.4"])
103
106
  else
104
107
  s.add_dependency(%q<shoulda>, ["= 2.10.3"])
108
+ s.add_dependency(%q<rspec>, ["= 1.3.0"])
109
+ s.add_dependency(%q<cucumber>, ["= 0.6.4"])
105
110
  end
106
111
  else
107
112
  s.add_dependency(%q<shoulda>, ["= 2.10.3"])
113
+ s.add_dependency(%q<rspec>, ["= 1.3.0"])
114
+ s.add_dependency(%q<cucumber>, ["= 0.6.4"])
108
115
  end
109
116
  end
110
117
 
@@ -107,6 +107,8 @@ module Hydra #:nodoc:
107
107
  begin
108
108
  require 'spec'
109
109
  require 'hydra/spec/hydra_formatter'
110
+ # Ensure we override rspec's at_exit
111
+ require 'hydra/spec/autorun_override'
110
112
  rescue LoadError => ex
111
113
  return ex.to_s
112
114
  end
@@ -0,0 +1,12 @@
1
+ if defined?(Spec)
2
+ module Spec
3
+ module Runner
4
+ class << self
5
+ # stop the auto-run at_exit
6
+ def run
7
+ return 0
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,13 +1,6 @@
1
- require 'spec/autorun'
2
1
  require 'spec/runner/formatter/progress_bar_formatter'
3
2
  module Spec
4
3
  module Runner
5
- class << self
6
- # stop the auto-run at_exit
7
- def run
8
- return 0
9
- end
10
- end
11
4
  module Formatter
12
5
  class HydraFormatter < ProgressBarFormatter
13
6
  # Stifle the post-test summary
@@ -73,7 +73,7 @@ module Hydra #:nodoc:
73
73
  yield self if block_given?
74
74
 
75
75
  # Ensure we override rspec's at_exit
76
- require 'hydra/spec/hydra_formatter'
76
+ require 'hydra/spec/autorun_override'
77
77
 
78
78
  @config = find_config_file
79
79
 
@@ -1,4 +1,5 @@
1
1
  require 'tmpdir'
2
+ require 'spec'
2
3
  context "file writing" do
3
4
  it "writes to a file" do
4
5
  File.open(File.join(Dir.tmpdir, 'alternate_hydra_test.txt'), 'a') do |f|
@@ -1,4 +1,5 @@
1
1
  require 'tmpdir'
2
+ require 'spec'
2
3
  context "file writing" do
3
4
  it "writes to a file" do
4
5
  File.open(File.join(Dir.tmpdir, 'hydra_test.txt'), 'a') do |f|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 16
8
- - 0
9
- version: 0.16.0
8
+ - 1
9
+ version: 0.16.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Gauthier
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-04 00:00:00 -04:00
17
+ date: 2010-04-06 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -31,6 +31,34 @@ dependencies:
31
31
  version: 2.10.3
32
32
  type: :development
33
33
  version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: rspec
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 3
44
+ - 0
45
+ version: 1.3.0
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: cucumber
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 6
58
+ - 4
59
+ version: 0.6.4
60
+ type: :development
61
+ version_requirements: *id003
34
62
  description: Spread your tests over multiple machines to test your code faster.
35
63
  email: nick@smartlogicsolutions.com
36
64
  executables: []
@@ -70,6 +98,7 @@ files:
70
98
  - lib/hydra/pipe.rb
71
99
  - lib/hydra/runner.rb
72
100
  - lib/hydra/safe_fork.rb
101
+ - lib/hydra/spec/autorun_override.rb
73
102
  - lib/hydra/spec/hydra_formatter.rb
74
103
  - lib/hydra/ssh.rb
75
104
  - lib/hydra/stdio.rb
@@ -126,17 +155,17 @@ specification_version: 3
126
155
  summary: Distributed testing toolkit
127
156
  test_files:
128
157
  - test/pipe_test.rb
129
- - test/test_helper.rb
130
158
  - test/ssh_test.rb
131
- - test/message_test.rb
132
- - test/master_test.rb
133
- - test/fixtures/write_file.rb
134
- - test/fixtures/slow.rb
135
- - test/fixtures/write_file_spec.rb
136
- - test/fixtures/features/step_definitions.rb
137
- - test/fixtures/hello_world.rb
138
159
  - test/fixtures/write_file_alternate_spec.rb
139
160
  - test/fixtures/sync_test.rb
161
+ - test/fixtures/hello_world.rb
162
+ - test/fixtures/features/step_definitions.rb
140
163
  - test/fixtures/assert_true.rb
164
+ - test/fixtures/slow.rb
165
+ - test/fixtures/write_file_spec.rb
166
+ - test/fixtures/write_file.rb
167
+ - test/message_test.rb
168
+ - test/test_helper.rb
169
+ - test/master_test.rb
141
170
  - test/runner_test.rb
142
171
  - test/worker_test.rb