lib/hydra/tasks.rb in arturop-hydra-0.23.4 vs lib/hydra/tasks.rb in arturop-hydra-0.24.0
- old
+ new
@@ -3,10 +3,13 @@
# Hydra Task Common attributes and methods
class Task
# Name of the task. Default 'hydra'
attr_accessor :name
+ # Command line options
+ attr_accessor :options
+
# Files to test.
# You can add files manually via:
# t.files << [file1, file2, etc]
#
# Or you can use the add_files method
@@ -83,10 +86,11 @@
@verbose = false
@autosort = true
@serial = false
@listeners = [Hydra::Listener::ProgressBar.new]
@show_time = true
+ @options = ''
yield self if block_given?
# Ensure we override rspec's at_exit
if defined?(RSpec)
@@ -101,11 +105,12 @@
:verbose => @verbose,
:autosort => @autosort,
:files => @files,
:listeners => @listeners,
:environment => @environment,
- :runner_log_file => @runner_log_file
+ :runner_log_file => @runner_log_file,
+ :options => @options
}
if @config
@opts.merge!(:config => @config)
else
@opts.merge!(:workers => [{:type => :local, :runners => 1}])
@@ -271,10 +276,10 @@
private
def define
desc "Run #{@name} remotely on all workers"
task "hydra:remote:#{@name}" do
- config = YAML.load_file(@config)
+ config = Hydra::ProxyConfig.load(IO.read(@config))
environment = config.fetch('environment') { 'test' }
workers = config.fetch('workers') { [] }
workers = workers.select{|w| w['type'] == 'ssh'}
@command = "RAILS_ENV=#{environment} rake #{@name}" unless @command