Open CurryPseudo opened 2 years ago
Hi, thanks for raising this.
Do the <methods>
tags provide any relevant line coverage information? If we ignore them, would we miss anything?
I don't have much time to make changes to pycobertura but I'll happily review pull requests if you want to suggest a change.
Can you provide a sample coverage file that is causing this issue?
OK~ Here is a sample coverage file from a rust library, generated by https://github.com/mozilla/grcov https://github.com/CurryPseudo/rust-coverage/blob/main/cobertura.xml
OK~ Here is a sample coverage file from a rust library, generated by https://github.com/mozilla/grcov https://github.com/CurryPseudo/rust-coverage/blob/main/cobertura.xml
Thanks for sharing a coverage file. As far as I can tell, the lines under the xpath //coverage/packages/classes/class/methods
are redundant with the ones under //coverage/packages/classes/class/lines
so I don't think we're missing any per-line coverage data by only parsing the latter.
I ran pycobertura show
against the cobertura.xml
file you pointed me to, and it works fine:
pycobertura show issue-118.xml
Filename Stmts Miss Cover Missing
---------- ------- ------ ------- ---------
src/lib.rs 11 1 90.91% 14
TOTAL 11 1 90.91%
Can you share how you are getting the error Invalid coverage file: ...
?
Currently, pycobertura only accepet
But there are some cobertura outputs contain method infos like
The input like above will make pycobertura simply reporting error:
Invalid coverage file: ...
Could we just ignore the methods info?