Created
January 10, 2011 16:42
-
-
Save dimacus/773021 to your computer and use it in GitHub Desktop.
Method call in parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :cucumber_sauce do | |
Parallel.map(@browsers, :in_threads => @browsers.size) do |browser| | |
begin | |
puts "Running with: #{browser.inspect}" | |
ENV['SELENIUM_BROWSER_OS'] = browser[:os] | |
ENV['SELENIUM_BROWSER_NAME'] = browser[:name] | |
ENV['SELENIUM_BROWSER_VERSION'] = browser[:version] | |
ENV['SELENIUM_REPORT_FILENAME'] = "#{dir}/#{year}-#{month}-#{day}-#{browser[:os]}_#{browser[:name]}_#{browser[:version]}.html".gsub(/\s/, "_").gsub("..", ".") | |
i_cause_problems #Running this causes problems | |
Rake::Task[ "acceptance:selenium:run_browser_tests" ].execute | |
rescue RuntimeError | |
puts "Error while running task" | |
end | |
end | |
end | |
Cucumber::Rake::Task.new(:'run_browser_tests', "") do |t| | |
t.profile = "local" | |
end | |
def i_cause_problems | |
p "Calling this within parallel screws up the ENV variables" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment