1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/Rakefile
Abdelkader Boudih a75f085941 Add 'activejob/' from commit '14f74a8331f94150dfee653224de8fc837797709'
git-subtree-dir: activejob
git-subtree-mainline: b45b99894a
git-subtree-split: 14f74a8331
2014-08-12 09:17:19 +00:00

68 lines
1.5 KiB
Ruby

require 'bundler/gem_tasks'
require 'rake/testtask'
def run_without_aborting(*tasks)
errors = []
tasks.each do |task|
begin
Rake::Task[task].invoke
rescue Exception
errors << task
end
end
abort "Errors running #{errors.join(', ')}" if errors.any?
end
task default: :test
ADAPTERS = %w(inline delayed_job qu que queue_classic resque sidekiq sneakers sucker_punch backburner)
desc 'Run all adapter tests'
task :test do
tasks = ADAPTERS.map{|a| "test_#{a}" }+["integration_test"]
run_without_aborting(*tasks)
end
ADAPTERS.each do |adapter|
Rake::TestTask.new("test_#{adapter}") do |t|
t.libs << 'test'
t.test_files = FileList['test/cases/**/*_test.rb']
t.verbose = true
end
namespace adapter do
task test: "test_#{adapter}"
task(:env) { ENV['AJADAPTER'] = adapter }
end
task "test_#{adapter}" => "#{adapter}:env"
end
desc 'Run all adapter integration tests'
task :integration_test do
tasks = (ADAPTERS-['inline']).map{|a| "integration_test_#{a}" }
run_without_aborting(*tasks)
end
(ADAPTERS-['inline']).each do |adapter|
Rake::TestTask.new("integration_test_#{adapter}") do |t|
t.libs << 'test'
t.test_files = FileList['test/integration/**/*_test.rb']
t.verbose = true
end
namespace "integration_#{adapter}" do
task test: "integration_test_#{adapter}"
task(:env) do
ENV['AJADAPTER'] = adapter
ENV['AJ_INTEGRATION_TESTS'] = "1"
end
end
task "integration_test_#{adapter}" => "integration_#{adapter}:env"
end