[2.x] fix: Prefer direct key selection for testFull at root (#8775)

**Problem**
`testFull` can select an aggregate-only key before a directly defined root key.
In issue #8772 this causes root project tests to be skipped, so a failing root test can pass unexpectedly.

**Solution**
Prefer directly defined keys in `Act.select`, and only fall back to aggregate-only candidates when no direct key exists.
Add scripted regression test `tests/i8772-root-project-testfull` and keep `project/extra-projects-key-aggregate` behavior intact.
This commit is contained in:
it-education-md 2026-02-21 03:05:25 -05:00 committed by GitHub
parent a7d5f45515
commit ae1066ed12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 1 deletions

View File

@ -216,7 +216,9 @@ object Act {
case None => noValidKeys
case Some(x) => success(x)
val validFilter = structure.fold(isValid(data))(isValidForAggregate(data, _))
selectFromValid(ss filter validFilter, default)
val valid = ss filter validFilter
val directlyDefined = valid filter isValid(data)
selectFromValid(if directlyDefined.nonEmpty then directlyDefined else valid, default)
}
private def isValidForAggregate(

View File

@ -0,0 +1,11 @@
ThisBuild / scalaVersion := "2.13.18"
lazy val a = project
lazy val b = project
.in(file("."))
.settings(
libraryDependencies += "org.scalatest" %% "scalatest-funsuite" % "3.2.19" % Test
)
.dependsOn(a)
.aggregate(a)

View File

@ -0,0 +1,7 @@
package example
import org.scalatest.funsuite.AnyFunSuite
class Test1 extends AnyFunSuite {
fail("This test should fail")
}

View File

@ -0,0 +1 @@
-> testFull