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

Add CLI support for coverage thresholds #43

Closed
4 tasks done
matm opened this issue Mar 9, 2023 · 0 comments
Closed
4 tasks done

Add CLI support for coverage thresholds #43

matm opened this issue Mar 9, 2023 · 0 comments
Assignees
Labels
enhancement in progress Currently being worked on
Milestone

Comments

@matm
Copy link
Owner

matm commented Mar 9, 2023

Rationale

Would allow to only add functions/methods whose code coverage is lower or greater than threshold values.

For example, the strings package in the standard library have only 12 functions/methods with a code coverage < 100%.
Using a CLI flag -cmax 97 would add those 12 functions only into the generated HTML output.

Setting a threshold value can be useful to quickly find what is left for testing and generate the HTML output faster.

Example

$ gocov test strings | gocov-html -cmax 97
  • Add a -cmax flag (default: 100) stating "only show functions whose coverage is less than cmax"
  • Add a -cmin flag (default: 0) stating "only show functions whose coverage is more than cmin"
  • Only take into account functions/methods whose code coverage is lower than the max value. Same regarding min value.
  • Update README documentation
@matm matm added this to the 1.4.0 milestone Mar 9, 2023
@matm matm self-assigned this Mar 9, 2023
@matm matm added the in progress Currently being worked on label May 17, 2023
@matm matm changed the title Add CLI support for coverage threshold Add CLI support for coverage thresholds May 20, 2023
matm added a commit that referenced this issue May 20, 2023
@matm matm closed this as completed in 4b0625f May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in progress Currently being worked on
Projects
None yet
Development

No branches or pull requests

1 participant