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

The plugin does not print all the errors on failure #539

Open
satorg opened this issue Jun 5, 2024 · 1 comment
Open

The plugin does not print all the errors on failure #539

satorg opened this issue Jun 5, 2024 · 1 comment

Comments

@satorg
Copy link

satorg commented Jun 5, 2024

With coverageFailOnMinimum := true when the plugin encounters a metric that is failing, it prints just that metric and then halts.
However, if there are multiple metrics failing across the project, it requires multiple passes to be done to fix them all.
It is especially troublesome in big/large/huge projects with gazillions of tests to be run to gather all the results.

@satorg
Copy link
Author

satorg commented Jun 5, 2024

Most likely the culprit is CoverageMinimum, e.g.:

def checkCoverage(
metrics: CoverageMetrics,
metric: String
)(implicit log: Logger): Boolean = {
CoverageMinimum.checkCoverage(
s"Branch:$metric",
branch,
metrics.branchCoveragePercent
) &&
CoverageMinimum.checkCoverage(
s"Stmt:$metric",
statement,
metrics.statementCoveragePercent
)
}

Apparently, if the s"Branch:$metric" metric fails, the next one won't be looked into.

Similarly, these checks also execute up to the first failing one only:

val ok: Boolean = total.checkCoverage(coverage, "Total") &&
coverage.packages.forall(pkg =>
perPackage.checkCoverage(pkg, s"Package:${pkg.name}")
) &&
coverage.files.forall(file =>
perFile.checkCoverage(file, s"File:${file.filename}")
)

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

1 participant