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

LCOV report misaligned after upgrade to Node 10.16 #111

Closed
oliversalzburg opened this issue Jun 5, 2019 · 8 comments · Fixed by istanbuljs/v8-to-istanbul#40
Closed

LCOV report misaligned after upgrade to Node 10.16 #111

oliversalzburg opened this issue Jun 5, 2019 · 8 comments · Fixed by istanbuljs/v8-to-istanbul#40
Labels

Comments

@oliversalzburg
Copy link

  • Version: 10.16.0
  • Platform: Windows 10 x64 / Amazon Linux

After upgrading to NodeJS 10.16, the coverage report is off. Here is an example:

10.15.3

image

10.16.0

image

I'm assuming a relation to nodejs/node#26579

@oliversalzburg
Copy link
Author

Node 12.4.0 works as expected again.

@bcoe
Copy link
Owner

bcoe commented Jun 7, 2019

@oliversalzburg unfortunately Node 10 has some bugs that don't exist in 11 or 12 ... and it's fairly tricky to back-port. It might be worth keeping this open just in case there is a clear cause that jumps out looking at the underlying coverage reports.

@bcoe bcoe added the bug label Jun 7, 2019
@oliversalzburg
Copy link
Author

What can I do to help? Is this even the right place for the report or should it be reported in the NodeJS tracker?

@bcoe
Copy link
Owner

bcoe commented Jun 7, 2019

@oliversalzburg here is a fine place to report 👍 I theoretically work on Node.js any ways 😝 (although haven't had much time to do so lately).

Would happily accept help on this issue, or on other issues on c8. To debug this sort of issue I usually look at the raw output from V8, which is placed in coverage/tmp -- looking at the delta between Node 10 and Node 12 can be a good way to see what's off.

@bcoe
Copy link
Owner

bcoe commented Jun 7, 2019

... unfortunately, to actually fix what's off it potentially means back-porting work from V8, which isn't always easy or possible. Would happily provide direction on these topics though.

@shinnn
Copy link
Contributor

shinnn commented Jun 7, 2019

@bcoe The real cause is not a Node.js 10 bug but https://github.com/istanbuljs/v8-to-istanbul/blob/4e926ba71682e49ea357026c36d9a3bf04331714/lib/v8-to-istanbul.js#L11-L15 , I think. v8-to-istanbul still assumes Node.js v10.6.0 uses a CJS wrapper to require files, although nodejs/node#26579 is merged.

The possible solution is,

- const isNode10 = !!process.version.match(/^v10/)
+ const isOlderNode10 = /^v10\.[0-5]/u.test(process.version)

@bcoe
Copy link
Owner

bcoe commented Jun 7, 2019

@shinnn good catch, I'd blanked on the fact that we corrected this issue; @oliversalzburg would you like to submit a patch for this?

@oliversalzburg
Copy link
Author

@bcoe Sorry, seems like I missed your message :( Thanks for taking care of it.

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

Successfully merging a pull request may close this issue.

3 participants