Skip to content

Conversation

@JasonXuDeveloper
Copy link
Owner

@JasonXuDeveloper JasonXuDeveloper commented Jan 30, 2026

Summary

  • Add "Fix coverage paths" step to both pr-tests.yml and release.yml
  • Uses sed to strip /github/workspace/ prefix from all coverage XML files before Codecov upload
  • Logs sample paths after fix for debugging (using find for reliable recursive matching)
  • Add assemblyFilters:+JEngine.* to unity-tests.yml to include JEngine package assemblies in coverage collection

Root Cause

Two issues were causing Codecov to report "unusable" coverage:

1. Path Mismatch

Unity test runner generates coverage XML inside Docker with absolute paths:

<File uid="1" fullPath="/github/workspace/UnityProject/Assets/..." />

Codecov expects paths relative to repo root:

<File uid="1" fullPath="UnityProject/Assets/..." />

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

  1. Path preprocessing: Strip /github/workspace/ prefix using sed before upload
  2. Assembly filter: Add assemblyFilters:+JEngine.* to include JEngine assemblies

Test plan

  • Verify coverage uploads succeed (31.51% coverage now showing)
  • Verify JEngine assemblies are included in coverage
  • After merge, verify future PRs show patch coverage

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings January 30, 2026 04:16
@github-actions github-actions bot added the ci label Jan 30, 2026
Copy link

Copilot AI left a 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.yml and release.yml workflows
  • Uses sed to 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.

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Unity Test Results

EditMode: All tests passed
PlayMode: All tests passed

Unity Version: 2022.3.55f1
Project Path: UnityProject

✅ All tests passed! The PR is ready for review.

View workflow run

Click here to view the full workflow run

@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) January 30, 2026 04:21
JasonXuDeveloper and others added 2 commits January 30, 2026 15:22
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>
Copilot AI review requested due to automatic review settings January 30, 2026 04:28
Copy link

Copilot AI left a 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>
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 30, 2026
Copy link

@github-actions github-actions bot left a 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).

@JasonXuDeveloper JasonXuDeveloper merged commit 8d8ff35 into master Jan 30, 2026
17 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the fix/codecov-path-preprocessing branch January 30, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants