[GRADLE-540] scanForTestClasses=false has no effect Created: 11/Jul/09  Updated: 04/Jan/13  Resolved: 13/Jul/09

Status: Resolved
Project: Gradle
Affects Version/s: 0.6.1
Fix Version/s: 0.7

Type: Bug
Reporter: Peter Niederwieser Assignee: Tom Eyckmans
Resolution: Fixed Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-538 Test detection seems to think that ev... Resolved

 Description   

Take my sample project from GRADLE-538 and add the following:

test {
  scanForTestClasses=false
}

I get the same errors as before. Maybe my syntax is wrong (the Gradle documentation doesn't contain a full example)?



 Comments   
Comment by Tom Eyckmans [ 12/Jul/09 ]

Hi Peter,

Your syntax is correct. You should not get the same results as in GRADLE-538 because the includes/excludes passed to the JUnit / TestNG execution are not empty and should result in no test being run.

When you set scanForTestClasses to false, the default includes / excludes prior to test class detection are used (includes "**/Tests.class", "*/Test.class" excludes "/Abstract.class" ). When I run test in your example this leads to no tests being executed and a zero tests JUnit report.

Could you do a clean before running test and comment with your results?

Comment by Peter Niederwieser [ 13/Jul/09 ]

I'm already doing a clean, but as long as the includes/excludes don't match anything, I'm still getting these errors. Probably the same root cause as GRADLE-538.

Comment by Tom Eyckmans [ 13/Jul/09 ]

Sorry for the mix up, I tested with wrong Gradle sources, you are correct this is the same as GRADLE-538

Comment by Tom Eyckmans [ 13/Jul/09 ]

same issue empty includes/excludes result in every class in the test sources to be run as test

Comment by Tom Eyckmans [ 13/Jul/09 ]

GRADLE-538 is solved, this is a duplicate

Generated at Wed Jun 30 11:32:43 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.