From 00766c3d805aa47450433a1b51d2a1d38e25b1e8 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 3 Mar 2025 16:08:22 +0100 Subject: [PATCH 1/7] Reenabled WhenAnticipating_ValueChangesImmediately test --- .../Tests/Runtime/NetworkTransformAnticipationTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs index 48d966b50a..6db5a26807 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs @@ -115,7 +115,6 @@ public AnticipatedNetworkTransform GetOtherClientComponent() } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] // TODO: this ignored test is tracked in MTT-11341 public void WhenAnticipating_ValueChangesImmediately() { var testComponent = GetTestComponent(); From a365c26ac8ef3453184e369f6d9da00c45fca7b9 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 5 Mar 2025 13:55:16 +0100 Subject: [PATCH 2/7] Reenabled NetworkVariableTests --- .../Tests/Runtime/NetworkVariable/NetworkVariableTests.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs index 28d1def735..a67be4de26 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs @@ -2159,7 +2159,6 @@ public string ArrayStr(NativeArray arr) where T : unmanaged } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly( @@ -2613,7 +2612,6 @@ public string DictionaryStr(Dictionary list) } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesAreSerializedCorrectly( @@ -2800,7 +2798,6 @@ public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesA } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_ValuesAreSerializedCorrectly( @@ -2956,7 +2953,6 @@ public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_Valu } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeDictionaryNetworkVariables_ValuesAreSerializedCorrectly( From 578c42e901e7d70d785cc0a6292e9d4099e10e6c Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 12 Mar 2025 13:51:48 +0100 Subject: [PATCH 3/7] Revert "Reenabled NetworkVariableTests" This reverts commit a365c26ac8ef3453184e369f6d9da00c45fca7b9. --- .../Tests/Runtime/NetworkVariable/NetworkVariableTests.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs index a67be4de26..28d1def735 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs @@ -2159,6 +2159,7 @@ public string ArrayStr(NativeArray arr) where T : unmanaged } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly( @@ -2612,6 +2613,7 @@ public string DictionaryStr(Dictionary list) } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesAreSerializedCorrectly( @@ -2798,6 +2800,7 @@ public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesA } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_ValuesAreSerializedCorrectly( @@ -2953,6 +2956,7 @@ public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_Valu } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343 [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeDictionaryNetworkVariables_ValuesAreSerializedCorrectly( From acc31f7444267f7ee0f18bd6e8947b54ddd959c3 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 12 Mar 2025 13:52:14 +0100 Subject: [PATCH 4/7] Modified WhenAnticipating_ValueChangesImmediately test --- .yamato/mobile-standalone-test.yml | 4 ++-- .../Tests/Runtime/NetworkTransformAnticipationTests.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.yamato/mobile-standalone-test.yml b/.yamato/mobile-standalone-test.yml index 2ca2444b86..f3f5dace01 100644 --- a/.yamato/mobile-standalone-test.yml +++ b/.yamato/mobile-standalone-test.yml @@ -30,11 +30,11 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: # Platform specific Build {% if platform.base == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - - utr.bat --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 + - utr.bat --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.NetworkTransformAnticipationTests.WhenAnticipating_ValueChangesImmediately" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 {% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr - chmod +x ./utr - - ./utr --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 + - ./utr --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.NetworkTransformAnticipationTests.WhenAnticipating_ValueChangesImmediately" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 {% endif %} artifacts: players: diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs index 6db5a26807..9686da05ad 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs @@ -125,12 +125,11 @@ public void WhenAnticipating_ValueChangesImmediately() Assert.AreEqual(new Vector3(0, 1, 2), testComponent.transform.position); Assert.AreEqual(new Vector3(1, 2, 3), testComponent.transform.localScale); - Assert.AreEqual(Quaternion.LookRotation(new Vector3(2, 3, 4)), testComponent.transform.rotation); + Assert.That(testComponent.transform.rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(new QuaternionEqualityComparer(0.000001f))); // Quaternion comparer added due to FP precision problems on Android devices Assert.AreEqual(new Vector3(0, 1, 2), testComponent.AnticipatedState.Position); Assert.AreEqual(new Vector3(1, 2, 3), testComponent.AnticipatedState.Scale); - Assert.AreEqual(Quaternion.LookRotation(new Vector3(2, 3, 4)), testComponent.AnticipatedState.Rotation); - + Assert.That(testComponent.AnticipatedState.Rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(new QuaternionEqualityComparer(0.000001f))); // Quaternion comparer added due to FP precision problems on Android devices } [Test] From 3195bc4ac16a7ba0ca0663a10d3ad66465aed4dc Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 12 Mar 2025 14:19:17 +0100 Subject: [PATCH 5/7] Corrected comparer implementation --- .../Tests/Runtime/NetworkTransformAnticipationTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs index 9686da05ad..3f0a8b587b 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs @@ -6,6 +6,7 @@ using Unity.Netcode.TestHelpers.Runtime; using UnityEngine; using UnityEngine.TestTools; +using UnityEngine.TestTools.Utils; using Object = UnityEngine.Object; namespace Unity.Netcode.RuntimeTests @@ -118,6 +119,7 @@ public AnticipatedNetworkTransform GetOtherClientComponent() public void WhenAnticipating_ValueChangesImmediately() { var testComponent = GetTestComponent(); + var quaternionComparer = new QuaternionEqualityComparer(0.000001f); testComponent.AnticipateMove(new Vector3(0, 1, 2)); testComponent.AnticipateScale(new Vector3(1, 2, 3)); @@ -125,11 +127,11 @@ public void WhenAnticipating_ValueChangesImmediately() Assert.AreEqual(new Vector3(0, 1, 2), testComponent.transform.position); Assert.AreEqual(new Vector3(1, 2, 3), testComponent.transform.localScale); - Assert.That(testComponent.transform.rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(new QuaternionEqualityComparer(0.000001f))); // Quaternion comparer added due to FP precision problems on Android devices + Assert.That(testComponent.transform.rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(quaternionComparer)); // Quaternion comparer added due to FP precision problems on Android devices. Assert.AreEqual(new Vector3(0, 1, 2), testComponent.AnticipatedState.Position); Assert.AreEqual(new Vector3(1, 2, 3), testComponent.AnticipatedState.Scale); - Assert.That(testComponent.AnticipatedState.Rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(new QuaternionEqualityComparer(0.000001f))); // Quaternion comparer added due to FP precision problems on Android devices + Assert.That(testComponent.AnticipatedState.Rotation, Is.EqualTo(Quaternion.LookRotation(new Vector3(2, 3, 4))).Using(quaternionComparer)); // Quaternion comparer added due to FP precision problems on Android devices. } [Test] From cf9eb59f6a86b6404963fee92e9dc74eabe71ae3 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 12 Mar 2025 15:09:10 +0100 Subject: [PATCH 6/7] Removed unused library --- .../Tests/Runtime/NetworkTransformAnticipationTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs index 3f0a8b587b..b9a361ef03 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs @@ -5,7 +5,6 @@ using Unity.Netcode.Components; using Unity.Netcode.TestHelpers.Runtime; using UnityEngine; -using UnityEngine.TestTools; using UnityEngine.TestTools.Utils; using Object = UnityEngine.Object; From 26c3fcad924bda8c5cb86254355ce69b29cbab0c Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Wed, 12 Mar 2025 15:13:03 +0100 Subject: [PATCH 7/7] Updated mobile tests to again run all tests --- .yamato/mobile-standalone-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/mobile-standalone-test.yml b/.yamato/mobile-standalone-test.yml index f3f5dace01..2ca2444b86 100644 --- a/.yamato/mobile-standalone-test.yml +++ b/.yamato/mobile-standalone-test.yml @@ -30,11 +30,11 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: # Platform specific Build {% if platform.base == "win" %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat - - utr.bat --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.NetworkTransformAnticipationTests.WhenAnticipating_ValueChangesImmediately" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 + - utr.bat --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 {% else %} - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr - chmod +x ./utr - - ./utr --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.NetworkTransformAnticipationTests.WhenAnticipating_ValueChangesImmediately" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 + - ./utr --suite=playmode --platform={{ platform.standalone }} --testproject={{ project.path }} --architecture={{ platform.architecture }} --scripting-backend=il2cpp --editor-location=.Editor --artifacts-path=artifacts --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout=1800 {% endif %} artifacts: players: