| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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.
There was a problem hiding this comment.
This "pins" the NGO version of the unified NetcodeConfig to avoid having one auto-created.
Sorry, something went wrong.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4122 +/- ##
==============================================
Coverage 78.01% 78.02%
==============================================
Files 153 153
Lines 26254 26260 +6
==============================================
+ Hits 20483 20489 +6
Misses 5771 5771
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Sorry, something went wrong.
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
| # Unified (NGO + N4E) validation, on demand. | ||
| # This job allows the Unified tests to be kicked off by commenting "/ci unified". | ||
| # This is useful for PRs where pr_code_changes_checks doesn't trigger. | ||
| unified_pr_checks: |
There was a problem hiding this comment.
I'm not sure if we really need this part if those tests will run on each PR anyway (part of pr_code_changes_checks)
Sorry, something went wrong.
There was a problem hiding this comment.
The triggers are removed in #4137
Sorry, something went wrong.
| # alpha (unified_editors in project.metafile) rather than a supported editor, because it needs an | ||
| # editor that bundles a com.unity.netcode with the unified API. Expect it to need a pin bump | ||
| # whenever N4E lands breaking changes in trunk. See .yamato/unified-tests.yml. | ||
| - .yamato/_run-all.yml#run_all_unified_tests |
There was a problem hiding this comment.
So those tests are not included by default in any other job? Like usual package tests?
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
| commands: | ||
| # Swap in the manifest that pulls in com.unity.netcode (N4E). This is what causes UNIFIED_NETCODE | ||
| # to be defined and therefore what makes the unified tests compile at all. | ||
| - cp {{ project.path }}/Packages/manifest-unified.json {{ project.path }}/Packages/manifest.json |
There was a problem hiding this comment.
Why we can't update our current manifest already? Would it require to move completely to testing on 6000.7?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah... it would require us to remove all of the earlier editor versions.
We can do that, but we might wait until after all of the initial unified testing is done before switching over completely.
But based on yesterday's conversation we might hold off in case we decide to support 6000.3.
Sorry, something went wrong.
There was a problem hiding this comment.
I'm fine with merging this as it's now and then we will adjust once we switch compleately to 6000.7
Sorry, something went wrong.
| # to be defined and therefore what makes the unified tests compile at all. | ||
| - cp {{ project.path }}/Packages/manifest-unified.json {{ project.path }}/Packages/manifest.json | ||
| # The committed lock was resolved against a supported editor, not the unified alpha. | ||
| - rm -f {{ project.path }}/Packages/packages-lock.json |
There was a problem hiding this comment.
I think we already got rid of all package-lock.json so maybe we can remove this line?
Sorry, something went wrong.
There was a problem hiding this comment.
Good catch.
Sorry, something went wrong.
| - rm -f {{ project.path }}/Packages/packages-lock.json | ||
|
|
||
| - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor # Installing basic editor for tests execution | ||
| - UnifiedTestRunner --testproject={{ project.path }} --suite=playmode --artifacts-path=test-results --editor-location=.Editor --testfilter="{{ unified_test_filter }}" --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} |
There was a problem hiding this comment.
Do we only support PlayMode tests? (otherwise it would be --suite=editor --suite=playmode)
Sorry, something went wrong.
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Removed command to delete packages-lock.json from unified tests.
There was a problem hiding this comment.
From my side it's ok to merge this in the current state and then I will do a follow-up later to clean it up (once we switch to 6000.7 only testing)
Sorry, something went wrong.
…environment-var develop-3.x.x now carries PR #4122 as a single squashed commit, so the four unified files this branch also changes conflicted against their own squashed history rather than against new work. Conflict resolutions: - .yamato/project.metafile: kept this branch's deletion of unified_test_filter. The squash reintroduced it; selection is the UNIFIED_TESTS environment variable plus NetcodeIntegrationTest.UseUnifiedTests now. - .yamato/unified-tests.yml: kept this branch's version, which is the same job with the UNIFIED_TESTS variable and no --testfilter. - .yamato/_triggers.yml: took develop-3.x.x (drops a stray blank line). - NetcodeIntegrationTest.cs: took develop-3.x.x's TODO-UNIFIED tag rename. Incoming: the SceneManagementSynchronizationTests rework that distinguishes scene events from connection events and adjusts the m_UseCmbService path, which is the CMB service test fix, plus the U-PR bot config.
| Back | FazBrowse Home | New Git URL |
Purpose of this PR
Stands up a dedicated CI job that runs the unified (NGO + N4E) hybrid-prefab integration tests, and
fixes the three bugs that were preventing UnifiedNetworkTransformTest from passing.
This is the first part of 3 PRs:
Additional unified netcode hybrid testing details
The pin for unified testing is 6000.7.0a5, not 6000.7.0a2 due to conflicts between the two.
The original plan was to pin a2 (breakpoints are more reliable there). a2 turns out to be unusable —
it cannot compile the unified code at all. Both alphas bundle com.unity.netcode 6.7.0, so the
package version does not distinguish them; only the trunk snapshot does. Verified by reading the
sources bundled in each editor:
UnifiedNetcodeTransport is gated on #if UNIFIED_NETCODE && OUT_OF_BAND_RPC and needs both.
Separately, a2 still names the component GhostAdapter; a5 renamed it to GhostObject, which is what
the test helpers call. Two independent blockers, so a2 is off the table regardless of debugger quality.
Runtime fixes
SystemBase. Without override that is a new method Entities never calls, so neither
RequireForUpdate took effect and OnUpdate ran from the first world tick — before
StartClient/StartServer assign Transport and NetworkManager. CreateSingleWorldHost calls
AppendWorldToCurrentPlayerLoop, so the world is live immediately and any tick in that window was a
NullReferenceException. Corrected to the parameterless override, plus a null guard in OnUpdate.
Object.Instantiate. The hybrid prefab is active, so the clone's GhostObject.Awake runs
synchronously inside Instantiate; the clone is not a prefab, so Awake acquires an entity reference
and resolves the target world from that singleton. N4E's rate managers reassign it on every world
update, so it pointed at whichever client world updated last and the spawn was rejected with
"You can only spawn a ghost on a server or during prediction on a client." Assignment hoisted above
Instantiate.
which is the normal ordering in integration tests. Now returns early on a null NetworkManager.
CreateHybridPrefab also now calls GhostObject.InitializeAsPrefab() instead of hand-rolling the
GhostPrefabReference setup, which picks up N4E's try/finally reset of s_IsPostProcessing.
UnifiedNetworkTransformTest was hardened: position is validated on initial spawn as well as after
the move, and the fixed WaitForSeconds(1) is replaced with WaitForConditionOrTimeOut reporting
which client diverged and by how much.
Tradeoffs worth reviewer attention
than the N4E entry: manifest.json pins the builtin versions that exist on 6000.6
(addressables 2.11.1, timeline 6.6.0, ugui 2.6.0), which do not resolve on 6000.7.0a5. That
means hand-syncing two manifests until N4E becomes a hard NGO dependency, at which point this goes
away. I could not find a way to avoid the duplication without dropping 6000.6 support.
name, which covers the dedicated fixtures and is intended to also cover shared fixtures
parameterized with HostOrServer.UnifiedHost/UnifiedServer. An NUnit [Category] would be less
fragile once more fixtures gain unified variants; there is no [Category] usage in the package today
and UnifiedTestRunner's --category support is unconfirmed, so this is deliberately deferred.
wired the same way as the CMB service tests. That puts an unsupported alpha editor into the mandatory
gate: when N4E lands breaking changes in trunk this goes red and the pin has to be bumped before any
PR can go green. Chosen deliberately over an opt-in trigger so unified breakage is noticed
immediately. unified_pr_checks (/ci unified) remains for PRs the main gate does not cover.
unified_netcode_version, and the com.unity.netcode version in manifest-unified.json.
Known gap: the CI job runs editor playmode; verification so far is a standalone player run.
See Testing & QA below.
Jira ticket
MTT-XXXX
Documentation
All changes are either CI configuration, test helpers, or runtime code behind #if UNIFIED_NETCODE,
which cannot be defined without com.unity.netcode installed. There is no public API surface change
and no behaviour change for any current NGO user.
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
A standalone player build containing only UnifiedNetworkTransformTest runs green locally
(Windows, Mono, 6000.7.0a5). Before the three fixes above this failed with
SetUp : Failed to start instances plus a NullReferenceException immediately after
"Starting a world for Host".
Also unverified: that com.unity.netcode: 6.7.0 resolves to the builtin copy from
manifest-unified.json on a clean checkout (locally it was added by hand to manifest.json), and that
Yamato accepts the new YAML.
Automated tests:
UnifiedNetworkTransformTest already existed; this PR fixes what it was failing on and strengthens its
assertions. The new coverage is at the CI level — the test now actually runs in CI, which it never did
before, since UNIFIED_NETCODE was never defined in any existing job.
Does the change require QA team to:
No QA involvement requested: this is CI infrastructure plus an experimental code path that is compiled
out of every shipping configuration.
Up-port
Not needed. This PR targets develop-3.x.x directly. The unified API does not exist in NGO v2.x, and
all runtime changes are behind UNIFIED_NETCODE, which cannot be defined there.
Backports
Not needed, for the same reason — this is specific to the NGOv3.X unified work.