coverage icon indicating copy to clipboard operation
coverage copied to clipboard

Add `--fail-under` option

Open saroad2 opened this issue 2 years ago • 0 comments

Description

While generating coverage reports is super important, in order to use coverage in CI workflows, sometimes you want to enforce a certain coverage percentage.

Python's coverage library do that using the --fail-under flag which cause the coverage method to fail if coverage percentage is under than expected.

API

Simply add the --fail-under flag to the coverage execution with the desired coverage percentage. For example, --fail-under=90 will enforce at least 90% coverage and --fail-under=100 will enfore total coverage (100%).

saroad2 avatar Feb 19 '23 13:02 saroad2