简体   繁体   中英

how can gradle test task run specific junit tests' suite?

I'm running a gradle test task.

task e2eTest(type: Test) {
    testClassesDir = project.sourceSets.main.output.classesDir
    classpath = project.sourceSets.main.runtimeClasspath
}

However I want only some of the tests to run.

How can I define a junit suit that gradle can filter tests according to it and run the only?

You can try the specific test filter feature (Gradle 1.10+) as described in the manual

http://www.gradle.org/docs/current/userguide/java_plugin.html (23.13.3)

If your specific test suite may be pinpointed by its package or class name, then it should do the trick. You can make it depend on variables that can be later parametrized on Jenkins or whatever CI you are into

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM