# 1.7 RC - TestReport fails if test were skipped

**URL:** <https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891>\
**Category:** Old Forum Archive\
**Created:** [July 3, 2013, 7:50am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891 "2013-07-03T07:50:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eivind\_Brandth\_Smeds](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/eivind_brandth_smeds/32/477_2.png) [@Eivind\_Brandth\_Smeds](https://discuss.gradle.org/u/Eivind_Brandth_Smeds)\
**Post date:** [July 3, 2013, 7:50am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891/1 "2013-07-03T07:50:00Z")

</div>

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.

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

```

Taks only in root project

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

```

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [July 3, 2013, 9:35am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891/2 "2013-07-03T09:35:00Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![Eivind\_Brandth\_Smeds](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/eivind_brandth_smeds/32/477_2.png) [@Eivind\_Brandth\_Smeds](https://discuss.gradle.org/u/Eivind_Brandth_Smeds)\
**Post date:** [July 3, 2013, 9:40am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891/3 "2013-07-03T09:40:00Z")

</div>

Thanks for the tip 🙂

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [July 3, 2013, 9:49am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891/4 "2013-07-03T09:49:00Z")

</div>

Here’s a workaround for the time being:

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

```

---

<div class="post-metadata">

**Author:** ![Eivind\_Brandth\_Smeds](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/eivind_brandth_smeds/32/477_2.png) [@Eivind\_Brandth\_Smeds](https://discuss.gradle.org/u/Eivind_Brandth_Smeds)\
**Post date:** [July 3, 2013, 9:59am UTC](https://discuss.gradle.org/t/1-7-rc-testreport-fails-if-test-were-skipped/1891/5 "2013-07-03T09:59:00Z")

</div>

Thank you 🙂 My build works now on RC1
