Hydra is a distributed testing framework. It allows you to distribute your tests locally across multiple cores and processors, as well as run your tests remotely over SSH.
Hydra’s goals are to make distributed testing easy. So as long as you can ssh into a computer and run the tests, you can automate the distribution with Hydra.
Installing Hydra is easy, just install the gem:
gem install hydra OR Download the gem file from http://gemcutter.org and install it
Setting up HydraTo set up Hydra, you need to edit your project’s Rakefile and add this code:
# require the hydra codebase require 'hydra' # require the hydra rake task helpers require 'hydra/tasks'
Adding Cucumber Files
# set up a new hydra testing task named 'hydra:cucumber' run with "rake hydra:cucumber" Hydra::TestTask.new('hydra:cucumber') do |t| # add all files in the features directory that end with ".feature" t.add_files 'features/**/*.feature' end
Adding Test::Unit Files
# set up a new hydra testing task named 'hydra:units' run with "rake hydra:units" Hydra::TestTask.new('hydra:units') do |t| # add all files in the test/unit directory recursively that # end with "_test.rb" t.add_files 'test/unit/**/*_test.rb' # and test/functional t.add_files 'test/functional/**/*_test.rb' # and test/integration t.add_files 'test/integration/**/*_test.rb' end
Adding RSpec Files
# set up a new hydra testing task named 'hydra:spec' run with "rake hydra:spec" Hydra::TestTask.new('hydra:spec') do |t| # you may or may not need this, depending on how you require # spec_helper in your test files: require 'spec/spec_helper' # add all files in the spec directory that end with "_spec.rb" t.add_files 'spec/**/*_spec.rb' end