2012-01-23 17:05:03 -05:00
|
|
|
#!/usr/bin/env rake
|
|
|
|
|
|
|
|
require File.expand_path('../config/application', __FILE__)
|
|
|
|
|
2016-11-17 17:40:09 -05:00
|
|
|
task :test do
|
|
|
|
require 'timeout'
|
2013-04-26 12:00:03 -04:00
|
|
|
|
2016-11-17 17:40:09 -05:00
|
|
|
%(production development).each do |env|
|
|
|
|
pid = fork do
|
|
|
|
ENV['RAILS_ENV'] = env
|
|
|
|
puts eval(File.read("integration_test.rb"))
|
|
|
|
end
|
2013-04-26 12:00:03 -04:00
|
|
|
|
2016-11-17 17:40:09 -05:00
|
|
|
begin
|
|
|
|
Timeout.timeout(20) do
|
|
|
|
Process.wait
|
|
|
|
end
|
|
|
|
rescue Timeout::Error
|
|
|
|
Process.kill 9, pid
|
|
|
|
# collect status so it doesn't stick around as zombie process
|
|
|
|
Process.wait pid
|
|
|
|
end
|
|
|
|
puts "#{server} child exited, pid = #{pid}"
|
|
|
|
Process.wait4(pid)
|
2013-04-26 12:00:03 -04:00
|
|
|
end
|
|
|
|
end
|
2016-11-17 17:40:09 -05:00
|
|
|
|
|
|
|
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
|
|
|
|
task :default => :appraisal
|
|
|
|
else
|
|
|
|
task :default => :test
|
|
|
|
end
|