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

Unblock Node upgrade by adding arbitrary c8 ignores #4234

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

Vinnl
Copy link
Collaborator

@Vinnl Vinnl commented Feb 21, 2024

With the upgrade to Node 20.10, suddenly it started reporting code as uncovered that was previously not, and most of which I'm fairly sure is actually covered by unit tests. I think it's probably caused by this issue, but it's fairly hard to debug. By running npm test -- --runInBand --no-cache (thanks @flozia) I was able to get consistent reports of uncovered lines, and thus was able to at least get back to a point where it's meeting the thresholds again - but hopefully this won't make it harder to find which new code we still need to write tests for in the future.

I did leave some more diagnostic information in the upstream issue, and it refers to a number of other people running into what seems to be the same issue, so hopefully they'll find a fix there before we run into it again.

Vinnl and others added 2 commits February 19, 2024 17:57
It looks like c8 is now inconsistent in what it reports as
uncovered, but these additions are probably still a good idea.
@Vinnl Vinnl added the Review: XS Code review time: up to 30min label Feb 21, 2024
@Vinnl Vinnl self-assigned this Feb 21, 2024
Copy link
Collaborator

@flozia flozia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already discussed: Ideally, we would need to understand why we suddenly see more uncovered lines after the Node upgrade. Best case: It’s fixed by the next version. Thanks for unblocking the Node upgrade!

The Node 20.10 upgrade suddenly started marking them as uncovered.
It's unclear what exactly the cause is, but there's a bug on file
that might be related:
istanbuljs/v8-to-istanbul#236
@Vinnl Vinnl merged commit 2ef458c into dependabot/docker/node-20.11-alpine Feb 21, 2024
5 of 6 checks passed
@Vinnl Vinnl deleted the c8-inconsistent branch February 21, 2024 14:58
Vinnl added a commit that referenced this pull request Mar 6, 2024
As we add code, more existing code suddenly gets marked as
uncovered by unit tests intermittently. This adds c8 ignore
comments for everything that turned up when running

   npm test -- --no-cache --runInBand

But I really hope this gets fixed upstream soon, because this isn't
sustainable.

For more context, see:
#4234

And the (hopefully correct) upstream issue:
istanbuljs/v8-to-istanbul#236
@Vinnl Vinnl mentioned this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: XS Code review time: up to 30min
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants