Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print Coverage Total for All Projects #6

Open
apsoyka opened this issue Aug 24, 2017 · 2 comments
Open

Print Coverage Total for All Projects #6

apsoyka opened this issue Aug 24, 2017 · 2 comments

Comments

@apsoyka
Copy link

apsoyka commented Aug 24, 2017

This feature would be helpful when working with GitLab CI, which expects a single coverage value and therefore uses only the last project's coverage value as the total coverage value.

@louth
Copy link

louth commented Apr 30, 2018

This is achievable provided you combine your coverage tool's coverage reports into a single coverage report and then configure the console-reporter in the top level build.gradle to access it, like this:

consoleReporter {
    jacoco {
        reportFile = ["${buildDir}/reports/jacoco/test/jacocoTestReport.xml"]
    }
}

@amimas
Copy link

amimas commented Jun 29, 2018

I also need a "Total Coverage" for all projects but can't seem to get this to work. If I run gradlew clean build, I automatically get the coverage of each of the Gradle sub projects' coverage.

I added a separate task that aggregates the reports from all sub projects and creates a separate single coverage report. I can view this combined report from "rootProjectDir/build/reports/jacoco/rootCoverageReport/rootCoverageReport.xml"

I configured this plugin based on the recommendation mentioned above by pointing reportFile to above mentioned path, but if I run reportJacoco task, the "Coverage summary" section still shows 0.0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants