DEV: correct parallel specs rake tasks
This used to work due to side effects. `rake parallel:migrate` used to work very inconsistently and would only migrate some of the databases. This introduces the recommended change to db.yml so the correct database is found based off TEST_ENV_NUMBER if for some reason we did not set it using RAILS_DB Also avoids a bunch of schema dumping which is not needed when migrating parallel specs DB number 1 is very odd cause for whatever reason parallel spec is not setting it.
This commit is contained in:
+6
-3
@@ -68,20 +68,23 @@ end
|
||||
|
||||
# we need to run seed_fu every time we run rake db:migrate
|
||||
task 'db:migrate' => ['load_config', 'environment', 'set_locale'] do |_, args|
|
||||
|
||||
ActiveRecord::Tasks::DatabaseTasks.migrate
|
||||
|
||||
Rake::Task['db:_dump'].invoke
|
||||
if !Discourse.is_parallel_test?
|
||||
Rake::Task['db:_dump'].invoke
|
||||
end
|
||||
|
||||
SeedFu.seed(DiscoursePluginRegistry.seed_paths)
|
||||
|
||||
unless Discourse.skip_post_deployment_migrations?
|
||||
if !Discourse.skip_post_deployment_migrations?
|
||||
puts
|
||||
print "Optimizing site icons... "
|
||||
SiteIconManager.ensure_optimized!
|
||||
puts "Done"
|
||||
end
|
||||
|
||||
if MultisiteTestHelpers.load_multisite?
|
||||
if !Discourse.is_parallel_test? && MultisiteTestHelpers.load_multisite?
|
||||
system("RAILS_DB=discourse_test_multisite rake db:migrate")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user