Skip to content

Commit 797ecb2

Browse files
committed
chore: improve wiring of special test tasks
1 parent 720e294 commit 797ecb2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

build-logic/src/main/groovy/buildlogic.java-special-tests-conventions.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ special.forEach { tag ->
2626
}
2727
}
2828

29+
// any test task that does not end with Npm should exclude all the npm tests
30+
tasks.withType(Test).configureEach { Test task ->
31+
if (!task.name.toLowerCase().endsWith('npm')) {
32+
def toExclude = special.findAll { it.toLowerCase().endsWith('npm') }.join('|')
33+
task.useJUnitPlatform {
34+
excludeTags toExclude
35+
}
36+
}
37+
}
38+
2939
tasks.register('testAll') {
3040
dependsOn tasks.matching { it.name.startsWith('test') && it.name != 'testAll' }
3141
}

0 commit comments

Comments
 (0)