lib/parallel_tests/tasks.rb in parallel_tests-2.14.3 vs lib/parallel_tests/tasks.rb in parallel_tests-2.15.0

- old
+ new

@@ -77,27 +77,27 @@ end end end namespace :parallel do - desc "setup test databases via db:setup --> parallel:setup[num_cpus]" + desc "Setup test databases via db:setup --> parallel:setup[num_cpus]" task :setup, :count do |_,args| command = "rake db:setup RAILS_ENV=#{ParallelTests::Tasks.rails_env}" ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args) end - desc "create test databases via db:create --> parallel:create[num_cpus]" + desc "Create test databases via db:create --> parallel:create[num_cpus]" task :create, :count do |_,args| ParallelTests::Tasks.run_in_parallel("rake db:create RAILS_ENV=#{ParallelTests::Tasks.rails_env}", args) end - desc "drop test databases via db:drop --> parallel:drop[num_cpus]" + desc "Drop test databases via db:drop --> parallel:drop[num_cpus]" task :drop, :count do |_,args| ParallelTests::Tasks.run_in_parallel("rake db:drop RAILS_ENV=#{ParallelTests::Tasks.rails_env} DISABLE_DATABASE_ENVIRONMENT_CHECK=1", args) end - desc "update test databases by dumping and loading --> parallel:prepare[num_cpus]" + desc "Update test databases by dumping and loading --> parallel:prepare[num_cpus]" task(:prepare, [:count]) do |_,args| ParallelTests::Tasks.check_for_pending_migrations if defined?(ActiveRecord) && ActiveRecord::Base.schema_format == :ruby # dump then load in parallel Rake::Task['db:schema:dump'].invoke @@ -109,39 +109,39 @@ ParallelTests::Tasks.run_in_parallel("rake #{taskname}", args) end end # when dumping/resetting takes too long - desc "update test databases via db:migrate --> parallel:migrate[num_cpus]" + desc "Update test databases via db:migrate --> parallel:migrate[num_cpus]" task :migrate, :count do |_,args| ParallelTests::Tasks.run_in_parallel("rake db:migrate RAILS_ENV=#{ParallelTests::Tasks.rails_env}", args) end # just load the schema (good for integration server <-> no development db) - desc "load dumped schema for test databases via db:schema:load --> parallel:load_schema[num_cpus]" + desc "Load dumped schema for test databases via db:schema:load --> parallel:load_schema[num_cpus]" task :load_schema, :count do |_,args| command = "rake #{ParallelTests::Tasks.purge_before_load} db:schema:load RAILS_ENV=#{ParallelTests::Tasks.rails_env} DISABLE_DATABASE_ENVIRONMENT_CHECK=1" ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args) end # load the structure from the structure.sql file - desc "load structure for test databases via db:structure:load --> parallel:load_structure[num_cpus]" + desc "Load structure for test databases via db:structure:load --> parallel:load_structure[num_cpus]" task :load_structure, :count do |_,args| ParallelTests::Tasks.run_in_parallel("rake #{ParallelTests::Tasks.purge_before_load} db:structure:load RAILS_ENV=#{ParallelTests::Tasks.rails_env} DISABLE_DATABASE_ENVIRONMENT_CHECK=1", args) end - desc "load the seed data from db/seeds.rb via db:seed --> parallel:seed[num_cpus]" + desc "Load the seed data from db/seeds.rb via db:seed --> parallel:seed[num_cpus]" task :seed, :count do |_,args| ParallelTests::Tasks.run_in_parallel("rake db:seed RAILS_ENV=#{ParallelTests::Tasks.rails_env}", args) end - desc "launch given rake command in parallel" + desc "Launch given rake command in parallel" task :rake, :command, :count do |_, args| ParallelTests::Tasks.run_in_parallel("RAILS_ENV=#{ParallelTests::Tasks.rails_env} rake #{args.command}", args) end ['test', 'spec', 'features', 'features-spinach'].each do |type| - desc "run #{type} in parallel with parallel:#{type}[num_cpus]" + desc "Run #{type} in parallel with parallel:#{type}[num_cpus]" task type, [:count, :pattern, :options] do |t, args| ParallelTests::Tasks.check_for_pending_migrations $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..')) require "parallel_tests"