DEV: skip creating multisite db when running JS tests only

This commit is contained in:
Sam Saffron 2019-03-21 12:19:12 +11:00
parent 896204bef7
commit 600313373b
2 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,7 @@ end
task 'db:migrate', [:multisite] => ['environment', 'set_locale'] do |_, args|
SeedFu.seed(DiscoursePluginRegistry.seed_paths)
if Rails.env.test? && !args[:multisite]
if Rails.env.test? && !args[:multisite] && !ENV["SKIP_MULTISITE"]
system("rails db:schema:dump")
system("MULTISITE=multisite rails db:schema:load")
system("RAILS_DB=discourse_test_multisite rails db:migrate['multisite']")

View File

@ -107,6 +107,10 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake plugin:install_all_official")
end
# this shaves all the creation of the multisite db off
# for js tests
ENV["SKIP_MULTISITE"] = "1" if ENV["JS_ONLY"]
if ENV["SKIP_PLUGINS"]
@good &&= run_or_fail("bundle exec rake db:migrate")
else