-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
Gradle 9 marks custom Test
tasks as "NO-SOURCE" and skips them. Need to migrate ~102 files to modern Test Suites.
Find Files to Fix
grep -r "by registering(Test::" --include="*.kts" .
Migration Pattern
Before:
val testStableSemconv by registering(Test::class) {
jvmArgs("-Dotel.semconv-stability.opt-in=database")
systemProperty("collectMetadata", collectMetadata)
}
tasks {
check {
dependsOn(testStableSemconv)
}
}
After:
testing {
suites {
val testStableSemconv by registering(JvmTestSuite::class) {
targets {
all {
testTask.configure {
jvmArgs("-Dotel.semconv-stability.opt-in=database")
systemProperty("collectMetadata", collectMetadata)
}
}
}
}
}
}
tasks {
check {
dependsOn(testing.suites.named("testStableSemconv"))
}
}
Key Changes
by registering(Test::class)
→by registering(JvmTestSuite::class)
- Wrap configs in
targets.all.testTask.configure { }
- Put test suites inside
testing.suites { }
- Update dependencies:
dependsOn(taskName)
→dependsOn(testing.suites.named("taskName"))
Validate
./gradlew :module:testStableSemconv --rerun-tasks
Should run tests, not show "NO-SOURCE".
Copilot
Metadata
Metadata
Assignees
Labels
No labels