2014-05-18 06:30:57 -04:00
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
|
|
|
|
require 'rake/testtask'
|
|
|
|
|
2014-05-18 07:11:00 -04:00
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-18 06:30:57 -04:00
|
|
|
task :default => :test
|
|
|
|
|
2014-05-18 07:11:00 -04:00
|
|
|
desc 'Run all adapter tests'
|
|
|
|
task :test do
|
2014-05-18 15:02:02 -04:00
|
|
|
tasks = %w(test_inline test_resque test_sidekiq)
|
2014-05-18 07:11:00 -04:00
|
|
|
run_without_aborting(*tasks)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2014-05-18 15:02:02 -04:00
|
|
|
%w( inline resque sidekiq ).each do |adapter|
|
2014-05-18 07:11:00 -04:00
|
|
|
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"
|
2014-05-18 06:30:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
require 'rubygems/package_task'
|
|
|
|
|
|
|
|
spec = eval(File.read("#{dir}/activejob.gemspec"))
|
|
|
|
|
|
|
|
Gem::PackageTask.new(spec) do |p|
|
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Release to rubygems"
|
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|