From b1b09efd7504f311eaa23b1f2484916820902bea Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 6 Jul 2021 17:10:15 +0100 Subject: [PATCH] Moved loadAllThemes out of test util MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - this was skipped on boot, but then called in the test utilities, but only on restart 🙈 - this means that yarn test:acceptance (i.e. running all tests) works, but if you try to run just test/api-acceptance/themes_spec.js it would fail because that uses a fresh boot not a restart/reload - I've changed this as keeping the test using the real boot, rather than the made-up acceptance-utils tasks as much as possible is way better --- core/boot.js | 8 ++++---- test/utils/acceptance-utils.js | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/boot.js b/core/boot.js index a490e62a7b..ff2cbb9d52 100644 --- a/core/boot.js +++ b/core/boot.js @@ -219,6 +219,10 @@ async function initServices({config}) { async function initBackgroundServices({config}) { debug('Begin: initBackgroundServices'); + // Load all inactive themes + const themeService = require('./server/services/themes'); + themeService.loadInactiveThemes(); + // we don't want to kick off background services that will interfere with tests if (process.env.NODE_ENV.match(/^testing/)) { return; @@ -230,10 +234,6 @@ async function initBackgroundServices({config}) { await emailAnalyticsJobs.scheduleRecurringJobs(); } - // Load all inactive themes - const themeService = require('./server/services/themes'); - themeService.loadInactiveThemes(); - const updateCheck = require('./server/update-check'); updateCheck.scheduleRecurringJobs(); diff --git a/test/utils/acceptance-utils.js b/test/utils/acceptance-utils.js index 638270f139..f0630c5be5 100644 --- a/test/utils/acceptance-utils.js +++ b/test/utils/acceptance-utils.js @@ -118,9 +118,6 @@ const restartModeGhostStart = async () => { // @TODO: why does this happen _after_ URL service web.shared.middlewares.customRedirects.reload(); - // Trigger themes to load again - themeService.loadInactiveThemes(); - // Reload limits service limits.init(); };