Skip to content

ci: Split code coverage into Package Test and Project Test jobs#4101

Open
unity-nikos wants to merge 3 commits into
develop-2.0.0from
ci/add/code-coverage-project-test
Open

ci: Split code coverage into Package Test and Project Test jobs#4101
unity-nikos wants to merge 3 commits into
develop-2.0.0from
ci/add/code-coverage-project-test

Conversation

@unity-nikos

@unity-nikos unity-nikos commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Purpose of this PR

Splits the code coverage Yamato config into two focused jobs so coverage is measured for both the package's own tests and the in-repo testproject:

  • Converts the existing Code Coverage - NGO [ubuntu, 6000.3] job into [Code Coverage] Package Test - NGO [ubuntu, trunk] (id code_coverage_package_test_ubuntu_trunk). Same coverage command as before; editor moved to trunk.
  • Adds [Code Coverage] Project Test - NGO testproject [ubuntu, trunk] (id code_coverage_project_test_testproject_ubuntu_trunk) — a single instance that runs the testproject EditMode/PlayMode tests with coverage enabled (deps run_quick_checks + package-pack, matching project-tests.yml).

Trigger wiring in _triggers.yml — both coverage jobs run together on:

  • PR changes (pr_code_changes_checks) — replaces the old code_coverage_ubuntu_{{ validation_editors.default }} reference.
  • Nightly (develop_nightly).

(Neither job runs in the weekly trigger.)

Both jobs stay single-instance (Ubuntu, trunk) since coverage doesn't vary meaningfully across platforms/editors.

Jira ticket

TODO: link ticket (e.g. MTT-XXXX)

Changelog

Not applicable — CI-only change, no package/public-facing changes.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Rendered every .yamato/*.yml through a local Liquid renderer and verified:

  • Both new jobs template to valid YAML with the expected ids/names.
  • All trigger references to the coverage jobs resolve (PR + nightly, for both jobs).
  • The Project Test job's run_quick_checks dependency exists in _run-all.yml.

Final verification is the Yamato jobs themselves running green on this PR.

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

Up-port

TODO: link the develop-3.0.0 up-port PR, or state if not needed (does the same code-coverage.yml structure exist on develop-3.0.0?).

Backports

TODO: link any backport PR (e.g. develop), or state if not needed.

🤖 Generated with Claude Code

Convert the existing coverage job to [Code Coverage] Package Test - NGO [ubuntu, trunk] and add [Code Coverage] Project Test - NGO testproject [ubuntu, trunk]. Wire Package Test into PR/nightly triggers and Project Test into the weekly run.
@codecov-github-com

codecov-github-com Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@                Coverage Diff                @@
##           develop-2.0.0    #4101      +/-   ##
=================================================
+ Coverage          66.40%   73.87%   +7.46%     
=================================================
  Files                163      172       +9     
  Lines              24999    28013    +3014     
=================================================
+ Hits               16601    20695    +4094     
+ Misses              8398     7318    -1080     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu_trunk 73.66% <ø> (?)
NGOv2_ubuntu_trunk 66.43% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 67 files with indirect coverage changes

Components Coverage Δ
com.unity.netcode.gameobjects 73.87% <ø> (+7.46%) ⬆️

ℹ️ Need help interpreting these results?

@unity-nikos
unity-nikos marked this pull request as ready for review July 24, 2026 14:24
@unity-nikos
unity-nikos requested review from a team, EmandM and NoelStephensUnity as code owners July 24, 2026 14:24
Comment thread .yamato/code-coverage.yml Outdated
# [Code Coverage] Package Test runs on PR changes (pr_code_changes_checks) and nightly (develop_nightly)
# [Code Coverage] Project Test runs on PR changes (pr_code_changes_checks) and nightly (develop_nightly)

{% assign editor = "trunk" -%}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind using the pinnedTrunk variable we have in project.metafile?

Occasionally trunk breaks our tests so we have a pinned "safe" version for PRs. We update the pinned version fairly regularly. Our nightly and weekly tests run on actual trunk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ce72070

@unity-nikos
unity-nikos requested a review from EmandM July 24, 2026 16:26
@unity-nikos

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-07-24 at 17 28 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants