babeuloula / phpunit-coverage-checker
PhpUnit coverage checker, fail if coverage goes below a threshold
Installs: 1 714
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- ext-simplexml: *
This package is auto-updated.
Last update: 2024-12-12 21:30:14 UTC
README
This script will read the XML coverage result and calculates the coverage score. Based on the given threshold the script will exit(0) if the coverage is higher than the threshold or exit(1) if the coverage is lower than the threshold.
Installation
composer require --dev babeuloula/phpunit-coverage-checker
Usage
vendor/bin/coverage-checker <path/to/coverage/index.xml> <threshold>
Example:
./vendor/bin/phpunit --coverage-xml ./coverage vendor/bin/coverage-checker coverage/xml/index.xml 80
Thanks
Thanks to richardregeer and cylab.be.