lib/parallel_tests/tasks.rb in parallel_tests-1.0.3 vs lib/parallel_tests/tasks.rb in parallel_tests-1.0.4
- old
+ new
@@ -79,18 +79,16 @@
end
desc "update test databases by dumping and loading --> parallel:prepare[num_cpus]"
task(:prepare, [:count]) do |t,args|
ParallelTests::Tasks.check_for_pending_migrations
+ # dump then load in parallel for ruby or sql schema formats
if defined?(ActiveRecord) && ActiveRecord::Base.schema_format == :ruby
- # dump then load in parallel
Rake::Task['db:schema:dump'].invoke
Rake::Task['parallel:load_schema'].invoke(args[:count])
else
- # there is no separate dump / load for schema_format :sql -> do it safe and slow
- args = args.to_hash.merge(:non_parallel => true) # normal merge returns nil
- taskname = Rake::Task.task_defined?('db:test:prepare') ? 'db:test:prepare' : 'app:db:test:prepare'
- ParallelTests::Tasks.run_in_parallel("rake #{taskname}", args)
+ Rake::Task['db:structure:dump'].invoke
+ Rake::Task['parallel:load_structure'].invoke(args[:count])
end
end
# when dumping/resetting takes too long
desc "update test databases via db:migrate --> parallel:migrate[num_cpus]"