test :
database : yourproject_test <%= ENV [ 'TEST_ENV_NUMBER' ] %>
Parallel tests with Cucumber:
add to cucumber.yml: std_opts "--require features"
add to env.rb: Capybara.server_port = 8888 + ENV['TEST_ENV_NUMBER'].to_i
Parallel tests with Rspec
add to test.rb: PORT = 8888 + ENV['TEST_ENV_NUMBER'].to_i
Parallel test for email testing
config.action_mailer.delivery_method = :cache
config.action_mailer.cache_settings = { :location => "#{Rails.root}/tmp/cache/action_mailer_cache_delivery#{ENV['TEST_ENV_NUMBER']}.cache" }
Rake task for parallel test
desc "Run tests in parallel mode."
task :parallel , [ :cores ] do |task , args |
cores = [ args [ :cores ] ]
Rake ::Task [ "parallel:spec" ] . invoke ( *cores )
Rake ::Task [ "parallel:features" ] . invoke ( *cores )
end
bundle exec rake parallel:create
bundle exec rake parallel:prepare
# or
bundle exec rake parallel:create[1]
bundle exec rake parallel:prepare[1]
bundle exec rake parallel:spec
# or
bundle exec rake parallel:spec[1]
bundle exec rake parallel:features
# or
bundle exec rake parallel:features[1]
bundle exec rake parallel
# or
bundle exec rake parallel[1]
http://iafonov.github.com/blog/parallel-tests.html