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


(Greg Wiley) #1

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.


(Greg Wiley) #2

Have confirmed that this problem persists in RC-2.


(Luke Daley) #3

Hi Greg,

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


(Greg Wiley) #4

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.


(Luke Daley) #5

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.


(Greg Wiley) #6

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


(Greg Wiley) #7

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


(Greg Wiley) #8

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


(Luke Daley) #9

I’ve raised GRADLE-3112 for this.

Thanks for the report.