-
Notifications
You must be signed in to change notification settings - Fork 29
FEC-61 Codecov Coverage Reports #3815
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
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3815 +/- ##
=======================================
Coverage ? 76.10%
=======================================
Files ? 272
Lines ? 7115
Branches ? 2305
=======================================
Hits ? 5415
Misses ? 1674
Partials ? 26
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
15eb9f8 to
115ab2c
Compare
ByronDWall
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.
I think that tracking code coverage is a good addition, and this is a good start at implementation. I also have a few concerns which I think merit some discussion before we move forward
|
11/12/2025 - per Carlos: |
d90d560 to
dd5b7cc
Compare
| exclude: [ | ||
| '**/*.spec.js', | ||
| '**/*.spec.tsx', | ||
| '**/*.spec.ts', | ||
| '**/*.spec.jsx', | ||
| '**/*.test.js', | ||
| '**/*.test.tsx', | ||
| '**/*.test.ts', | ||
| '**/*.test.jsx', | ||
| '**/node_modules/**', | ||
| '**/test-utils/**', | ||
| ], |
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.
Excludes test files from Istanbul coverage instrumentation. Coverage reports should only measure application code, not test code.
| // Workaround for Radix UI CSS selector parsing issues in JSDOM | ||
| // Radix UI generates invalid CSS selectors that cause JSDOM to throw errors | ||
| if (typeof window !== 'undefined') { | ||
| const originalGetComputedStyle = window.getComputedStyle; | ||
| window.getComputedStyle = function (element, pseudoElement) { | ||
| try { | ||
| return originalGetComputedStyle.call(this, element, pseudoElement); | ||
| } catch (error) { | ||
| // Return a mock CSSStyleDeclaration for CSS parsing errors | ||
| // This prevents tests from crashing due to invalid Radix UI selectors | ||
| if (error.message && error.message.includes('not a valid selector')) { | ||
| return { | ||
| getPropertyValue: () => '', | ||
| length: 0, | ||
| item: () => null, | ||
| [Symbol.iterator]: function* () {}, | ||
| }; | ||
| } | ||
| throw error; | ||
| } | ||
| }; | ||
| } |
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.
The workaround doesn't remove selectors - it catches CSS parsing errors that occur when JSDOM's CSS parser (nwsapi) encounters the malformed selectors that Radix UI generates.
What the workaround does:
The window.getComputedStyle workaround in setup-test-framework.js:
- Wraps the original function in a try-catch block
- Catches CSS parsing errors when JSDOM tries to parse invalid selectors like 'h2#radix-,,,Ara,,,A :focus-visible'
- Returns a mock CSSStyleDeclaration object instead of throwing an error
- Only affects test environments (JSDOM), not production
What it doesn't do:
- It doesn't remove or modify the selectors themselves
- It doesn't prevent Radix UI from generating the malformed selectors
- It doesn't affect how the components render in tests
- It doesn't affect production behavior at all
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.
Approving as I pushed up 2 changes that got the PR passing but haven't looked into how to view the dashboard for the overall PR.

Per this Chapter task we're adopting a tool called Codecov in order to see code coverage across our repos. With Codecov it will compare branches with main and make sure we maintain certain percentage thresholds in test coverage. We'll be able to see which parts of the code need improvement and prevent too much uncovered code from making it into
main. Per this RFC this tool has now been approved. We're starting with MC App Kit and have everything configured already in this branch and its reporting to Codecov. However, in order to see the complete suite of data display options in the Codecov Dashboard we need this code inmain.Percentage thresholds have not yet been added so merging this PR will not prevent other PRs from being merged yet due to low coverage. This is just to complete a POC so we can see all the features Codecov offers and make our decision about how to roll out to the other repos.