From 133ad908947b47313b761b8327bcefaddc8a4c9f Mon Sep 17 00:00:00 2001 From: Sean Kirby Date: Fri, 7 May 2010 17:06:13 -0400 Subject: [PATCH] added ability to set the rails environment to run tests under --- lib/hydra/master.rb | 3 ++- lib/hydra/tasks.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/hydra/master.rb b/lib/hydra/master.rb index dc1d850..baa088f 100644 --- a/lib/hydra/master.rb +++ b/lib/hydra/master.rb @@ -48,6 +48,7 @@ module Hydra #:nodoc: @verbose = opts.fetch('verbose') { false } @autosort = opts.fetch('autosort') { true } @sync = opts.fetch('sync') { nil } + @environment = opts.fetch('environment') { 'test' } if @autosort sort_files_from_report @@ -139,7 +140,7 @@ module Hydra #:nodoc: runners = worker.fetch('runners') { raise "You must specify the number of runners" } command = worker.fetch('command') { - "ruby -e \"require 'rubygems'; require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose});\"" + "RAILS_ENV=#{@environment} ruby -e \"require 'rubygems'; require 'hydra'; Hydra::Worker.new(:io => Hydra::Stdio.new, :runners => #{runners}, :verbose => #{@verbose});\"" } trace "Booting SSH worker" diff --git a/lib/hydra/tasks.rb b/lib/hydra/tasks.rb index 47e4b09..eb50f75 100644 --- a/lib/hydra/tasks.rb +++ b/lib/hydra/tasks.rb @@ -188,7 +188,7 @@ module Hydra #:nodoc: end @listeners.each{|l| l.join} $stdout.write "\n==== Hydra Running #{@name} COMPLETE ====\n\n" - $stdout.write @results.values.join('\n') + $stdout.write @results.values.join("\n") end end