-
Notifications
You must be signed in to change notification settings - Fork 603
Add Codecov integration for coverage reporting #499
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
- Configure GitHub Actions to generate and upload coverage reports - Add codecov.yml with 85% project target and 80% patch target - Add Codecov badge to README - Upload coverage only on Node.js 20.x to avoid duplicates - Configure coverage thresholds: 85% for project, 80% for patches - Add PR coverage diff comments via Codecov 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Summary of ChangesHello @theturtle32, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces Codecov integration into the project's CI/CD pipeline. The primary goal is to automate code coverage reporting, enforce minimum coverage standards for both the entire codebase and new contributions, and provide clear coverage feedback directly in pull request comments. This enhancement aims to improve code quality and maintainability by ensuring new code is adequately tested. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces Codecov for coverage reporting, which is a great addition for maintaining code quality. The configuration in codecov.yml is well-structured. I've provided a few suggestions to refine the setup: one to improve the accessibility of the new README badge, and two for the codecov.yml file to reduce PR comment noise and improve consistency with your Vitest coverage configuration.
README.md
Outdated
|
|
||
| [ ](https://codeship.com/projects/61106) | ||
|
|
||
| [](https://codecov.io/gh/theturtle32/WebSocket-Node) |
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.
For better accessibility and clarity, it's good practice to use more descriptive alt text for the Codecov badge. I suggest changing it from codecov to code coverage.
| [](https://codecov.io/gh/theturtle32/WebSocket-Node) | |
| [](https://codecov.io/gh/theturtle32/WebSocket-Node) |
codecov.yml
Outdated
| comment: | ||
| layout: "reach,diff,flags,tree" | ||
| behavior: default | ||
| require_changes: no |
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.
| - "test/**" | ||
| - "examples/**" | ||
| - "bench/**" | ||
| - "docs/**" | ||
| - "scripts/**" | ||
| - "**/*.test.mjs" | ||
| - "**/*.test.js" | ||
| - "**/*.bench.mjs" |
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 vitest.config.mjs file excludes lib/version.js from coverage reporting. To maintain consistency and ensure Codecov's report accurately reflects what's being tested, it's a good practice to also add this file to the ignore list here.
- "test/**"
- "examples/**"
- "bench/**"
- "docs/**"
- "scripts/**"
- "lib/version.js"
- "**/*.test.mjs"
- "**/*.test.js"
- "**/*.bench.mjs"- Updated Codecov badge alt text to "code coverage" for accessibility - Set require_changes: yes to reduce PR comment noise - Added lib/version.js to ignore list for consistency with vitest config - Updated codecov-action from v4 to v5 per Codecov documentation - Simplified codecov-action configuration (v5 auto-detects coverage files) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Node.js 18.x and 20.x: Run tests without coverage - Node.js 22.x: Run tests with coverage and upload to Codecov - Avoids running tests twice on the same version 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Summary
Changes
Coverage Configuration
Setup Required
After merging, the repository owner needs to:
CODECOV_TOKENto GitHub repository secretsTest Plan
🤖 Generated with Claude Code