DEV: Fix random test ordering (#17905)

And don't reorder failed tests when providing a seed - that was making failure debugging more difficult.
This commit is contained in:
Jarek Radosz 2022-08-15 02:04:44 +02:00 committed by GitHub
parent 01d87e78b4
commit 0be67cb513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,10 @@ document.addEventListener("discourse-booted", () => {
if (QUnit.config.seed === undefined) { if (QUnit.config.seed === undefined) {
// If we're running in browser, default to random order. Otherwise, let Ember Exam // If we're running in browser, default to random order. Otherwise, let Ember Exam
// handle randomization. // handle randomization.
QUnit.config.seed = true; QUnit.config.seed = Math.random().toString(36).slice(2);
} else {
// Don't reorder when specifying a seed
QUnit.config.reorder = false;
} }
loader.loadModules(); loader.loadModules();
@ -53,4 +56,5 @@ document.addEventListener("discourse-booted", () => {
setupEmberOnerrorValidation: !skipCore, setupEmberOnerrorValidation: !skipCore,
}); });
}); });
window.EmberENV.TESTS_FILE_LOADED = true; window.EmberENV.TESTS_FILE_LOADED = true;