-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable build failure when code coverage is below threshold #7228
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,6 +333,31 @@ | |
<outputDirectory>${project.reporting.outputDirectory}/test-coverage</outputDirectory> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>check</id> | ||
<goals> | ||
<goal>check</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<rule> | ||
<element>BUNDLE</element> | ||
<limits> | ||
<limit> | ||
<counter>LINE</counter> | ||
<value>COVEREDRATIO</value> | ||
<minimum>0.18</minimum> | ||
</limit> | ||
<limit> | ||
<counter>BRANCH</counter> | ||
<value>COVEREDRATIO</value> | ||
<minimum>0.09</minimum> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth extracting these two minimum values out to properties so that child poms may overwrite this (in the future when we start setting a valid minimum and libraries need to opt-out for a valid reason)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, updated this to use properties and also customized the threshold for a couple of storage modules that had really low coverage to:
|
||
</limit> | ||
</limits> | ||
</rule> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonathanGiles is this particular change going to require us to up the version and re-release the parent pom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JimSuplizio since this change only introduces a check to fail the build when test coverage is low, it's not end user-facing. So, version update and re-release is not necessary.