Exclude set of tests (via) and/or categories:
1 2 3 4 5 6 7 8 9 |
task junitSystemTest(type: Test) { systemProperties = System.properties def runSeparately = ['**/FirstSpec*', '**/SecondSpec*'] useJUnit { includeCategories 'com.acme.SystemTest' exclude runSeparately } } |
Pass collection from shell (via, and):
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// ./gradlew junitSystemTest -PexcludeTests=**/FirstSpec*,**/SecondSpec* task junitSystemTest(type: Test) { systemProperties = System.properties useJUnit { includeCategories 'com.acme.SystemTest' if (project.hasProperty('excludeTests')) { project.properties['excludeTests'].split(',').each { exclude it } } } } |
Run single test only (via):
1 |
./gradlew junitSystemTest --tests FirstSpec* |
Exclude all tests from build task:
1 |
./gradlew clean build -x test |
to be completed