Skip to content

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Feb 12, 2022

This PR migrates the runtime integration test helper classes into their own assembly in order to improve upon collaboration and standardization of writing Netcode for GameObject integration tests. This also includes additional modifications for some tests (to leverage from new features) in order to get them passing on all non-Desktop platforms.

This also includes an overhaul on the NetcodeIntegrationTest (formerly known as BaseMultiInstanceTest) that provides more functionality/flexibility depending upon your preferred style of writing integration tests.

MTT-2435

Testing and Documentation

Console Build:

This PR also has been consistently passing console builds.

Create the new com.unity.netcode.testhelpers assembly.
Migrate SIPTransport into the new assembly.
Migrate MultiInstanceHelpers and BaseMultiInstanceTest into com.unity.netcode.testhelpers
Updating the NGO assembly.
excluding unet if it is not present.
Migrated NetworkManagerHelper and NetworkVariableHelper into Unity.Netcode.TestHelpers.

Updated tests that used these classes to use the Unity.Netcode.TestHelpers namespace.
Renaming MultiInstance to NetcodeIntegration.
So:
BaseMultiinstanceTest -> NetcodeIntegrationTest
MultiInstanceHelpers -> NetcodeIntegrationTestHelpers

This will probably change as I migrate some of NetcodeIntegrationTestHelpers into NetcodeIntegrationTest.
Fixes for UNetTransport exclusion and added additional support for UTP in command line handler.
Removed all references to NetcodeIntegrationTestHelpers.Run within tests.
Preparing NetcodeIntegrationTest.WaitForConditionOrTimeOut to be used in placed of the NetcodeIntegrationTestHelpers.WaitForCondition
Missed a few references to NetcodeIntegrationTestHelpers.Run
Testing only runtime references to this assembly and adding UnityEngine.TestRunner and NUnit library.
renaming the assembly to better clarify that these test helpers are only for runtime integration tests.
This includes the core changes to NetworkSceneManager, integration test helper classes, and the scene handler integration test.
Updated all of the rest of the tests that were modified in PR-1405
Missed an update in NetworkScenemanagerTests
Merging #1691 into this branch ahead of it being merged to continue working on mtt-2435 while it waits to get approved.
Migrate multiplayer tools helper classes out of Unity.Netcode.Runtime assembly and into the Unity.Netcode.TestHelpers.Runtime assembly.
@NoelStephensUnity NoelStephensUnity requested review from a team February 15, 2022 00:07
NoelStephensUnity and others added 6 commits February 14, 2022 20:10
Fixed the issue with two versions of IntegrationTestSceneHandler.
Updated the NetcodeIntegrationTest to be able to run all tests contained within a derived class using the same NetworkManager instances (i.e. doesn't spin up a NetworkManager per UnityTest)
Added additional functionality to the setup and teardown process.
Minor addition to creating a player prefab that doesn't require passing an action to the StartSomeClientsAndServerWithPlayers method (which will be broken up into phases).
Migrating most of the editor serialization test methods into runtime tests.
Added pre and post teardown virtual methods.
Fixed issues with the tools project SceneEventTests (still need to look through this more to make sure each scenario is being tested properly).
NoelStephensUnity and others added 5 commits February 24, 2022 18:54
…ectMetricsTests.cs

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
using optionalUnityReferences.
Removed using system from the wrong file.
Reverting the suggested change.
disabling the Transform interpolation test as it is not stable and needs to be re-thought through.
@0xFA11 0xFA11 changed the title fix: mtt-2435 and integration test cleanup fix: integration test cleanup Feb 25, 2022
@0xFA11 0xFA11 changed the title fix: integration test cleanup fix: refactor integration test infra, re-enable testproject-tools-integration, fix flaky tests on desktop & console platforms Feb 25, 2022
minimal conversion of TransformInterpolationTests to new NetcodeIntegrationTest.
Adding host or server selection capabilities to reduce code replication for this common task.
Merge updates.
Refactored the RpcMessageHooks to be more generic and renamed it to MessageHooksConditional.  It allows for (n) number of message types to be assigned to (x) number of clients. Updated the tests that utilize the message hooks.
renaming TimeOutHelper to TimeoutHelper.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review February 25, 2022 22:54
finishing the thought on the m_NetworkObject comment
white space fix
removed system namespace.
@0xFA11 0xFA11 enabled auto-merge (squash) February 26, 2022 13:54
@0xFA11 0xFA11 merged commit dca06fd into develop Feb 26, 2022
@0xFA11 0xFA11 deleted the fix/mtt-2435-and-integration-test-cleanup branch February 26, 2022 14:44
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.

3 participants