chore: unified hybrid tests enabled environment var - #4137
Open
NoelStephensUnity wants to merge 10 commits into
Open
chore: unified hybrid tests enabled environment var#4137NoelStephensUnity wants to merge 10 commits into
NoelStephensUnity wants to merge 10 commits into
Conversation
Adding an additional unified hybrid spawning test pass.
Fixed: - Issue with NetworkObject throwing an exception during hybrid integration test. - Issue with setting the active world prior to spawning a hybrid prefab during integration tests. - Issue with UnifiedNetcodeUpdateSystem not overriding the OnCreate method along with checks for a valid NetworkManager and/or transport within OnUpdate. - Issues (minor) with the original UnifiedNetworkTransformTest. - Adjustments to the NetcodeIntegrationTest that assures the correct active world is assigned when spawning.
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
…est filter Unified selection now lives in C# instead: - unified-tests.yml sets UNIFIED_TESTS=true and passes no --testfilter; unified_test_filter is removed from project.metafile. - NetcodeIntegrationTest.UseUnifiedTests() (virtual, defaults to false) is the opt-in a fixture overrides to run in a unified pass. USE_CMB_SERVICE still takes precedence. - Adds IgnoreIfUnifiedTestsEnvironmentVariableSetAttribute and the matching NetcodeIntegrationTestHelpers.IgnoreIfUnifiedTestsEnvironmentVariableSet() so fixtures that do not apply under unified netcode opt out explicitly. - Applies that opt-out across the package and testproject fixtures that do not need to run against hybrid prefabs.
NoelStephensUnity
marked this pull request as ready for review
August 20, 2026 11:52
5 tasks
Removed comments regarding unified tests and their dependencies.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4137 +/- ##
=================================================
- Coverage 78.01% 77.92% -0.10%
=================================================
Files 153 153
Lines 26254 26260 +6
=================================================
- Hits 20483 20463 -20
- Misses 5771 5797 +26
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Base branch:
chore/enable-unified-hybrid-tests(#4122) — notdevelop-3.x.x— merge #4122 before this.Follow-up to #4122, which added the unified (NGO + N4E) hybrid prefab test job. That first step
selected which tests ran by passing a name pattern to UTR (
unified_test_filter). This PR replacesthat pattern with test selection defined in C#, so the YAML no longer decides what runs.
This is the first part of 3 PRs:
UniversalNetworkTransformTestis the only opt-in for 4137 ). 4137 also removes a bunch of the YAML comment verbosity along with other script file comments.What replaces the test filter from 4122. The job now sets
UNIFIED_TESTS: "true"and passes no--testfilter(
unified_test_filteris deleted fromproject.metafile).NetcodeIntegrationTestapplies threerules, all under
#if UNIFIED_NETCODE, so nothing changes when N4E is absent:IgnoredWithoutUnifiedTestsReasonNotOptedInForUnifiedTestsReasonIgnoredForUnifiedTestsReasonSupporting pieces:
ApplyUnifiedTestFilter(HostOrServer)for tests that takeHostOrServeras a test methodparameter rather than a fixture argument.
OneTimeSetupruns once per fixture and cannot see amethod parameter, so those fixtures call this themselves before starting any instances.
NetworkVariableTestsis the case in this PR.IgnoreIfUnifiedTestsEnvironmentVariableSetAttributeplusNetcodeIntegrationTestHelpers.IgnoreIfUnifiedTestsEnvironmentVariableSet()for fixtures that donot derive from
NetcodeIntegrationTest. The attribute respectsRunState.NotRunnablefirst so itcannot resurrect a test another attribute already excluded.
USE_CMB_SERVICEalways wins. Distributed authority and hybrid prefab spawning cannot be thesame run, so a CMB service pass forces unified off.
OnOneTimeTearDown.GetUnifiedTestsEnvironmentVariable()also honours aUNIFIED_TESTScompile define, which is whatmakes a local run possible without setting the variable in the editor's environment.
saying to remove the opt-out if the test is later updated to support them.
Also in here: two missing
$prefixes on interpolatedLog.Errorstrings inNetworkManager.UnifiedIsConfiguredCorrectly, which were logging a literal{nameof(NetCodeConfig)}.Jira ticket
MTT-XXXX
Changelog
Not relevant — CI and test-infrastructure only. The one runtime edit is an error-message fix in
unified code that is not yet publicly released.
Documentation
The reasoning that used to live in the
project.metafilecomment block now lives with the code itgoverns: the
UseUnifiedTestsandApplyUnifiedTestFilterXML docs explain why hybrid prefab casesare opt-in and why a method-parameter
HostOrServerneeds separate handling.Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual tests:
Manual testing done— runtime tests rebuilt and run locally; the suite is green.Automated tests:
Covered by existing automated testsThe change is itself test infrastructure, so the verification is the shape of the run rather than a
new test: in a unified pass,
UnifiedNetworkTransformTestruns and everything else reports asignored with one of the three reasons above; in a normal pass, nothing is ignored and the suite
behaves exactly as it did before this PR. Both are visible in the UTR results XML.
Does the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Up-port
Not needed. This targets the #4122 branch on the
develop-3.x.xline, and the unified API existsonly there.
Backports
Not needed, same reason.