From 14d31417deaf715d5344fb48c812b5858dcfdd7c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 27 Jan 2022 12:02:08 -0500 Subject: [PATCH] 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. --- .github/workflows/tests.yml | 6 +++--- .../javascripts/discourse/tests/test-boot-ember-cli.js | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdd8fbe047a..5625e71c9e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js b/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js index e58bc312aac..58d25ada548 100644 --- a/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js +++ b/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js @@ -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,