1.7 RC - TestReport fails if test were skipped

(Eivind Brandth Smedseng) #1

If one of my test groups don’t have a test the report fails. Is there a new way to code the report task or another way to fixs this.

  • What went wrong: Execution failed for task ‘:testReport’. > java.io.FileNotFoundException: D:\repos..\core\build\test-results\binary\performanceTest\results.bin (The system cannot find the path specified)

Taks on all sub projects.

task performanceTest(type: Test) {
        include '**/*PerformanceTest.*'
      task integrationTest(type: Test) {
        include '**/*IntegrationTest.*'
performanceTest, integrationTest
  tasks.withType(Test) { task ->
        reports.html.destination = file("$buildDir/reports/$task.name")

Taks only in root project

task testReport(type: TestReport) {
    def tests = [];
    subprojects.each {project -> tests.add(project.tasks.withType(Test))}
    reportOn tests
    destinationDir = file("${buildDir}/reports/test")

(Luke Daley) #2

Thanks for trying the RC. I’ve raised GRADLE-2821 for this. A little early to call, but we’ll likely do a second RC. If so, this will be fixed.

btw, you can rewrite as:

task testReport(type: TestReport) {
    subprojects {
        reportOn { tasks.withType(Test) }
    destinationDir = file("${buildDir}/reports/test")

(Eivind Brandth Smedseng) #3

Thanks for the tip :slight_smile:

(Luke Daley) #4

Here’s a workaround for the time being:

task testReport(type: TestReport) {
    doFirst {
        testResultDirs = testResultDirs.findAll { new File(it, "results.bin").exists() }

(Eivind Brandth Smedseng) #5

Thank you :slight_smile: My build works now on RC1