Fix: always create TestDefinitions with correct explicitlySpecified value

Previously only created new TestDefinitions when explicitlyRequestedNames was non-empty,
leaving uniqueTests with potentially incorrect explicitlySpecified values.
Now always map to create new TestDefinitions with explicitlySpecified based on
whether the test name is in explicitlyRequestedNames.
This commit is contained in:
Eruis2579 2026-02-12 09:27:18 -05:00
parent 63c7271e87
commit b4f0358f1e
1 changed files with 8 additions and 11 deletions

View File

@ -293,17 +293,14 @@ object Tests {
val uniqueTests = distinctBy(tests)(_.name)
// Per TaskDef: explicitlySpecified=true only when user supplied a complete FQN (e.g. testOnly com.example.MySuite),
// not for patterns (testOnly *Spec) or plain "test". So only mark when test.name is in explicitlyRequestedNames.
val testsToUse =
if (explicitlyRequestedNames.isEmpty) uniqueTests
else
uniqueTests.map(t =>
new TestDefinition(
t.name,
t.fingerprint,
explicitlySpecified = explicitlyRequestedNames.contains(t.name),
Array(new SuiteSelector: Selector)
)
)
val testsToUse = uniqueTests.map(t =>
new TestDefinition(
t.name,
t.fingerprint,
explicitlySpecified = explicitlyRequestedNames.contains(t.name),
Array(new SuiteSelector: Selector)
)
)
new ProcessedOptions(
testsToUse.toVector,
setup.toVector,