The --tests filter doesn't seem to work as documented, at least with groovy

(Timothy Overly) #1

Per the documentation it seems that:

gradle test --tests SomeSpecificTest

Would run the test class named org.package.SomeSpecificTest, or any class with that name. However I couldn’t get that to ever run any tests, because of the package name. So the following did evaluate what I thought it would

gradle test --tests *SomeSpecificTest

I am not sure if the first was intended to work like the second. Either way is valid, but should be either corrected in the docs, or gradle should be fixed to match the docs.

This was happening for me with gradle 1.11 and the java and groovy plugin on a groovy test.


(Luke Daley) #2

Hi Timothy,

Can you please point me to the exact documentation you were looking at.

(Timothy Overly) #3

In section “23.12.2. Test filtering”

(Luke Daley) #4

I can’t see anything in there that implies that it would work without the wildcard, as it matches on fully qualified class names.

(Timothy Overly) #5

I would say these two both fail:

gradle test --tests SomeTest.someSpecificFeature

gradle test --tests SomeSpecificTest

Those two lines should be:

gradle test --tests *SomeTest.someSpecificFeature

gradle test --tests *SomeSpecificTest

Even the filter page has the wildcard:

includeTestsMatching “*SomeTest.someSpecificFeature”

(Peter Niederwieser) #6

I think we should get rid of the requirement to use a leading asterisk. It’s too cumbersome, and too easy to get wrong.