https://github.com/colcon/colcon-coveragepy-result
A colcon extension for collecting coverage.py results
https://github.com/colcon/colcon-coveragepy-result
colcon
Last synced: 4 months ago
JSON representation
A colcon extension for collecting coverage.py results
- Host: GitHub
- URL: https://github.com/colcon/colcon-coveragepy-result
- Owner: colcon
- License: apache-2.0
- Created: 2020-05-09T13:54:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-25T22:25:39.000Z (over 1 year ago)
- Last Synced: 2026-01-06T00:30:14.855Z (6 months ago)
- Topics: colcon
- Language: Python
- Homepage: https://colcon.readthedocs.io/
- Size: 43.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colcon-coveragepy-result
[](https://pypi.org/project/colcon-coveragepy-result/)
[](https://github.com/colcon/colcon-coveragepy-result/actions/workflows/ci.yaml?query=branch%3Amaster+event%3Apush)
A [colcon](https://colcon.readthedocs.io/) extension for collecting [coverage.py](https://coverage.readthedocs.io/en/stable/) results.
It provides the `coveragepy-result` command.
## Install
The corresponding package names are:
* `apt`: `python3-colcon-coveragepy-result`
* `pip`: `colcon-coveragepy-result`
Refer to the [colcon installation instructions](https://colcon.readthedocs.io/en/released/user/installation.html) for more information.
## Usage
1. Build packages with coverage, e.g. using a [colcon mixin](https://colcon.readthedocs.io/en/released/reference/verb/mixin.html) for [coverage](https://github.com/colcon/colcon-mixin-repository/blob/master/coverage.mixin) (installation of the mixin is separate from this extension)
```shell
$ colcon build --mixin coverage-pytest
```
1. Test packages with coverage, again using a mixin
```shell
$ colcon test --mixin coverage-pytest
```
1. Collect coverage results using the `coveragepy-result` command provided by this extension
```shell
$ colcon coveragepy-result
```
1. Open HTML report, which by default is under `coveragepy/htmlcov/`
## Options
* Print coverage reports for each package and a combined coverage report of all packages
```shell
$ colcon coveragepy-result --verbose
```
* Provide additional arguments for reports generation, e.g. to show lines without coverage
```shell
$ colcon coveragepy-result --coverage-report-args -m
```
* Provide additional arguments for HTML report generation, e.g. to skip files with no code
```shell
$ colcon coveragepy-result --coverage-html-args --skip-empty
```
* For more options
```shell
$ colcon coveragepy-result --help
```
## Contributing
See:
* [*Contributions*](https://colcon.readthedocs.io/en/released/developer/contribution.html) for guidelines
* [*Bootstrap from source*](https://colcon.readthedocs.io/en/released/developer/bootstrap.html) to test the package from source