ExtendedLocalCoverage

Documentation for ExtendedLocalCoverage.

This package extends the functionality of LocalCoverage by providing a generate_package_coverage which calculate local coverage using LocalCoverage.generate_coverage but providing the following different features:

  • It exploits Revise to automatically extract the included files in the target package and only checks coverage on those files.
  • It uses pycobertura (installed via CondaPkg.jl) to generate the coverage report in HTML format.
    • This does not require users to have lcov installed on their system and also works on Windows machines.

The main reason for the creation of this package is simplifying assessing coverage on private repositories (specifically on gitlab) which do not have easy access to tools like codecov.

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.

Installation

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")

Usage

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
generate_package_coverage()

See the developer documentation for more details.

Contributors