pytest-cov icon indicating copy to clipboard operation
pytest-cov copied to clipboard

Add support for LCOV output

Open fetzerch opened this issue 3 years ago • 4 comments

Coverage.py 6.3 gained support for the LCOV output format. Add support for this to pytest-cov via --cov-report=lcov[:dest].

Fix: #535

My main motivation was that coveralls currently only supports LCOV in their GitHub Action. But since LCOV is a widely adopted format I think there might be more benefits of adding this to pytest-cov.

I've tried to follow CONTRIBUTING.rst, let me know if you want me to add/change anything.

~Update: The second commit is unrelated, but fixes the check pipeline.~

fetzerch avatar May 27 '22 09:05 fetzerch

Hello, sorry for tardy response - can you rebase on the master? The CI was cleaned up.

ionelmc avatar Jul 22 '22 09:07 ionelmc

@ionelmc if I remember correctly there were some discussions if this plugins should even do any kind of reporting instead of relying on coverage.py itself (to avoid feature duplication and extra complexity).

ssbarnea avatar Jul 25 '22 08:07 ssbarnea

There was but unless we remove all the reporting we can't really say "no we can't support another reporter" since it would be so inconsistent in both features and policy.

ionelmc avatar Jul 25 '22 08:07 ionelmc

If we look to remove them, we should first stop adding new ones, especially when these can easily be covered by coverage tool itself. That would avoid having someone invest time trying to implement a feature that will (hopefully soon) be removed. Better to tell people to use a more future-proof way of achieving their goal.

ssbarnea avatar Jul 25 '22 10:07 ssbarnea

Isn't this just telling coverage.py to generate the lcov.xml file for us? All I use pytest-cov for is to tell coverage.py to do things for me when running pytest. Is there another point to this plugin other than that?

fwiw, I'm using pytest+pytest-cov to run unit tests from vscode and to generate coverage data that is displayed by Koverage and coverage-gutters plugins. the standard coverage.py coverage.xml file is not parsed by them entirely correctly (they prefer lcov.xml), although they are aware of potential need to support the coverage.py coverage.xml format (https://github.com/ryanluker/vscode-coverage-gutters/issues/224).

MarximusMaximus avatar Sep 22 '22 23:09 MarximusMaximus

Yeah we should stop adding stuff but if we don't have reporting parity it makes pytest-cov less desirable. This doesn't look like it complicates things a lot anyway.

ionelmc avatar Sep 28 '22 14:09 ionelmc