HYDRA – Ruby gem

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.

nstalling 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 Hydra

To 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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s