Sort scripted tests

It is nice to have the scripted tests run in a deterministic order. I've
noticed that on windows, they tend to run in sorted order but in a
random order on posix platforms.
This commit is contained in:
Ethan Atkins 2020-11-02 13:44:49 -08:00
parent 8c3f2a50f7
commit 9d3c807c7f
1 changed files with 4 additions and 2 deletions

View File

@ -536,8 +536,10 @@ class ScriptedRunner {
baseDirectory: File,
accept: ScriptedTest => Boolean,
log: Logger,
): Seq[ScriptedTest] =
if (tests.isEmpty) listTests(baseDirectory, accept, log) else parseTests(tests)
): Seq[ScriptedTest] = {
val unsorted = if (tests.isEmpty) listTests(baseDirectory, accept, log) else parseTests(tests)
unsorted.sortBy(t => (t.group, t.name))
}
@deprecated("No longer used", "1.1.0")
def listTests(baseDirectory: File, log: Logger): Seq[ScriptedTest] =