From 9d780c1fcb3c59cf1e0bd9ed56a098de17807f4a Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 10:49:38 -0500 Subject: [PATCH 01/17] chore: Pass the unity version to the CMB service --- Tools/CI/service.cmb/run_cmb_service.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index 28b430662d..e9bd87eff3 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -89,6 +89,17 @@ logError(){ printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" } +# Unity Version ----------------------------------------------------------------- + +unity_version=sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' artifacts/TestResults.js + +# ensure arguments were passed and the ports are defined +if [ -z "$unity_version" ]; then + logMessage "Failed to find unity version: $unity_version! Using default string"; +elif [[ "$echo_port" == "$service_port" ]]; then + logMessage "Found Unity version: $unity_version"; +fi + # Protocol Buffer Compiler ------------------------------------------------------ # Apply any updates @@ -153,5 +164,5 @@ cargo build --release --locked # This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. logMessage "Running service integration tests..." while :; do - ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m; + ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; done & # <- use & to run the entire loop in the background From 6b9bdc3692c616b8ba89f9b686c12a46a5c3fd56 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 11:09:22 -0500 Subject: [PATCH 02/17] Swap a test to a CMB test for validation --- .../SceneObjectsNotDestroyedOnShutdownTest.cs | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs b/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs index ae2442ece8..fa2db5f4ce 100644 --- a/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs +++ b/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs @@ -10,6 +10,8 @@ namespace TestProject.RuntimeTests { + [TestFixture(HostOrServer.Host)] + [TestFixture(HostOrServer.DAHost)] public class SceneObjectsNotDestroyedOnShutdownTest : NetcodeIntegrationTest { protected override int NumberOfClients => 0; @@ -17,19 +19,16 @@ public class SceneObjectsNotDestroyedOnShutdownTest : NetcodeIntegrationTest private const string k_TestScene = "InSceneNetworkObject"; private const string k_SceneObjectName = "InSceneObject"; private Scene m_TestScene; - private WaitForSeconds m_DefaultWaitForTick = new WaitForSeconds(1.0f / 30); + private WaitForSeconds m_DefaultWaitForTick = new(1.0f / 30); - // TODO: [CmbServiceTests] Adapt to run with the service - protected override bool UseCMBService() - { - return false; - } + public SceneObjectsNotDestroyedOnShutdownTest(HostOrServer hostOrServer) : base(hostOrServer) {} [UnityTest] public IEnumerator SceneObjectsNotDestroyedOnShutdown() { - m_ServerNetworkManager.SceneManager.OnSceneEvent += SceneManager_OnSceneEvent; - m_ServerNetworkManager.SceneManager.LoadScene(k_TestScene, LoadSceneMode.Additive); + var authority = GetAuthorityNetworkManager(); + authority.SceneManager.OnSceneEvent += SceneManager_OnSceneEvent; + authority.SceneManager.LoadScene(k_TestScene, LoadSceneMode.Additive); yield return WaitForConditionOrTimeOut(() => m_TestScene.IsValid() && m_TestScene.isLoaded); AssertOnTimeout($"Timed out waiting for scene {k_TestScene} to load!"); @@ -38,11 +37,12 @@ public IEnumerator SceneObjectsNotDestroyedOnShutdown() AssertOnTimeout($"Timed out waiting to find {k_SceneObjectName} after scene load and before starting client!\""); - yield return CreateAndStartNewClient(); + var lateJoin = CreateNewClient(); + yield return StartClient(lateJoin); var loadedInSceneObjects = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where((c) => c.name.Contains(k_SceneObjectName)); Assert.IsTrue(loadedInSceneObjects.Count() > 1, $"Only found one instance of {k_SceneObjectName} after client connected!"); - m_ClientNetworkManagers[0].Shutdown(); + lateJoin.Shutdown(); yield return m_DefaultWaitForTick; loadedInSceneObjects = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where((c) => c.name.Contains(k_SceneObjectName)); @@ -52,36 +52,39 @@ public IEnumerator SceneObjectsNotDestroyedOnShutdown() [UnityTest] public IEnumerator ChildSceneObjectsDoNotDestroyOnShutdown() { - m_ServerNetworkManager.SceneManager.OnSceneEvent += SceneManager_OnSceneEvent; - m_ServerNetworkManager.SceneManager.LoadScene(k_TestScene, LoadSceneMode.Additive); + var authority = GetAuthorityNetworkManager(); + authority.SceneManager.OnSceneEvent += SceneManager_OnSceneEvent; + authority.SceneManager.LoadScene(k_TestScene, LoadSceneMode.Additive); yield return WaitForConditionOrTimeOut(() => m_TestScene.IsValid() && m_TestScene.isLoaded); AssertOnTimeout($"Timed out waiting for scene {k_TestScene} to load!"); var loadedInSceneObject = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where((c) => c.name.Contains(k_SceneObjectName)).FirstOrDefault(); Assert.IsNotNull(loadedInSceneObject, $"Failed to find {k_SceneObjectName} before starting client!"); - yield return CreateAndStartNewClient(); - var clientId = m_ClientNetworkManagers[0].LocalClientId; - Assert.IsTrue(loadedInSceneObject.TrySetParent(m_PlayerNetworkObjects[0][clientId]), $"Failed to parent in-scene object under client player"); + var lateJoin = CreateNewClient(); + yield return StartClient(lateJoin); + + var clientId = lateJoin.LocalClientId; + Assert.IsTrue(loadedInSceneObject.TrySetParent(m_PlayerNetworkObjects[authority.LocalClientId][clientId]), $"Failed to parent in-scene object under client player"); yield return WaitForConditionOrTimeOut(() => PlayerHasChildren(clientId)); AssertOnTimeout($"Client-{clientId} player never parented {k_SceneObjectName}!"); var loadedInSceneObjects = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where((c) => c.name.Contains(k_SceneObjectName)); Assert.IsTrue(loadedInSceneObjects.Count() > 1, $"Only found one instance of {k_SceneObjectName} after client connected!"); - m_ClientNetworkManagers[0].Shutdown(); + lateJoin.Shutdown(); yield return m_DefaultWaitForTick; // Sanity check to make sure the client's player no longer has any children yield return WaitForConditionOrTimeOut(() => PlayerNoLongerExistsWithChildren(clientId)); AssertOnTimeout($"Client-{clientId} player still exits with children after client shutdown!"); - loadedInSceneObjects = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where((c) => c.name.Contains(k_SceneObjectName)); + loadedInSceneObjects = Object.FindObjectsByType(FindObjectsSortMode.InstanceID).Where(o => o.name.Contains(k_SceneObjectName)).ToArray(); // Make sure any in-scene placed NetworkObject instantiated has no parent - foreach (var insceneObject in loadedInSceneObjects) + foreach (var inSceneObject in loadedInSceneObjects) { - Assert.IsTrue(insceneObject.transform.parent == null, $"{insceneObject.name} is still parented!"); + Assert.IsTrue(inSceneObject.transform.parent == null, $"{inSceneObject.name} is still parented!"); } // We should have exactly 2 in-scene placed NetworkObjects remaining: @@ -100,16 +103,17 @@ private bool PlayerHasChildren(ulong clientId) private bool PlayerNoLongerExistsWithChildren(ulong clientId) { - if (m_PlayerNetworkObjects[0].ContainsKey(clientId) && m_PlayerNetworkObjects[0][clientId] != null) + var authorityId = GetAuthorityNetworkManager().LocalClientId; + if (m_PlayerNetworkObjects[authorityId].ContainsKey(clientId) && m_PlayerNetworkObjects[authorityId][clientId] != null) { - return m_PlayerNetworkObjects[0][clientId].transform.childCount == 0; + return m_PlayerNetworkObjects[authorityId][clientId].transform.childCount == 0; } return true; } private void SceneManager_OnSceneEvent(SceneEvent sceneEvent) { - if (sceneEvent.ClientId != m_ServerNetworkManager.LocalClientId) + if (sceneEvent.ClientId != GetAuthorityNetworkManager().LocalClientId) { return; } From 8c50b2e9fbb8d45b2a1486dc0aa1e730fb62fad0 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 12:55:57 -0500 Subject: [PATCH 03/17] Fix standards check --- .../Tests/Runtime/Rpc/RpcInvocationTests.cs | 3 --- .../Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs | 6 +++--- testproject/Assets/Tests/Runtime/SenderIdTests.cs | 9 --------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs index 1705ad7f7f..996021d425 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs @@ -23,9 +23,6 @@ public RpcInvocationTests(NetworkTopologyTypes topologyType) : base(topologyType private Dictionary m_InvokeInstances = new(); - // TODO: [CmbServiceTests] Enable once the CMB service fixes the client spoofing issue. - protected override bool UseCMBService() => false; - protected override void OnServerAndClientsCreated() { m_Prefab = CreateNetworkObjectPrefab("RpcInvokePermissionTest"); diff --git a/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs b/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs index fa2db5f4ce..5e393d143f 100644 --- a/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs +++ b/testproject/Assets/Tests/Runtime/SceneObjectsNotDestroyedOnShutdownTest.cs @@ -10,8 +10,8 @@ namespace TestProject.RuntimeTests { - [TestFixture(HostOrServer.Host)] - [TestFixture(HostOrServer.DAHost)] + [TestFixture(NetworkTopologyTypes.ClientServer)] + [TestFixture(NetworkTopologyTypes.DistributedAuthority)] public class SceneObjectsNotDestroyedOnShutdownTest : NetcodeIntegrationTest { protected override int NumberOfClients => 0; @@ -21,7 +21,7 @@ public class SceneObjectsNotDestroyedOnShutdownTest : NetcodeIntegrationTest private Scene m_TestScene; private WaitForSeconds m_DefaultWaitForTick = new(1.0f / 30); - public SceneObjectsNotDestroyedOnShutdownTest(HostOrServer hostOrServer) : base(hostOrServer) {} + public SceneObjectsNotDestroyedOnShutdownTest(NetworkTopologyTypes topology) : base(topology) { } [UnityTest] public IEnumerator SceneObjectsNotDestroyedOnShutdown() diff --git a/testproject/Assets/Tests/Runtime/SenderIdTests.cs b/testproject/Assets/Tests/Runtime/SenderIdTests.cs index ba71242392..f211f78606 100644 --- a/testproject/Assets/Tests/Runtime/SenderIdTests.cs +++ b/testproject/Assets/Tests/Runtime/SenderIdTests.cs @@ -10,19 +10,10 @@ namespace TestProject.RuntimeTests { - - [TestFixture(NetworkTopologyTypes.DistributedAuthority)] - [TestFixture(NetworkTopologyTypes.ClientServer)] public class SenderIdTests : NetcodeIntegrationTest { protected override int NumberOfClients => 2; - // TODO: [CmbServiceTests] Adapt to run with the service - protected override bool UseCMBService() - { - return false; - } - private NetworkManager FirstClient => m_ClientNetworkManagers[0]; private NetworkManager SecondClient => m_ClientNetworkManagers[1]; From 85c3a5b3e2cca3d4722fc1cef97fb105097c0a14 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 14:04:57 -0500 Subject: [PATCH 04/17] Fix broken tests --- testproject/Assets/Tests/Runtime/SenderIdTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/testproject/Assets/Tests/Runtime/SenderIdTests.cs b/testproject/Assets/Tests/Runtime/SenderIdTests.cs index f211f78606..92ebf2f4a1 100644 --- a/testproject/Assets/Tests/Runtime/SenderIdTests.cs +++ b/testproject/Assets/Tests/Runtime/SenderIdTests.cs @@ -17,8 +17,6 @@ public class SenderIdTests : NetcodeIntegrationTest private NetworkManager FirstClient => m_ClientNetworkManagers[0]; private NetworkManager SecondClient => m_ClientNetworkManagers[1]; - public SenderIdTests(NetworkTopologyTypes networkTopologyType) : base(networkTopologyType) { } - [UnityTest] public IEnumerator WhenSendingMessageFromServerToClient_SenderIdIsCorrect() { From 690d43b9176b4ac0510fd520da3dc68276812c62 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 15:55:40 -0500 Subject: [PATCH 05/17] Update yamato jobs --- .yamato/cmb-service-standalone-tests.yml | 4 ++-- .yamato/desktop-standalone-tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.yamato/cmb-service-standalone-tests.yml b/.yamato/cmb-service-standalone-tests.yml index f464e89dc4..e4df77d363 100644 --- a/.yamato/cmb-service-standalone-tests.yml +++ b/.yamato/cmb-service-standalone-tests.yml @@ -56,8 +56,8 @@ cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }} # run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server) - ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT - - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} + # - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + # - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} artifacts: logs: paths: diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index 32aeef21d3..7eaff9ae29 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -53,8 +53,8 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ paths: - "artifacts/**/*" dependencies: - - .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors - - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} + # - .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors + # - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} {% endfor -%} {% endfor -%} From d425867c4e56e7117d277434e592dd7b1264a740 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 15:58:44 -0500 Subject: [PATCH 06/17] Make code change and trigger checks --- testproject/Assets/Tests/Runtime/SenderIdTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testproject/Assets/Tests/Runtime/SenderIdTests.cs b/testproject/Assets/Tests/Runtime/SenderIdTests.cs index 92ebf2f4a1..ecbcf8a842 100644 --- a/testproject/Assets/Tests/Runtime/SenderIdTests.cs +++ b/testproject/Assets/Tests/Runtime/SenderIdTests.cs @@ -12,7 +12,7 @@ namespace TestProject.RuntimeTests { public class SenderIdTests : NetcodeIntegrationTest { - protected override int NumberOfClients => 2; + protected override int NumberOfClients => 3; private NetworkManager FirstClient => m_ClientNetworkManagers[0]; private NetworkManager SecondClient => m_ClientNetworkManagers[1]; From 89cf3b1540045159ea5869ad5403ae44366fcb3a Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 16:04:34 -0500 Subject: [PATCH 07/17] Add to minimal checks --- .yamato/_triggers.yml | 1 + testproject/Assets/Tests/Runtime/SenderIdTests.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 8b8d74f86b..ac1d336f58 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -53,6 +53,7 @@ pr_minimal_required_checks: dependencies: - .yamato/project-standards.yml#standards_ubuntu_testproject_trunk - .yamato/package-pack.yml#package_pack_-_ngo_win + - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_6000.4 triggers: expression: |- (pull_request.comment eq "ngo" OR diff --git a/testproject/Assets/Tests/Runtime/SenderIdTests.cs b/testproject/Assets/Tests/Runtime/SenderIdTests.cs index ecbcf8a842..92ebf2f4a1 100644 --- a/testproject/Assets/Tests/Runtime/SenderIdTests.cs +++ b/testproject/Assets/Tests/Runtime/SenderIdTests.cs @@ -12,7 +12,7 @@ namespace TestProject.RuntimeTests { public class SenderIdTests : NetcodeIntegrationTest { - protected override int NumberOfClients => 3; + protected override int NumberOfClients => 2; private NetworkManager FirstClient => m_ClientNetworkManagers[0]; private NetworkManager SecondClient => m_ClientNetworkManagers[1]; From cb1c148e50b581fdbb7d018d6bd5589f2a8dd8fb Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 16:06:23 -0500 Subject: [PATCH 08/17] Actually add script changes --- Tools/CI/service.cmb/run_cmb_service.sh | 114 +++++++++++++----------- 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index e9bd87eff3..caf55ee102 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -91,6 +91,20 @@ logError(){ # Unity Version ----------------------------------------------------------------- +DIR="./artifacts" +if [[ -d "$DIR" ]]; then + echo "Artifacts directory exists" +else + echo "Artifacts directory does not exist" +fi + +FILE="artifacts/TestResults.js" +if [[ -f "$FILE" ]]; then + echo "TestResults File exists and is a regular file" +else + echo "TestResults File missing" +fi + unity_version=sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' artifacts/TestResults.js # ensure arguments were passed and the ports are defined @@ -100,69 +114,69 @@ elif [[ "$echo_port" == "$service_port" ]]; then logMessage "Found Unity version: $unity_version"; fi -# Protocol Buffer Compiler ------------------------------------------------------ +# # Protocol Buffer Compiler ------------------------------------------------------ -# Apply any updates -logMessage "Updating modules..." -sudo apt-get update +# # Apply any updates +# logMessage "Updating modules..." +# sudo apt-get update -# Install Protocol Buffer Compiler (using apt-get) -logMessage "Installing protocol buffer compiler as SUDO..." -try sudo apt-get install -y protobuf-compiler +# # Install Protocol Buffer Compiler (using apt-get) +# logMessage "Installing protocol buffer compiler as SUDO..." +# try sudo apt-get install -y protobuf-compiler -# If the previous command failed, try without sudo -if $ThrewError; then -logMessage "Installing protocol buffer compiler as shell assigned account..." -apt-get install -y protobuf-compiler -else -logMessage "Protocol buffer compiler was installed as sudo!" -fi +# # If the previous command failed, try without sudo +# if $ThrewError; then +# logMessage "Installing protocol buffer compiler as shell assigned account..." +# apt-get install -y protobuf-compiler +# else +# logMessage "Protocol buffer compiler was installed as sudo!" +# fi -# Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary -export PROTOC="/usr/bin/protoc" +# # Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary +# export PROTOC="/usr/bin/protoc" -# Validate the PROTOC env var by getting the protoc version -try $PROTOC --version +# # Validate the PROTOC env var by getting the protoc version +# try $PROTOC --version -if $ThrewError; then -logError "Failed to properly run protoc!" -exit -1 -else -logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" -fi +# if $ThrewError; then +# logError "Failed to properly run protoc!" +# exit -1 +# else +# logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" +# fi -# clone the cmb service repo -git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git +# # clone the cmb service repo +# git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git -# navigate to the cmb service directory -cd ./mps-common-multiplayer-backend/runtime +# # navigate to the cmb service directory +# cd ./mps-common-multiplayer-backend/runtime -# Install rust -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# # Install rust +# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# Add the cargo bin directory to the PATH -export PATH="$HOME/.cargo/bin:$PATH" +# # Add the cargo bin directory to the PATH +# export PATH="$HOME/.cargo/bin:$PATH" -# Echo server ------------------------------------------------------------------- +# # Echo server ------------------------------------------------------------------- -# Build the echo server -logMessage "Beginning echo server build..." -cargo build --example ngo_echo_server +# # Build the echo server +# logMessage "Beginning echo server build..." +# cargo build --example ngo_echo_server -# Run the echo server in the background -logMessage "Running echo server tests..." -cargo run --example ngo_echo_server -- --port $echo_port & +# # Run the echo server in the background +# logMessage "Running echo server tests..." +# cargo run --example ngo_echo_server -- --port $echo_port & -# CMB Service ------------------------------------------------------------------- +# # CMB Service ------------------------------------------------------------------- -# Build a release version of the standalone cmb service -logMessage "Beginning service release build..." -cargo build --release --locked +# # Build a release version of the standalone cmb service +# logMessage "Beginning service release build..." +# cargo build --release --locked -# Run the standalone service on an infinite loop in the background. -# The infinite loop is required as the service will exit each time all connected clients disconnect. -# This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. -logMessage "Running service integration tests..." -while :; do - ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; -done & # <- use & to run the entire loop in the background +# # Run the standalone service on an infinite loop in the background. +# # The infinite loop is required as the service will exit each time all connected clients disconnect. +# # This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. +# logMessage "Running service integration tests..." +# while :; do +# ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; +# done & # <- use & to run the entire loop in the background From 19e5a5538173ecab97072038665ec86a7cc2f8f4 Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 5 Dec 2025 16:24:43 -0500 Subject: [PATCH 09/17] put yamato changes back --- .yamato/_triggers.yml | 1 - .yamato/cmb-service-standalone-tests.yml | 4 ++-- .yamato/desktop-standalone-tests.yml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index ac1d336f58..8b8d74f86b 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -53,7 +53,6 @@ pr_minimal_required_checks: dependencies: - .yamato/project-standards.yml#standards_ubuntu_testproject_trunk - .yamato/package-pack.yml#package_pack_-_ngo_win - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_6000.4 triggers: expression: |- (pull_request.comment eq "ngo" OR diff --git a/.yamato/cmb-service-standalone-tests.yml b/.yamato/cmb-service-standalone-tests.yml index e4df77d363..f464e89dc4 100644 --- a/.yamato/cmb-service-standalone-tests.yml +++ b/.yamato/cmb-service-standalone-tests.yml @@ -56,8 +56,8 @@ cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }} # run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server) - ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT - # - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - # - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} artifacts: logs: paths: diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index 7eaff9ae29..32aeef21d3 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -53,8 +53,8 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ paths: - "artifacts/**/*" dependencies: - # - .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors - # - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} + - .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors + - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} {% endfor -%} {% endfor -%} From a295363ce6ec7eb34f4841a27dc4b5206e32b472 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 12:47:53 -0500 Subject: [PATCH 10/17] Put the build jobs on a larger VM --- .yamato/console-standalone-test.yml | 2 +- .yamato/desktop-standalone-tests.yml | 2 +- .yamato/mobile-standalone-test.yml | 2 +- .yamato/project.metafile | 20 +++++++++++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.yamato/console-standalone-test.yml b/.yamato/console-standalone-test.yml index 3690585c66..dba4a796a1 100644 --- a/.yamato/console-standalone-test.yml +++ b/.yamato/console-standalone-test.yml @@ -45,7 +45,7 @@ console_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: agent: type: {{ platform.type }} image: {{ platform.image }} - flavor: {{ platform.flavor }} + flavor: {{ platform.larger_flavor }} {% if platform.model %} model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index 32aeef21d3..551b8a91d3 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -38,7 +38,7 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ agent: type: {% if platform.name == "mac" %} {{ platform.type }} {% else %} {{ platform.type }} {% endif %} image: {{ platform.image }} - flavor: {{ platform.flavor }} + flavor: {{ platform.larger_flavor }} {% if platform.name == "mac" %} model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} diff --git a/.yamato/mobile-standalone-test.yml b/.yamato/mobile-standalone-test.yml index 55fa6025b7..4bb41db94e 100644 --- a/.yamato/mobile-standalone-test.yml +++ b/.yamato/mobile-standalone-test.yml @@ -44,7 +44,7 @@ mobile_standalone_build_{{ project.name }}_{{ platform.name }}_{{ editor }}: agent: type: {{ platform.type }} image: {{ platform.image }} - flavor: {{ platform.flavor }} + flavor: {{ platform.larger_flavor }} {% if platform.model %} model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} diff --git a/.yamato/project.metafile b/.yamato/project.metafile index 13f7801cf7..f434d36106 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -10,6 +10,7 @@ # image --> Defines the package-ci Bokken image to use for the environment (e.g., package-ci/ubuntu-22.04:v4). This is basically a device configuration # flavor --> Determines the VM size/resources (e.g., b1.small, b1.large, m1.mac) # smaller_flavor --> An override for flavor that determines the VM size/resources for lighter weight jobs that can run on a smaller vm + # larger_flavor --> An override for flavor that determines the VM size/resources for heavier weight jobs that can need a bigger vm # standalone --> Specifies the build target platform (e.g., StandaloneLinux64, Android, IOS) # model --> Defines specific hardware model requirements (e.g., rtx2080, iPhone model 13). Notice that trunk currently (19.08.2025) has 13.0 as minimal iOS version which devices below this are not supporting # base --> Indicates the base operating system for build operations (e.g., win, mac) @@ -47,6 +48,7 @@ test_platforms: image: package-ci/ubuntu-22.04:v4.77.0 flavor: b1.large smaller_flavor: b1.medium + larger_flavor: b1.xlarge standalone: StandaloneLinux64 model: rtx2080 - name: win @@ -54,13 +56,16 @@ test_platforms: image: package-ci/win10:v4 flavor: b1.large smaller_flavor: b1.medium + larger_flavor: b1.xlarge standalone: StandaloneWindows64 model: rtx2080 - name: mac type: Unity::VM::osx image: package-ci/macos-13-arm64:v4 # ARM64 to support M1 model (below) flavor: m1.mac - smaller_flavor: m1.mac # mac doesn't have a smaller vm size. We define it anyway as it simplifies the yaml templating to have it defined. + # mac doesn't have a different vm sizes. We define it anyway as it simplifies the yaml templating to have it defined. + smaller_flavor: m1.mac + larger_flavor: m1.mac standalone: StandaloneOSX model: M1 # The default model (an x64 Intel Mac VM) quite often caused a known issue of doing all the bitflips in packages resulting in failures # For mobile devices there is a split between the build and run phase so there is a need of splitting specification for both @@ -70,6 +75,7 @@ test_platforms: type: Unity::VM image: package-ci/win10:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: Android base: win architecture: armv7 @@ -86,6 +92,7 @@ test_platforms: type: Unity::mobile::shield image: package-ci/win10:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: Android base: win architecture: armv7 @@ -93,6 +100,7 @@ test_platforms: type: Unity::mobile::iPhone image: package-ci/macos-13-arm64:v4 flavor: m1.mac + larger_flavor: m1.mac model: 13 standalone: IOS base: mac @@ -102,53 +110,63 @@ test_platforms: type: Unity::VM image: package-ci/win10-ps4:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: PS4 # - name: ps5 --> SEE MTT-12118 # type: Unity::VM # image: package-ci/win10-ps5:v4 # flavor: b1.large + # larger_flavor: b1.xlarge # standalone: PS5 - name: switch type: Unity::VM image: package-ci/win10-switch:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: Switch - name: GameCoreXboxOne type: Unity::VM image: package-ci/win10-xbox:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: GameCoreXboxOne - name: GameCoreScarlett type: Unity::VM image: package-ci/win10-xbox:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: GameCoreScarlett console_test: - name: ps4 type: Unity::console::ps4 image: package-ci/win10-ps4:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: PS4 #- name: ps5 --> SEE MTT-12118 # type: Unity::console::ps5 # image: package-ci/win10-ps5:v4 # flavor: b1.large + # larger_flavor: b1.xlarge # standalone: PS5 - name: switch type: Unity::console::switch image: package-ci/win10-switch:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: Switch base: win - name: GameCoreXboxOne type: Unity::console::xbox image: package-ci/win10-xbox:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: GameCoreXboxOne - name: GameCoreScarlett type: Unity::console::scarlett image: package-ci/win10-xbox:v4 flavor: b1.large + larger_flavor: b1.xlarge standalone: GameCoreScarlett # EDITOR CONFIGURATIONS------------------------------------------------------------------------------- From b4975941d688ce96fa3ba80ac06dffc71d4207af Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 14:17:39 -0500 Subject: [PATCH 11/17] fix cmb script --- .yamato/cmb-service-standalone-tests.yml | 4 ++-- Tools/CI/service.cmb/run_cmb_service.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.yamato/cmb-service-standalone-tests.yml b/.yamato/cmb-service-standalone-tests.yml index f464e89dc4..e4df77d363 100644 --- a/.yamato/cmb-service-standalone-tests.yml +++ b/.yamato/cmb-service-standalone-tests.yml @@ -56,8 +56,8 @@ cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }} # run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server) - ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT - - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} + # - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + # - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} artifacts: logs: paths: diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index caf55ee102..d6cab6eaaf 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -105,7 +105,10 @@ else echo "TestResults File missing" fi -unity_version=sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' artifacts/TestResults.js +echo "$(<$FILE)" + + +unity_version=sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE # ensure arguments were passed and the ports are defined if [ -z "$unity_version" ]; then From eda973880b03a4d92b34779ca928dc4478a669bd Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 14:53:00 -0500 Subject: [PATCH 12/17] Update bash commands to be proper --- Tools/CI/service.cmb/run_cmb_service.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index d6cab6eaaf..b7afd5ea22 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -107,8 +107,9 @@ fi echo "$(<$FILE)" +sed --help -unity_version=sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE +unity_version="$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE)" # ensure arguments were passed and the ports are defined if [ -z "$unity_version" ]; then From b0b39ab066d2358f66ef71c388fc2d48f1e52f87 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 14:54:33 -0500 Subject: [PATCH 13/17] Fix bash else --- Tools/CI/service.cmb/run_cmb_service.sh | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index b7afd5ea22..0a338779b4 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -91,20 +91,6 @@ logError(){ # Unity Version ----------------------------------------------------------------- -DIR="./artifacts" -if [[ -d "$DIR" ]]; then - echo "Artifacts directory exists" -else - echo "Artifacts directory does not exist" -fi - -FILE="artifacts/TestResults.js" -if [[ -f "$FILE" ]]; then - echo "TestResults File exists and is a regular file" -else - echo "TestResults File missing" -fi - echo "$(<$FILE)" sed --help @@ -114,7 +100,7 @@ unity_version="$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE)" # ensure arguments were passed and the ports are defined if [ -z "$unity_version" ]; then logMessage "Failed to find unity version: $unity_version! Using default string"; -elif [[ "$echo_port" == "$service_port" ]]; then +else logMessage "Found Unity version: $unity_version"; fi From 93a9016278be9f3a13d7aa6ebc1aba7f46dda899 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 15:29:08 -0500 Subject: [PATCH 14/17] try multiple --- Tools/CI/service.cmb/run_cmb_service.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index 0a338779b4..fcadd2c291 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -91,17 +91,24 @@ logError(){ # Unity Version ----------------------------------------------------------------- + +FILE="artifacts/TestResults.js" + echo "$(<$FILE)" -sed --help -unity_version="$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE)" +first_sed=$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE) + + +second_sed="$(sed -nE 's/.*"editorVersion":[[:space:]]*"([^[:space:]"]+).*/\1/p' $FILE)" + +project_settings="$(sed -nE 's/^m_EditorVersion:[[:space:]]*([[:alnum:].]+).*/\1/p' testproject/ProjectSettings/ProjectVersion.txt)" # ensure arguments were passed and the ports are defined -if [ -z "$unity_version" ]; then - logMessage "Failed to find unity version: $unity_version! Using default string"; +if [ -z "$first_sed" ]; then + logMessage "Failed to find unity version: first: $first_sed, second: $second_sed, project_settings: $project_settings! Using default string"; else - logMessage "Found Unity version: $unity_version"; + logMessage "Found Unity version: first: $first_sed, second: $second_sed, project_settings: $project_settings"; fi # # Protocol Buffer Compiler ------------------------------------------------------ From 290308ae92be5701294df3a828584d2384498d46 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 8 Dec 2025 16:55:24 -0500 Subject: [PATCH 15/17] Lets go --- .yamato/cmb-service-standalone-tests.yml | 6 +- Tools/CI/service.cmb/run_cmb_service.sh | 124 +++++++++++------------ 2 files changed, 62 insertions(+), 68 deletions(-) diff --git a/.yamato/cmb-service-standalone-tests.yml b/.yamato/cmb-service-standalone-tests.yml index e4df77d363..145a9c1618 100644 --- a/.yamato/cmb-service-standalone-tests.yml +++ b/.yamato/cmb-service-standalone-tests.yml @@ -54,10 +54,10 @@ cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }} commands: # run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server) - - ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT + - ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT -l artifacts - # - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - # - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} + - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + - UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} artifacts: logs: paths: diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index fcadd2c291..bad4cf6c84 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -38,10 +38,11 @@ ERROR="Error: Expected ports to be defined! Example script usage:" EXAMPLE="run_cmb_service.sh -e -s " # get arguments passed to the script -while getopts 'e:s:' flag; do +while getopts 'e:s:l:' flag; do case "${flag}" in e) echo_port="${OPTARG}" ;; s) service_port="${OPTARG}" ;; + l) build_logs="${OPTARG}" ;; *) printf "%s\n" "$ERROR" "$EXAMPLE" exit 1 ;; esac @@ -91,89 +92,82 @@ logError(){ # Unity Version ----------------------------------------------------------------- +# This is the path to the logs from the standalone build job +FILE="$build_logs/TestResults.js" -FILE="artifacts/TestResults.js" - -echo "$(<$FILE)" - - -first_sed=$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE) - - -second_sed="$(sed -nE 's/.*"editorVersion":[[:space:]]*"([^[:space:]"]+).*/\1/p' $FILE)" - -project_settings="$(sed -nE 's/^m_EditorVersion:[[:space:]]*([[:alnum:].]+).*/\1/p' testproject/ProjectSettings/ProjectVersion.txt)" +unity_version=$(sed -n 's/.*"editorVersion": *"\([^" (]*\).*/\1/p' $FILE) # ensure arguments were passed and the ports are defined -if [ -z "$first_sed" ]; then - logMessage "Failed to find unity version: first: $first_sed, second: $second_sed, project_settings: $project_settings! Using default string"; +if [ -z "$unity_version" ]; then + logMessage "Failed to find unity version! Exiting..."; + exit 1; else - logMessage "Found Unity version: first: $first_sed, second: $second_sed, project_settings: $project_settings"; + logMessage "Found Unity version: $unity_version"; fi -# # Protocol Buffer Compiler ------------------------------------------------------ +# Protocol Buffer Compiler ------------------------------------------------------ -# # Apply any updates -# logMessage "Updating modules..." -# sudo apt-get update +# Apply any updates +logMessage "Updating modules..." +sudo apt-get update -# # Install Protocol Buffer Compiler (using apt-get) -# logMessage "Installing protocol buffer compiler as SUDO..." -# try sudo apt-get install -y protobuf-compiler +# Install Protocol Buffer Compiler (using apt-get) +logMessage "Installing protocol buffer compiler as SUDO..." +try sudo apt-get install -y protobuf-compiler -# # If the previous command failed, try without sudo -# if $ThrewError; then -# logMessage "Installing protocol buffer compiler as shell assigned account..." -# apt-get install -y protobuf-compiler -# else -# logMessage "Protocol buffer compiler was installed as sudo!" -# fi +# If the previous command failed, try without sudo +if $ThrewError; then +logMessage "Installing protocol buffer compiler as shell assigned account..." +apt-get install -y protobuf-compiler +else +logMessage "Protocol buffer compiler was installed as sudo!" +fi -# # Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary -# export PROTOC="/usr/bin/protoc" +# Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary +export PROTOC="/usr/bin/protoc" -# # Validate the PROTOC env var by getting the protoc version -# try $PROTOC --version +# Validate the PROTOC env var by getting the protoc version +try $PROTOC --version -# if $ThrewError; then -# logError "Failed to properly run protoc!" -# exit -1 -# else -# logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" -# fi +if $ThrewError; then +logError "Failed to properly run protoc!" +exit -1 +else +logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" +fi -# # clone the cmb service repo -# git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git +# clone the cmb service repo +git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git -# # navigate to the cmb service directory -# cd ./mps-common-multiplayer-backend/runtime +# navigate to the cmb service directory +cd ./mps-common-multiplayer-backend/runtime -# # Install rust -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# Install rust +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# # Add the cargo bin directory to the PATH -# export PATH="$HOME/.cargo/bin:$PATH" +# Add the cargo bin directory to the PATH +export PATH="$HOME/.cargo/bin:$PATH" -# # Echo server ------------------------------------------------------------------- +# Echo server ------------------------------------------------------------------- -# # Build the echo server -# logMessage "Beginning echo server build..." -# cargo build --example ngo_echo_server +# Build the echo server +logMessage "Beginning echo server build..." +cargo build --example ngo_echo_server -# # Run the echo server in the background -# logMessage "Running echo server tests..." -# cargo run --example ngo_echo_server -- --port $echo_port & +# Run the echo server in the background +logMessage "Running echo server tests..." +cargo run --example ngo_echo_server -- --port $echo_port & -# # CMB Service ------------------------------------------------------------------- +# CMB Service ------------------------------------------------------------------- -# # Build a release version of the standalone cmb service -# logMessage "Beginning service release build..." -# cargo build --release --locked +# Build a release version of the standalone cmb service +logMessage "Beginning service release build..." +cargo build --release --locked -# # Run the standalone service on an infinite loop in the background. -# # The infinite loop is required as the service will exit each time all connected clients disconnect. -# # This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. -# logMessage "Running service integration tests..." -# while :; do -# ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; -# done & # <- use & to run the entire loop in the background +# Run the standalone service on an infinite loop in the background. +# The infinite loop is required as the service will exit each time all connected clients disconnect. +# This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. +logMessage "Running service integration tests..." +while :; do + ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; +done & # <- use & to run the entire loop in the background From 657dbeae1650c20d5121771442d67824a4502462 Mon Sep 17 00:00:00 2001 From: Emma Date: Tue, 9 Dec 2025 13:47:54 -0500 Subject: [PATCH 16/17] Move tests back to trunk --- .yamato/_triggers.yml | 6 ++---- Tools/CI/service.cmb/run_cmb_service.sh | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 8b8d74f86b..72145210c2 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -87,10 +87,8 @@ pr_code_changes_checks: # Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs # desktop_standalone_test and cmb_service_standalone_test are both reusing desktop_standalone_build dependency so we run those in the same configuration on PRs to reduce waiting time. # Note that our daily tests will anyway run both test configurations in "minimal supported" and "trunk" configurations - - # TODO: Move these tests back to trunk once CMB Service has addressed https://jira.unity3d.com/browse/MTTB-1680 - - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_6000.4 - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_6000.4 + - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_trunk + - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk triggers: expression: |- (pull_request.comment eq "ngo" OR diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index bad4cf6c84..1f350561e2 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -168,6 +168,8 @@ cargo build --release --locked # The infinite loop is required as the service will exit each time all connected clients disconnect. # This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits. logMessage "Running service integration tests..." +echo "comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version" + while :; do ./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version; done & # <- use & to run the entire loop in the background From 00a4731b38eb19c87e952420ab3886653fa4813f Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 11 Dec 2025 09:12:58 -0500 Subject: [PATCH 17/17] Add unity version to codec tests --- Tools/CI/service.cmb/run_cmb_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index 1f350561e2..4bcf8c7468 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -156,7 +156,7 @@ cargo build --example ngo_echo_server # Run the echo server in the background logMessage "Running echo server tests..." -cargo run --example ngo_echo_server -- --port $echo_port & +cargo run --example ngo_echo_server -- --port $echo_port --unity-version $unity_version & # CMB Service -------------------------------------------------------------------