unbroken-dome / gradle-testsets-plugin

A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
MIT License
230 stars 50 forks source link

Jacoco integration test report does not include groovy spock tests #111

Closed adithshenoy closed 4 years ago

adithshenoy commented 4 years ago

Folder structure:

As seen in the image below, java tests come in the jacoco coverage. However, groovy spock testcases are being ignored.

image

Code:

testSets {
    integrationTest
}

test {
    testLogging { events "passed", "skipped", "failed", "standardError" }
}

integrationTest {
    testLogging { events "passed", "skipped", "failed", "standardError" }
}

jacocoTestReport {
    reports {
        xml.enabled true
    }
}

jacocoIntegrationTestReport {
    reports {
        xml.enabled true
    }
}
tkrullmann commented 4 years ago

I tried to reproduce this with a simple Spock test and the coverage was reported fine. In any case, the plugin doesn't really integrate deeply with Jacoco, all it does is set up a JacocoReport task for each test set (which seems to work here, as the jacocoIntegrationTestReport task is available). So if there is any bug, it is likely with the Gradle Jacoco plugin or Spock.