Skip to content

A platform for community discussion. Free, open, simple.

DEV: skip creating multisite db when running JS tests only

Sam Saffron600313373b92
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index 1d1c5fa0eda..f6fc6e6ce63 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -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']")
diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index 78ab72b2963..c60a7fb0499 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -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