-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
ci: migrate from nyc to c8 #11759
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
ci: migrate from nyc to c8 #11759
Conversation
WalkthroughMigrates CI coverage tooling from nyc to c8: updates Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CI as CI runner
participant Shell as Shell
participant Tests as Test script
Note over CI,Shell: Previous flow (nyc)
CI->>Shell: run "npx nyc npm run test:ci"
Shell->>Tests: npm run test:ci (instrumented by nyc)
Tests-->>Shell: test results + nyc output
Shell-->>CI: exit status + coverage artifacts
Note over CI,Shell `#DDEEFF`: Updated flow (c8)
CI->>Shell: run "npx c8 npm run test:ci"
Shell->>Tests: npm run test:ci (instrumented by c8)
Tests-->>Shell: test results + c8 output
Shell-->>CI: exit status + coverage artifacts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
|
We were going to switch to Vitest in the future, is this change necessary? |
TLDR: not absolutely necessary but should bring immediate CI speed improvement Vitest is used to use c8 (no using native v8 coverage), but seems that migration will take a while. And this should bring immediate benefit of speeding up CI. It's a drop in replacement so not a lot of work to do it and not much to remove it in the future... I fired it up to do a quick comparison (c8 vs nyc)
Two random runs is not enough to calculate fair speed improvement, but it shaves off 10-20s, which is not bad given how little effort it is to do it. And migration to vitest might take a while given how little progress has been made so far: master...next |
|
I wonder why the coverage CI/CD part is skipped |
It's not. It just wait for all tests to fininsh: https://github.com/typeorm/typeorm/blob/master/.github/workflows/commit-validation.yml#L67 Its a good question though why oracle on linux started to fail now... |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks great to me 👍
|
Can you please add html reporter? |
|
Looks like lcov already provides html report. After testing it generates 0 coverage, which is no good. Can you please investigate what's wrong? |
|
At least it generate 0 coverage on my machine. |
|
Switching back to |
Yes, I am investigating. But I can't get the tests pass on my local machine :/ Testing with mysql-9... |
OSA413
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked until fixed
|
This PR would be nice to have if the reporting gets fixed. Currently, |
|
After adding |
|
I'm still wondering why the coverage is marked as skipped though all tests are passed/failed. |
|
@OSA413 That's nice, thanks! Do you happen to know where does the extra 4% coverage comes from? BTW, Both |
|
I think that C8 can handle/track more things, that's why the coverage changed. |
Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>
Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>


Description of change
Replace nyc with faster alternative c8 - a newer, faster alternative that uses Node.js's native V8 coverage.
Pull-Request Checklist
masterbranchFixes #00000Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.