-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Bug] Lines are marked as covered in lcovonly
, but they are not executed
#37
Comments
I drop the Looks odd that lines can have full coverage while branches and functions are not fully covered. But, as it was mentioned, I do not understand |
Seems there is a bug in
By the way, do you have the opportunity to use codecov instead of codacy, because the report |
Yes, |
Indeed, it is tempting to switch to Codecov. I saw links in your readme and was comparing Codecov's and Codacy’s reports. Generating Anyway, I though it might help to report a bug as well. |
Interesting. I was looking through Codacy's documentation, apparently internally they have their own protocol similar to Codecov. See here: https://api.codacy.com/swagger#tocscoveragereport It is possible to upload coverage in that format via API endpoint: https://api.codacy.com/swagger#savecoverage I will drop them a line asking, if they could make it possible uploading |
Good found, I didn't notice this before. Maybe I could provide build-in {
reports: [
[path.resolve('./test/custom-v8-reporter.js'), {
type: 'v8',
outputFile: 'custom-v8-coverage.json'
}]
]
} https://github.com/cenfun/monocart-coverage-reports/blob/main/test/custom-v8-reporter.js codecov example: |
Thanks! Meanwhile I have send a feature request to Codacy: codacy/codacy-coverage-reporter#506 |
@cenfun I have just spotted another issue related with static initialization blocks. Might be it already got fixed in the commit you have push. Here is Below you can find |
Ah.. Here raw {
"1": 1,
"3": 1,
"4": 293, // correct
// skipped line 5, so much correct!
"6": 293, // correct
"7": 293, // correct
"8": 4358, // hm.. and what is this?
"9": "1/2",
"10": 0,
"11": 0,
"12": 293,
"14": 890,
"15": 890,
"16": 890,
"18": 1303,
"19": 1303,
"20": 1303,
"22": 849,
"23": 849,
"25": 849,
"26": 849,
"27": 849,
"29": 849,
"30": 849,
"32": 612,
"33": 612,
"34": 612,
"35": 1,
} |
Great. I've also tried uploading a Codacy-formatted JSON but wasn't successful. Otherwise, we could provide built-in Codacy report, just like Codecov.
Yes. It should be fixed, see commit. A patch will be released, and I still have several other issues to solve together.
BTW, I have contributed MCR to c8 as an experimental feature, you can use it like below in the latest version. c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js |
@mrazauskas It should be fixed. Please try [email protected] |
Thanks. Yes, it works now. Closing this issue. I hope to find some time to play with Codacy’s API today or tomorrow. Let’s see. And thanks once again for creating this library! |
@mrazauskas Sorry, seems that I missed a question. {
"1": 1,
"3": 1,
"4": 293, // correct
// skipped line 5, so much correct!
"6": 293, // correct
"7": 293, // correct
"8": 4358, // hm.. and what is this?
"9": "1/2", For line 8, there are two parts:
Currently, it take the maximum hits as the hits of the line. Does this make sense? |
Ah.. That makes sense now. I thought function executions will be marked on line 4. If V8 reports these on line 8, that is perfectly fine. |
Describe the bug
lcovonly
andv8
reports are generated. All is marked correctly inv8
(great UI, by the way):The
lcov
report is uploaded to Codacy and in their UI one can see that line which was not executed (test are running on Ubuntu, so theelse
branch is not reachable) got marked as covered:Here is data for this file from
lcov.info
:I do not understand this data unfortunately. Hopefully it helps to understand, if Codacy’s report is correct or not?
To Reproduce
Expected behavior
Same output in both reports.
Additional context
Codacy coverage report can be seen here: https://app.codacy.com/gh/tstyche/tstyche/coverage/files/117115485336?bid=42144053&fileBranchId=42144053
The text was updated successfully, but these errors were encountered: