Skip to content

test: implement extra features on top of existing NetworkUpdateLoopTests to cover other test cases #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2021

Conversation

0xFA11
Copy link
Contributor

@0xFA11 0xFA11 commented Mar 9, 2021

extending existing NetworkUpdateLoopTests implementation further so that it covers:

  • Verify NetworkUpdateStage.FixedUpdate runs an equal number of times with MonoBehaviour.FixedUpdate
    • Assert.AreEqual(netUpdates[kNetFixedUpdateIndex], monoUpdates[kMonoFixedUpdateIndex]);
  • Verify NetworkUpdateStage.Update runs an equal number of times with MonoBehaviour.Update
    • Assert.AreEqual(netUpdates[kNetPreUpdateIndex], monoUpdates[kMonoUpdateIndex]);
  • Verify NetworkFixedUpdate runs before MonoBehaviour.FixedUpdate
    • Assert.AreEqual(monoUpdates[kMonoFixedUpdateIndex] + 1, netUpdates[kNetFixedUpdateIndex]);
  • Verify NetworkPreUpdate and NetworkUpdate runs before MonoBehaviour.Update
    • Assert.AreEqual(monoUpdates[kMonoUpdateIndex] + 1, netUpdates[kNetPreUpdateIndex]);
  • Verify NetworkPreLateUpdate runs before MonoBehaviour.LateUpdate
    • Assert.AreEqual(monoUpdates[kMonoLateUpdateIndex] + 1, netUpdates[kNetPreLateUpdateIndex]);
  • Verify NetworkPostLateUpdate runs after MonoBehaviour.LateUpdate
    • Assert.AreEqual(netUpdates[kNetPostLateUpdateIndex], netUpdates[kNetPreLateUpdateIndex]);
  • Verify an INetworkUpdateSystem can NOT be registered and get updated twice per NetworkUpdateStage execution
    • // intentionally try to register for 'PreUpdate' stage twice
    • // it should be ignored and the instance should not be registered twice
    • // otherwise test would fail because it would call 'OnPreUpdate()' twice
    • // which would ultimately increment 'netUpdates[idx]' integer twice
    • // and cause 'Assert.AreEqual()' to fail the test
    • this.RegisterNetworkUpdate(NetworkUpdateStage.PreUpdate);

@0xFA11 0xFA11 changed the title test: implement extra features on top of existing tests to cover other test cases test: implement extra features on top of existing NetworkUpdateLoopTests to cover other test cases Mar 9, 2021
@0xFA11 0xFA11 changed the title test: implement extra features on top of existing NetworkUpdateLoopTests to cover other test cases test: implement extra features on top of existing NetworkUpdateLoopTests to cover other test cases Mar 9, 2021
@mattwalsh-unity mattwalsh-unity merged commit 44cfa29 into release/0.1.0 Mar 9, 2021
@mattwalsh-unity mattwalsh-unity deleted the test/netloop-ordering branch March 9, 2021 16:36
mattwalsh-unity added a commit that referenced this pull request Mar 9, 2021
* revert: Add NetworkAddress and NetworkPort properties to Transport. (#512) (#529)

This reverts commit feea3c1.

* test: expose runtime internals to runtime tests asmdef (#534)

* ci: enable yamato on PRs targeting master, develop and release/* branches (#535)

* ci: enable yamato on PRs targeting the release/0.1.0 branch

* update branch targets: master, develop, release/*

* replace 'release/*' regex match with 'release/*' pattern match

* ci: enable conventional PR checks on PRs targeting release branches (#536)

* ci: enable conventional PR checks on release branches

* remove release/* wildcard since release/** covers all

* fix: Correctly collecting and drawing counters on dynamic modules (#539)

* refactor: Improve error messages for NetworkPrefab list. (#538)

* refactor: Refactor spawncall and improve error handling for client side spawning (#537)

* fix: re-fix yamato release branch wildcard regex (#542)

* fix: NetworkWriter.WriteObjectPacked to call WriteBool instead of WriteBit when serializing bool object (#541)

* fix: revert Application.isPlaying check in NetworkScenePostProcess (#550)

* test: implement test for NetworkUpdateLoop injecting NetworkUpdateStages into the PlayerLoop (#554)

* initial wip

* implement networkupdatestage injection test

* refactor: rename spawn/destroy register/unregister methods (#551)

* test: implement extra features on top of existing NetworkUpdateLoopTests to cover other test cases (#559)

* implement extra features on top of existing tests to cover other test cases too

* minor update

Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: Jean-Sébastien Fauteux <js.fauteux@unity3d.com>
Co-authored-by: Luke Stampfli <43687322+LukeStampfli@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