JUnit – select the specific test run in gradle

I'm trying to solve our chaotic test run. Unfortunately, I've just graduated We currently have TestNG and JUnit, and I also want to add some mix of Spock tests I'm not sure how gradle decides which tests to run when I type "gradle test" How can I prevent TestNG and / or JUnit test runs? How do I get graduates to start running my Spock test?

Solution

By default, the test task runs all available JUnit tests, including any Spock tests To make it run TestNG tests, configure the task as follows:

test {
    useTestNG()
}

If you have both JUnit and TestNG tests, you need two test tasks, one for each test framework

To run a subset of the tests, use - DTest Single system properties For more information, see the appropriate section in the gradle user guide

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>