Skip to content

test: add networkscenemanager additive scene loading tests#1076

Merged
NoelStephensUnity merged 3 commits intodevelopfrom
feat/AdditiveScenes
Aug 23, 2021
Merged

test: add networkscenemanager additive scene loading tests#1076
NoelStephensUnity merged 3 commits intodevelopfrom
feat/AdditiveScenes

Conversation

@0xFA11
Copy link
Copy Markdown
Contributor

@0xFA11 0xFA11 commented Aug 23, 2021

I managed to break PR #1030 — so, I'm fixing and putting this up for review again :)
It's owned by @NoelStephensUnity (sorry!)


This includes the unit testing for additive scene loading using multi-instances.
It includes a minor adjustment to NetworkSceneManager to handle unit testing with multi-instances.
This removes the legacy Runtime NetworkSceneManagerTest and migrates the check for assert when EnableSceneManagement is set to false into the new NetworkSceneManagerTests.

Current Tests:

  • 1 host and 9 clients loading a scene additively and then unloading it in unit test mode. This tests the scene event messaging and local notification pipelines for loading and unloading additive scenes. (see NetworkSceneManagerTests)
  • Tests the various exception cases to assure if EnableSceneManagement is not set an exception is thrown or if a client attempts to start a load or unload scene event an exception is thrown
  • Verifies that a scene event cannot be started during an already in progress scene event
  • Verifies that trying to unload a scene not already loaded returns the appropriate failed unload status
  • Verifies that trying to load a scene name for a scene that does not exist (is not registered) returns the appropriate failed to start scene event status.

Comment on lines +99 to +100
// TODO: Remove `m_IsRunningUnitTest` entirely after we switch to multi-process testing
// In MultiInstance tests, we cannot allow clients to load additional scenes as they're sharing the same scene space / Unity instance.
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.

in the previous PR #1030, @andrews-unity and @LukeStampfli approved this PR and I also do approve this PR too.
please feel free to approve your own PR @NoelStephensUnity and merge it in :)

Adding check for unit testing at the end of OnClientUnloadScene to determine if we need to just passthrough to the callback (for multiInstance unit testing only)

Fixing minor issue with NetworkObject not being around after unloading a scene for NetworkPrefabPool.
Copy link
Copy Markdown
Member

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

After the last minor adjustments, this PR is good to go.

@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) August 23, 2021 20:36
@NoelStephensUnity NoelStephensUnity merged commit d6d4bd0 into develop Aug 23, 2021
@NoelStephensUnity NoelStephensUnity deleted the feat/AdditiveScenes branch August 23, 2021 20:50
SamuelBellomo added a commit that referenced this pull request Aug 26, 2021
…hub.com:Unity-Technologies/com.unity.multiplayer.mlapi into sam/feature/interpolation-for-network-transform

* 'sam/feature/interpolation-for-network-transform' of github.com:Unity-Technologies/com.unity.multiplayer.mlapi:
  test: NetworkTransformStateTests no longer uses ReplNetworkState (#1084)
  fix: networkmanager prefab validation and no scene management manual test (#1073)
  feat: snapshot. MTT-1088 Snapshot acknowledgment gaps (#1083)
  feat: Add a test to validate registration of metric types (#1072)
  chore!: Remove unsupported UNET Relay behavior (MTT-1000) (#1081)
  fix: 2+ inheritance from network behaviour causes compilation exception (#1078) (#1079)
  test: add networkscenemanager additive scene loading tests (#1076)
mollstam pushed a commit to Keepsake-Games/com.unity.netcode.gameobjects that referenced this pull request Feb 13, 2023
…hnologies#1076)

* redo Unity-Technologies#1030

* comment a todo for `m_IsRunningUnitTest`

* test project

Adding check for unit testing at the end of OnClientUnloadScene to determine if we need to just passthrough to the callback (for multiInstance unit testing only)

Fixing minor issue with NetworkObject not being around after unloading a scene for NetworkPrefabPool.

Co-authored-by: NoelStephensUnity <73188597+NoelStephensUnity@users.noreply.github.com>
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