-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences between coverage lcov
and py2lcov
for consideration
#318
Comments
One thing you might want to do, is to simply generate a differential report between the two. (There are obviously no source differences - so any differences in numbers are down to the tools.) You probably want to turn off function coverage as that will somewhat pollute the data given that py2lcov will report it but coverage.py wont (so will look like purely additions or deletions, depending on the direction of compare .... entirely predictable, and completely unhelpful). The differential report will call out all the inconsistencies. |
I'm very confused that you keep saying py2lcov will report function coverage data when for me it definitely does not and I don't see how it possibly can given that Anyway, here's the result of Adding --branch-coverage to the invocation gives me
which is the aforementioned nedbat/coveragepy#1846 issue. |
For the first question: if the tool can find the source file, then it parses the file to find function decls (...making some assumptions about indentation rules). It then generates a function coverage record, claiming that the function is hit as many times as the first line in the function was. For the second: if we have GIC and UIC lines, then 'A.lcov' is claiming that that there are line coverpoints in those locations. From your description: that seems not correct. Not sure why that happens (would need to look at testcase). For the third: you can tell the tool to |
Took a while (sorry) but I finally looked at the ABDiff data.
|
Forgot to mention: as the message indicates, you can add |
Not sure the current status of this issue - but I think that the recently added coverage data consistency checks should help to debug any lingering Coverage.py issues. |
I have been looking into the possibility of using lcov's genhtml to generate a custom coverage dashboard for https://github.com/MillionConcepts/pdr. This project is written in Python, so I'm experimenting with several different ways of converting coverage.py data to lcov; so far nothing has come out quite the way I want it. I think most of the problems I am having are bugs and lacunae in coverage.py, not lcov (see nedbat/coveragepy#1846) but I think some of the analysis I've produced may be useful to the lcov project anyway.
To reproduce the raw coverage.py database whose SQL dump I have attached, do the following:
Having done the above, I then generated an lcov-format coverage report two different ways:
coverage lcov
(A.lcov in the attached diff)py2lcov
(equivalent tocoverage xml
followed byxml2lcov
AFAICT) (B.lcov in the attached diff)and normalized both for comparison purposes as follows:
I believe that all remaining differences in the output indicate a bug in something. I'm pretty sure the radical differences in BRDA records are the aforementioned nedbat/coveragepy#1846 and related, but I'm not sure what's up with the DA record differences.
Please note the absence of function coverage records in B.lcov, contra #317 (comment).
coverage+linemax.sql.gz
lcov-gen-comparison.diff.gz
The text was updated successfully, but these errors were encountered: