This package simply extends the functionality of LocalCoverage.jl by adding the following features:
- Automatically extract the source files for the provided package using
Revise.parse_pkg_files
. - Automatically create an xml cobertura coverage and an html report using
pycobertura
.- The
pycobertura
library is automatically installed and used thanks toCondaPkg.jl
andPythonCall.jl
, not requiring the user to manually install python orlcov
which is only available on non-windows systems.
- The
This package was mainly created to provide easier access to code coverage within a private self-hosted gitlab instance, where codecov can not be used as is, but an HTML coverage report can be directly integrated within the gitlab web interface.
It is also convenient for getting an HTML coverage report locally without always relying on codecov from GH actions.
You can see an example of the generated HTML coverage report here, which was generated by calling generate_package_coverage(; force_paths_relative = true)
on the PlutoPlotly.jl package.
The package is not currently registered in General, so you need to add it to your environment by doing:
] add https://github.com/disberd/ExtendedLocalCoverage.jl
or
import Pkg
Pkg.add(url="https://github.com/disberd/ExtendedLocalCoverage.jl")
For the basic usage which automatically extracts source files (including extensions) and generates the coverage report both in xml and html format, you can simply do the following (within the env of the package you are developing and making sure you have ExtendedLocalCoverage.jl in the LOAD_PATH
):
using ExtendedLocalCoverage
cov_data = generate_package_coverage();
See the developer documentation for more details.
If you use ExtendedLocalCoverage.jl in your work, please cite using the reference given in CITATION.cff.
If you want to make contributions of any kind, please first that a look into our contributing guide directly on GitHub or the contributing page on the website