Minimum coverage by group check
I added support for coverage checking by group since we needed it for our project and noticed there was an open issue about it. This feature is useful as we’re gradually increasing test coverage across our app, so we can enforce coverage checks on specific parts. Here’s an example of how to use it from the README.
SimpleCov.minimum_coverage_by_group 'Models' => 80, 'Controllers' => 60
# same as above (the default is to check line coverage)
SimpleCov.minimum_coverage_by_group 'Models' => { line: 80 }, 'Controllers' => { line: 60 }
# check for a minimum line and branch coverage for 'Models' and 'Controllers' groups
SimpleCov.minimum_coverage_by_group 'Models' => { line: 90, branch: 80 }, 'Controllers' => { line: 60, branch: 50 }
Lovely! This is also helpful when enabling the new coverage for eval. So we can enable coverage for erb files without dropping the global coverage.
This would be a very welcome change indeed!
Any updates regarding this pull request?
@PragTob This additional functionality for setting minimum coverage by group would be very valuable. We're currently restructuring our Rails monolith to group functionality via Packwerk packages, allowing us to track overall coverage as well as per-package coverage separately via groups. Being able to systematically ratchet down coverage requirement on a per-package basis would be amazing. Would you mind looking into this PR?
@PragTob @amatsuda hey guys, any chance it can be reviewed and merged?
WANT
That'd be an awesome feature.
What's the state of this PR? Would be super cool
Hey @amatsuda, what's blocking this PR from being merged?