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

feat: introduce flags for line and form coverage thresholds #343

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

krikitti
Copy link

@krikitti krikitti commented Feb 16, 2024

Fixes #344

Introduce flags --line-fail-threshold and --form-fail-threshold for the option to handle the two coverages separately. Build will fail if line coverage is below --line-fail-threshold or form coverage is below --form-fail-threshold.

Ignore new flags if --fail-threshold is non-zero in which case the build fails if either line or form coverage is below fail-threshold (same as before).

  • You've updated the changelog (if adding/changing user-visible functionality)

@krikitti krikitti marked this pull request as ready for review February 16, 2024 15:09
@krikitti
Copy link
Author

@vemv Cloud you please review this?

@vemv
Copy link
Contributor

vemv commented Feb 28, 2024

It would help us to understand, what would be a typical use case for this?

If there's one that's easy to understand, it would seem worthwhile adding it to the readme

@krikitti
Copy link
Author

It would help us to understand, what would be a typical use case for this?

If there's one that's easy to understand, it would seem worthwhile adding it to the readme

@vemv Thanks for getting back to me! The use case for our project is that the form coverage is pretty low at the moment due to some macros, but our line coverage is high enough for our standards. Until we can raise the form coverage (if we ever do that), we would like to set the line and form thresholds separately to check that at least our line coverage is up to standards in all our repos. Apart from the description of the new flags in the readme, should I describe this use case as well?

@vemv
Copy link
Contributor

vemv commented Feb 29, 2024

Thanks!

A brief description like this one should suffice Sometimes, line coverage is high while form coverage isn't as high, so setting a high line coverage requirement can help maintaining an existing standard.

Copy link
Contributor

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions

cloverage/src/cloverage/coverage.clj Show resolved Hide resolved
cloverage/src/cloverage/coverage.clj Show resolved Hide resolved
Co-authored-by: vemv <vemv@users.noreply.github.com>
@krikitti
Copy link
Author

krikitti commented Mar 1, 2024

@vemv Thanks for the suggestions, please check my latest commits with the added unit test, the updated readme and the added :pre you suggested.

(@imrekoszo fyi)

@krikitti krikitti force-pushed the handle-line-form-separately branch from a6b98e6 to 3871a34 Compare March 1, 2024 12:30
Copy link
Contributor

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me - great work!

(Note: I don't have write access. I was pinged so here's my review)

cloverage/test/cloverage/coverage_test.clj Show resolved Hide resolved
@krikitti
Copy link
Author

krikitti commented Mar 4, 2024

Hi @lvh, do you have write access to this repo? If yes, could you please review this PR? thanks in advance!

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

Successfully merging this pull request may close these issues.

Feature request to add the option of setting threshold for line and form coverages separately
3 participants