https://github.com/umbrellio/coverspector
This package helps to check that code coverage above minimum value. It can be useful in CI or git hooks.
https://github.com/umbrellio/coverspector
Last synced: about 1 year ago
JSON representation
This package helps to check that code coverage above minimum value. It can be useful in CI or git hooks.
- Host: GitHub
- URL: https://github.com/umbrellio/coverspector
- Owner: umbrellio
- License: mit
- Created: 2019-11-18T14:17:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T21:22:29.000Z (over 5 years ago)
- Last Synced: 2025-04-09T16:01:59.211Z (about 1 year ago)
- Language: PHP
- Size: 69.3 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coverspector
[](https://github.com/umbrellio/coverspector/actions)
[](https://coveralls.io/github/umbrellio/coverspector?branch=master)
[](https://packagist.org/packages/umbrellio/coverspector)
[](https://packagist.org/packages/umbrellio/coverspector)
[](https://scrutinizer-ci.com/code-intelligence)
[](https://scrutinizer-ci.com/g/umbrellio/coverspector/build-status/master)
[](https://scrutinizer-ci.com/g/umbrellio/coverspector/?branch=master)
This package helps to check that code coverage above minimum value. It can be useful in CI or git hooks.
## Features
- Fail CI/hook when code coverage is less than minimal value.
- Print list of uncovered files
## Installation
Run this command to install:
```bash
composer require umbrellio/coverspector
```
## Usage
Allow coverage toll to print info about uncovered files.
In case of phpunit, add to phpunit config:
```
addUncoveredFilesFromWhitelist="true"
```
In case of codeception:
```yml
show_uncovered: true
```
In your CI, dump coverage output into file
```bash
vendor/bin/codecept run --coverage | tee coverage.txt
```
Than, run coverspector with minimum code coverage value
```bash
vendor/bin/coverspector --file=coverage.txt --min=100
```
If coverage will be less, coverspector will fail the job and print list of all not totaly covered files
## CI Coverage Artifacts
If you still want to save coverage report as CI artifact - you should set
```
when: on_failure
```
in your CI config.
## License
Released under MIT License.
## Authors
Created by Makin Vladislav.
## Contributing
- Fork it ( https://github.com/umbrellio/coverspector )
- Create your feature branch (`git checkout -b feature/my-new-feature`)
- Commit your changes (`git commit -am 'Add some feature'`)
- Push to the branch (`git push origin feature/my-new-feature`)
- Create new Pull Request