Revert "Revert "DEV: Run Ember CLI tests in random order" (#15717)"

The worst of the flaky tests should be fixed now, so let's re-enable
this.
This commit is contained in:
Robin Ward 2022-01-27 12:02:08 -05:00
parent 2fc8e923b6
commit 14d31417de
2 changed files with 10 additions and 3 deletions

View File

@ -232,15 +232,15 @@ jobs:
- name: Core QUnit 1
working-directory: ./app/assets/javascripts/discourse
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=1 --launch "${{ matrix.browser }}"
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=1 --launch "${{ matrix.browser }}" --random
timeout-minutes: 20
- name: Core QUnit 2
working-directory: ./app/assets/javascripts/discourse
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=2 --launch "${{ matrix.browser }}"
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=2 --launch "${{ matrix.browser }}" --random
timeout-minutes: 20
- name: Core QUnit 3
working-directory: ./app/assets/javascripts/discourse
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=3 --launch "${{ matrix.browser }}"
run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=3 --launch "${{ matrix.browser }}" --random
timeout-minutes: 20

View File

@ -34,6 +34,13 @@ document.addEventListener("discourse-booted", () => {
setup(QUnit.assert);
setupTests(config.APP);
let loader = loadEmberExam();
if (loader.urlParams.size === 0 && !QUnit.config.seed) {
// If we're running in browser, default to random order. Otherwise, let Ember Exam
// handle randomization.
QUnit.config.seed = true;
}
loader.loadModules();
start({
setupTestContainer: false,