Skip to content
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

Merging multiple converted coverage reports together for the same file results in a mismatch between the number of properties in branchMap and b. #158

Open
JustinChristensen opened this issue Jul 3, 2021 · 1 comment
Labels

Comments

@JustinChristensen
Copy link

JustinChristensen commented Jul 3, 2021

I'm not really sure what the expected behavior here should be. I'm using Playwright to run tests and extract coverage reports from V8 for the same test run, and to then convert and merge them together using a coverage map (from istanbul-lib-coverage). .

v8-to-istanbul appears to only have branches that were covered in the v8 coverage report in it's branchMap. This causes the final merged coverage map to have a mismatch between the number of branches in the branchMap and the b hit counters, because of the way that FileCoverage merge is written.

Whether this should be fixed by making that merge routine (mentioned in the linked issue) smarter, or making v8toistanbul attempt to get all (including uncovered branches) in the branchMap for a given file, I can't say for sure.

@JustinChristensen JustinChristensen changed the title Merging multiple converted coverage reports together for the same file results in a mistmatch between the number of properties in branchMap and b. Merging multiple converted coverage reports together for the same file results in a mismatch between the number of properties in branchMap and b. Jul 5, 2021
@bcoe
Copy link
Member

bcoe commented Sep 7, 2021

@JustinChristensen one problem is that v8 output won't necessarily have all the same branch information, as it collapses together consecutive blocks.

I think this problem might be better solved by merging together the reports while they're in v8 format, which is what happens here.

The conversion from v8 to istanbul is a bit lossy (due to the merging) so I think it's challenging to solve at that layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants