From 600313373b920c1bb104c5bec35fd1e2e42973d3 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 21 Mar 2019 12:19:12 +1100 Subject: [PATCH] DEV: skip creating multisite db when running JS tests only --- lib/tasks/db.rake | 2 +- lib/tasks/docker.rake | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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