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

Coverage report aggregate to fail when a single project's coverage is below coverageMinimum #303

Open
jcallin opened this issue Feb 7, 2020 · 1 comment

Comments

@jcallin
Copy link

jcallin commented Feb 7, 2020

I have a project where I aggregate many subprojects under a root project. We have coverageMinimum set to 80% and scoverage is set to fail the build when a project is below this coverage.

I am not publishing individual project coverage reports because they are numerous and at many different paths, it's hard to view these artifacts on the CI system. Instead, I'm publishing the coverage report aggregate through which I can see individual project's coverage. Additionally, since scoverage 1.6.0 I can simply run coverageAggregate without running coverageReport in all subprojects first.

However, the coverageAggregate command does not fail when a single project is blow 80%, but rather when the root project's coverage falls below 80%. Would it be easy to add an option so that coverageAggregate fails when any project is below the minimum? This would allow users to view the failing project's coverage through the aggregate report rather than through individual reports and would be useful for projects which aggregate many subprojects.

As a workaround, I am running coverageAggregate before coverageReport on the root project so that I may view the failing subproject's code coverage through the aggregated report if it fails during the coverageReport task

@kitbellew
Copy link

@jcallin there's no way to split coverage by project (unless scoverage itself is modified), but since #253 you can specify minima by any combination of {total, package, file} * {statement, branch}.

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

No branches or pull requests

3 participants