-
Notifications
You must be signed in to change notification settings - Fork 340
fix(ci): preprocess coverage paths before Codecov upload #606
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
Add step to strip /github/workspace/ prefix from coverage XML files before uploading to Codecov. The Unity test runner generates absolute paths from the Docker container, which Codecov cannot match to repo files. The codecov.yml `fixes` section wasn't being applied reliably, so preprocessing the files directly is more robust. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
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.
Pull request overview
This PR fixes Codecov path reporting issues by preprocessing coverage XML files before upload. Unity's test runner generates coverage files with absolute Docker container paths (/github/workspace/...) that Codecov cannot match to repository files. The solution strips this prefix using sed directly in the CI workflow, which is more reliable than depending on Codecov's server-side path fixing.
Changes:
- Added "Fix coverage paths" step to both
pr-tests.ymlandrelease.ymlworkflows - Uses
sedto strip/github/workspace/prefix from all coverage XML files - Added debugging output to log sample paths after the fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/pr-tests.yml |
Added path preprocessing step before Codecov upload in PR test workflow |
.github/workflows/release.yml |
Added path preprocessing step before Codecov upload in release workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Unity Test Results✅ EditMode: All tests passed Unity Version: 2022.3.55f1 ✅ All tests passed! The PR is ready for review. View workflow run |
Replace bash glob pattern with find command for reliable recursive file matching without needing shopt -s globstar. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Add assemblyFilters:+JEngine.* to coverageOptions so Unity Code Coverage includes JEngine.Core, JEngine.Util, and JEngine.UI assemblies. Previously only Assembly-CSharp and other default assemblies were being collected. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Document the process for addressing code review comments: fix, commit, reply, and resolve conversations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
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.
Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes).
Summary
pr-tests.ymlandrelease.ymlsedto strip/github/workspace/prefix from all coverage XML files before Codecov uploadfindfor reliable recursive matching)assemblyFilters:+JEngine.*tounity-tests.ymlto include JEngine package assemblies in coverage collectionRoot Cause
Two issues were causing Codecov to report "unusable" coverage:
1. Path Mismatch
Unity test runner generates coverage XML inside Docker with absolute paths:
Codecov expects paths relative to repo root:
2. Missing JEngine Assemblies
Unity Code Coverage was only collecting default assemblies (Assembly-CSharp, etc.) but not the JEngine package assemblies (JEngine.Core, JEngine.Util, JEngine.UI).
Solution
/github/workspace/prefix using sed before uploadassemblyFilters:+JEngine.*to include JEngine assembliesTest plan
🤖 Generated with Claude Code