DEV: Reenable wizard test after fixing auto start for wizard qunit tests

`run-qunit.js` does not expect QUnit tests to start automatically but
our wizard QUnit setup did not respect the `qunit_disable_auto_start`
URL param. Hence, tests would start running automatically and when a
subsequent `QUnit.start()` function call is made, we ended up getting a
`QUnit.start cannot be called inside a test context.` error.

This error can be consistently reproduced in the `discourse:discourse_test` container but not in
the local development environment. I do not know why and did not feel
like it is important at this point in time to know why.
This commit is contained in:
Alan Guo Xiang Tan 2022-05-25 14:43:49 +08:00
parent 05212f6cc3
commit 072faa08bb
2 changed files with 11 additions and 5 deletions

View File

@ -158,11 +158,10 @@ jobs:
run: QUNIT_EMBER_CLI=0 bin/rake qunit:test['1200000'] run: QUNIT_EMBER_CLI=0 bin/rake qunit:test['1200000']
timeout-minutes: 30 timeout-minutes: 30
# Wizard tests are failing so disabled for now while we investigate - name: Wizard QUnit (Legacy)
# - name: Wizard QUnit (Legacy) if: matrix.build_type == 'frontend-legacy' && matrix.target == 'core'
# if: matrix.build_type == 'frontend-legacy' && matrix.target == 'core' run: QUNIT_EMBER_CLI=0 bin/rake qunit:test['600000','/wizard/qunit']
# run: QUNIT_EMBER_CLI=0 bin/rake qunit:test['600000','/wizard/qunit'] timeout-minutes: 10
# timeout-minutes: 10
- name: Plugin QUnit (Legacy) - name: Plugin QUnit (Legacy)
if: matrix.build_type == 'frontend-legacy' && matrix.target == 'plugins' if: matrix.build_type == 'frontend-legacy' && matrix.target == 'plugins'

View File

@ -50,6 +50,13 @@ let createPretendServer = requirejs(
).default; ).default;
let server; let server;
const queryParams = new URLSearchParams(window.location.search);
if (queryParams.get("qunit_disable_auto_start") === "1") {
QUnit.config.autostart = false;
}
QUnit.testStart(function () { QUnit.testStart(function () {
server = createPretendServer(); server = createPretendServer();
}); });