Filtered test task does not run tests that use the JUnit parameterized test runner

Using Gradle 2.0-rc-1. JUnit 4.11

‘gradle test’ runs all of my tests out of the box. I add this to ‘build.gradle’ to differentiate unit tests: ‘’’ test {

filter {

includeTestsMatching “test.*”

} } ‘’’ Then, any test annotated with ‘@RunWith(Parameterized.class)’ is not included in the test run. Non-annotated tests run fine.

No error is displayed so it looks as if all tests have passed. But the test report and artifacts indicate clearly that none of those tests have been run.

1 Like

Have confirmed that this problem persists in RC-2.

Hi Greg,

Did this problem only appear with the 2.0 RCs? i.e. did it work with 1.12?

Hi Luke. Thanks.

I haven’t tried 1.12. I thought the filter configuration was new to 2.0. I am tentatively moving from Maven on a couple of projects and starting with 2.0 to avoid instant obsolescence.

If the filter capability is available in 1.12, I will perform the experiment and post the results.

HI Greg,

The filter feature came in 1.11 I believe. If you could try with 1.12 and let us know that would be great.

Problem occurs in 1.12 as well. Gradle fails to find any tests annotated as above when there is a filter in effect.

FYI:

------------------------------------------------------------ Gradle 2.0-rc-2 ------------------------------------------------------------

Build time:

2014-06-23 08:02:36 UTC Build number: none Revision:

b6ead6fa452dfdadec484059191eb641d817226c

Groovy:

2.3.3 Ant:

Apache Ant™ version 1.9.3 compiled on December 23 2013 JVM:

1.8.0_05 (Oracle Corporation 25.5-b02) OS:

Linux 3.13.0-29-generic amd64

------------------------------------------------------------ Gradle 1.12 ------------------------------------------------------------

Build time:

2014-04-29 09:24:31 UTC Build number: none Revision:

a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:

1.8.6 Ant:

Apache Ant™ version 1.9.3 compiled on December 23 2013 Ivy:

2.2.0 JVM:

1.8.0_05 (Oracle Corporation 25.5-b02) OS:

Linux 3.13.0-29-generic amd64

The entire project is on GH: https://github.com/mediascience/jaxrs-trailing-slash

I’ve raised GRADLE-3112 for this.

Thanks for the report.