Is there a way to create custom test phases in gradle?
I have a series of tests, namely
/unit /local /remote
which runs proven JUnit tests for several different purposes. I would like them to run them as test steps, like gradle test:unit , or something like that. Ideally, I could also provide a description for each phase of testing, so gradle tasks describe the role of each of the tests.
Is it possible? If so, how?
I tried this:
sourceSets { unit { java.srcDir file('src/test/groovy/local') resources.srcDir file('src/local/resources') } } dependencies {...} task unitTest(type: Test){ testClassesDir = sourceSets.local.output.classesDir classpath = sourceSets.local.runtimeClasspath }
... as copied from withIntegrationTests in the provided samples, but when I run gradle unitTest , the tests fail.
source share