From 73091ac1bea209e3094c12f46a705af38711dc01 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 11:49:10 +0100 Subject: [PATCH 01/20] Rewritten CodeCoverage job to utilize upm-pvp --- .yamato/code-coverage.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 0e2d499f8d..7a7ecaa37e 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -14,13 +14,16 @@ code_coverage_{{ platform.name }}_{{ editor }}: image: {{ platform.image }} flavor: {{ platform.flavor }} commands: - - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - {% if platform.name == "ubuntu" %}DISPLAY=:0 {% endif %} upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" + - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr + + - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor + - DISPLAY=:0 ./utr --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-options='generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --artifacts-path=test-results --coverage-results-path=CoverageResults --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun artifacts: logs: paths: - - "upm-ci~/test-results/**/*" + - "test-results/**/*" + - "CoverageResults/**/*" dependencies: - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} From 1f5a9f593ea31c9f3da04dc0f1af77f2b3d4bf0e Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 12:29:36 +0100 Subject: [PATCH 02/20] Modified coverage results path --- .yamato/code-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 7a7ecaa37e..fe67298018 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -18,7 +18,7 @@ code_coverage_{{ platform.name }}_{{ editor }}: - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor - - DISPLAY=:0 ./utr --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-options='generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --artifacts-path=test-results --coverage-results-path=CoverageResults --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun + - DISPLAY=:0 ./utr --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-options='generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --coverage-results-path=test-results/CoverageResults --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun artifacts: logs: paths: From 026d6be84da517ed09a094f6f9328c2014522e48 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 13:00:55 +0100 Subject: [PATCH 03/20] Disabled failing mobile tests --- .../Tests/Runtime/NetworkVariableTests.cs | 1 + .../Tests/Runtime/RpcTypeSerializationTests.cs | 1 + .../Tests/Runtime/Timing/TimeInitializationTest.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs index bcfa9e75da..3a198ae758 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs @@ -1844,6 +1844,7 @@ public void WhenSerializingAndDeserializingValueTypeNetworkVariables_ValuesAreSe } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on mobile devices on 2021 editor specifically public void WhenSerializingAndDeserializingValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly( [Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint), diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs index 6016779cb1..be2ed31db0 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs @@ -1503,6 +1503,7 @@ public void WhenSendingAnArrayOfValueTypesOverAnRpc_ValuesAreSerializedCorrectly } [Test] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on mobile devices on 2021 editor specifically public void WhenSendingANativeArrayOfValueTypesOverAnRpc_ValuesAreSerializedCorrectly( [Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint), diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs index cbd7b99d9d..89d118c353 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs @@ -16,6 +16,7 @@ public class TimeInitializationTest private NetworkManager m_Client; [UnityTest] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on Android public IEnumerator TestClientTimeInitializationOnConnect([Values(0, 1f)] float serverStartDelay, [Values(0, 1f)] float clientStartDelay, [Values(true, false)] bool isHost) { // Create multiple NetworkManager instances From ffadd50b14f2b9225539d02aa286b7a27470c52d Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 13:25:21 +0100 Subject: [PATCH 04/20] Disabled standalone builds with ubuntu and 2021 editor --- .yamato/_run-all.yml | 12 ++++++++++++ .yamato/code-coverage.yml | 5 ++--- .yamato/desktop-standalone-tests.yml | 6 ++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 7c37aa7179..881ddfd896 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -130,7 +130,13 @@ run_all_project_tests_desktop_standalone: {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} +# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since +# 1) The 2021 editor will soon be out of support +# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks +# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on +{% if editor != "2021.3" or platform.name != "ubuntu" %} - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }} +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} @@ -158,7 +164,13 @@ run_all_project_tests_desktop_standalone_2021: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for backend in scripting_backends -%} +# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since +# 1) The 2021 editor will soon be out of support +# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks +# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on +{% if editor != "2021.3" or platform.name != "ubuntu" %} - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_2021.3 +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index fe67298018..d2f26939ff 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -14,11 +14,10 @@ code_coverage_{{ platform.name }}_{{ editor }}: image: {{ platform.image }} flavor: {{ platform.flavor }} commands: + - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr - - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor - - DISPLAY=:0 ./utr --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --enable-code-coverage --coverage-options='generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --coverage-results-path=test-results/CoverageResults --extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --reruncount=1 --clean-library-on-rerun + - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" artifacts: logs: paths: diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index 60f669b665..7fd83a4e4a 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -70,6 +70,11 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} +# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since +# 1) The 2021 editor will soon be out of support +# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks +# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on +{% if editor != "2021.3" or platform.name != "ubuntu" %} desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}: name : Standalone Test - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}] agent: @@ -102,6 +107,7 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ - "test-results/**/*" dependencies: - .yamato/desktop-standalone-tests.yml#desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }} +{% endif %} {% endfor -%} {% endfor -%} {% endfor -%} From eeded49ee57aba27fe35a863dfcbccf9640ecec1 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 13:33:53 +0100 Subject: [PATCH 05/20] modified code cov command --- .yamato/code-coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index d2f26939ff..3b0e895ec6 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -16,6 +16,8 @@ code_coverage_{{ platform.name }}_{{ editor }}: commands: - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait + + - upm-ci package pack --package-path com.unity.netcode.gameobjects - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" artifacts: @@ -23,7 +25,5 @@ code_coverage_{{ platform.name }}_{{ editor }}: paths: - "test-results/**/*" - "CoverageResults/**/*" - dependencies: - - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} {% endfor -%} \ No newline at end of file From a450c80737aa1061f125e3d71f0cb2b241aa3a9e Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 13:42:24 +0100 Subject: [PATCH 06/20] Corrected command --- .yamato/code-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 3b0e895ec6..9a46293da4 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -19,7 +19,7 @@ code_coverage_{{ platform.name }}_{{ editor }}: - upm-ci package pack --package-path com.unity.netcode.gameobjects - - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" + - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects-*.tgz --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" artifacts: logs: paths: From 4f9553abf7e43d6ae205bb3a63afac86702076dc Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 13:47:08 +0100 Subject: [PATCH 07/20] Disabled console builds and tests for 2023 editor --- .yamato/_run-all.yml | 3 +++ .yamato/console-standalone-test.yml | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 881ddfd896..6f22c58d52 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -218,7 +218,10 @@ run_all_project_tests_console_standalone: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} {% for editor in validation_editors.all -%} +# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list +{% if editor != "2023.3" %} - .yamato/console-standalone-test.yml#run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }} +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} diff --git a/.yamato/console-standalone-test.yml b/.yamato/console-standalone-test.yml index 2d5ca4861e..09723ab7fb 100644 --- a/.yamato/console-standalone-test.yml +++ b/.yamato/console-standalone-test.yml @@ -15,6 +15,8 @@ {% for project in projects.default -%} {% for platform in test_platforms.console_build -%} {% for editor in validation_editors.all -%} +# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list +{% if editor != "2023.3" %} build_{{ project.name }}_{{ platform.name }}_{{ editor }}: name: Build {{ project.name }} - [{{ platform.name }}, {{ editor }}, il2cpp{% if platform.name == "switch" %}, arm64{% endif %}] agent: @@ -47,6 +49,7 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: logs: paths: - "artifacts/**/*" +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} @@ -57,6 +60,8 @@ build_{{ project.name }}_{{ platform.name }}_{{ editor }}: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} {% for editor in validation_editors.all -%} +# When building consoles with 2023 editor there are errors related to SDK version or uninstalled components. I will disable those for now and will add to my investigation list +{% if editor != "2023.3" %} run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}: name: Run {{ project.name }} Tests - [{{ platform.name }}, {{ editor }}, il2cpp] agent: @@ -91,6 +96,7 @@ run_{{ project.name }}_tests_{{ platform.name }}_{{ editor }}: - "test-results/**/*" dependencies: - .yamato/console-standalone-test.yml#build_{{ project.name }}_{{ platform.name }}_{{ editor }} +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} \ No newline at end of file From cd46ff662973be13695a78cb5ff7f38c7c61afbd Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 14:03:54 +0100 Subject: [PATCH 08/20] Added missing using statement --- .yamato/_run-all.yml | 2 +- .../Tests/Runtime/RpcTypeSerializationTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 6f22c58d52..011a93208d 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -168,7 +168,7 @@ run_all_project_tests_desktop_standalone_2021: # 1) The 2021 editor will soon be out of support # 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks # 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on -{% if editor != "2021.3" or platform.name != "ubuntu" %} +{% if platform.name != "ubuntu" %} - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_2021.3 {% endif -%} {% endfor -%} diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs index be2ed31db0..80da140294 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs @@ -4,6 +4,7 @@ using Unity.Collections; using Unity.Netcode.TestHelpers.Runtime; using UnityEngine; +using UnityEngine.TestTools; using Quaternion = UnityEngine.Quaternion; using Vector2 = UnityEngine.Vector2; using Vector3 = UnityEngine.Vector3; From 527791471b123836e33d971ab3106bd21f378012 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 14:13:54 +0100 Subject: [PATCH 09/20] Disabled build for ubuntu with 2021 editor --- .yamato/desktop-standalone-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.yamato/desktop-standalone-tests.yml b/.yamato/desktop-standalone-tests.yml index 7fd83a4e4a..eceff41b3c 100644 --- a/.yamato/desktop-standalone-tests.yml +++ b/.yamato/desktop-standalone-tests.yml @@ -13,6 +13,11 @@ {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} {% for backend in scripting_backends -%} +# There is an error 'No usable version of libssl' when it comes to building with combination of ubuntu and 2021 editor. It's not really worth to address it since +# 1) The 2021 editor will soon be out of support +# 2) We still have the same coverage by using mac and ubuntu is used in a whole bunch of different tests, so I'm quite sure it won't lead to any bug leaks +# 3) The solution could be to manually install libss1.1 (since image has libssl3 and this causes conflicts on 2021 editor related to dotnet versions and support). There were several threads on this topic which can be looked on +{% if editor != "2021.3" or platform.name != "ubuntu" %} desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}: name : Standalone Build - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}] agent: @@ -57,6 +62,7 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ dependencies: - .yamato/project-pack.yml#project_pack_-_{{ project.name }}_{{ platform.name }} +{% endif %} {% endfor -%} {% endfor -%} {% endfor -%} From 95e6b713177e96380d1ea38f09a1d1a8a6018727 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 18 Feb 2025 14:40:02 +0100 Subject: [PATCH 10/20] Added paths to code coverage --- .yamato/code-coverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 9a46293da4..8a58240c0c 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -19,11 +19,11 @@ code_coverage_{{ platform.name }}_{{ editor }}: - upm-ci package pack --package-path com.unity.netcode.gameobjects - - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects-*.tgz --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" + - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects-*.tgz --artifacts-path=test-results --enable-code-coverage --coverage-results-path=CoverageResults --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" artifacts: logs: paths: - "test-results/**/*" - - "CoverageResults/**/*" + - "**/CoverageResults/**/*" {% endfor -%} {% endfor -%} \ No newline at end of file From ff9bb71de3bc4c0db4594303297bde04af36553b Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Thu, 20 Feb 2025 13:05:51 +0100 Subject: [PATCH 11/20] Added tracking comments --- .../Tests/Runtime/NetworkVariableTests.cs | 10 +++++----- .../Tests/Runtime/RpcTypeSerializationTests.cs | 2 +- .../Tests/Runtime/Timing/TimeInitializationTest.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs index 3a198ae758..f9995caba4 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariableTests.cs @@ -1844,7 +1844,7 @@ public void WhenSerializingAndDeserializingValueTypeNetworkVariables_ValuesAreSe } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on mobile devices on 2021 editor specifically + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. The job is failing on mobile devices on 2021 editor specifically public void WhenSerializingAndDeserializingValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly( [Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint), @@ -2180,7 +2180,7 @@ public string ArrayStr(NativeArray arr) where T : unmanaged } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on iOS + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly( @@ -2646,7 +2646,7 @@ public string DictionaryStr(Dictionary list) } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on iOS + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesAreSerializedCorrectly( @@ -2833,7 +2833,7 @@ public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesA } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on iOS + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_ValuesAreSerializedCorrectly( @@ -2989,7 +2989,7 @@ public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_Valu } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is unstable on mobile devices + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. [Repeat(5)] public void WhenSerializingAndDeserializingVeryLargeDictionaryNetworkVariables_ValuesAreSerializedCorrectly( diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs index 80da140294..4758a23b6d 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/RpcTypeSerializationTests.cs @@ -1504,7 +1504,7 @@ public void WhenSendingAnArrayOfValueTypesOverAnRpc_ValuesAreSerializedCorrectly } [Test] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on mobile devices on 2021 editor specifically + [UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Tracked in MTT-11356. The job is failing on mobile devices on 2021 editor specifically public void WhenSendingANativeArrayOfValueTypesOverAnRpc_ValuesAreSerializedCorrectly( [Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint), diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs index 89d118c353..507fbafac4 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Timing/TimeInitializationTest.cs @@ -16,7 +16,7 @@ public class TimeInitializationTest private NetworkManager m_Client; [UnityTest] - [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on Android + [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] // Tracked in MTT-11356. public IEnumerator TestClientTimeInitializationOnConnect([Values(0, 1f)] float serverStartDelay, [Values(0, 1f)] float clientStartDelay, [Values(true, false)] bool isHost) { // Create multiple NetworkManager instances From da7684faa8c85568155049ad8ef412c75c34d17b Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Thu, 20 Feb 2025 17:44:36 +0100 Subject: [PATCH 12/20] Annotated tracking in Jira --- .../Tests/Editor/InterpolatorTests.cs | 4 +-- .../NetworkMetricsRegistrationTests.cs | 2 +- .../Tests/Runtime/DeferredMessagingTests.cs | 1 - .../NetworkObjectSpawnManyObjectsTests.cs | 2 +- .../NetworkTransformAnticipationTests.cs | 3 +- .../Tests/Runtime/UniversalRpcTests.cs | 32 +++++++++---------- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Editor/InterpolatorTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/InterpolatorTests.cs index 224a25e0f8..d28e41619b 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/InterpolatorTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/InterpolatorTests.cs @@ -105,7 +105,7 @@ public void OutOfOrderShouldStillWork() Assert.That(interpolator.GetInterpolatedValue(), Is.EqualTo(2f).Within(k_Precision)); } - [Ignore("TODO: Fix this test to still handle testing message loss without extrapolation")] + [Ignore("TODO: Fix this test to still handle testing message loss without extrapolation. This is tracked in MTT-11338")] [Test] public void MessageLoss() { @@ -306,7 +306,7 @@ public void TestUpdatingInterpolatorWithNoData() Assert.Throws(() => interpolator.Update(1f, serverTime)); } - [Ignore("TODO: Fix this test to still test duplicated values without extrapolation")] + [Ignore("TODO: Fix this test to still test duplicated values without extrapolation. This is tracked in MTT-11338")] [Test] public void TestDuplicatedValues() { diff --git a/com.unity.netcode.gameobjects/Tests/Editor/Metrics/NetworkMetricsRegistrationTests.cs b/com.unity.netcode.gameobjects/Tests/Editor/Metrics/NetworkMetricsRegistrationTests.cs index e962c86eb7..9bd354bb41 100644 --- a/com.unity.netcode.gameobjects/Tests/Editor/Metrics/NetworkMetricsRegistrationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Editor/Metrics/NetworkMetricsRegistrationTests.cs @@ -16,7 +16,7 @@ public class NetworkMetricsRegistrationTests .ToArray(); [TestCaseSource(nameof(s_MetricTypes))] - [Ignore("Disable test while we reevaluate the assumption that INetworkMetricEvent interfaces must be reported from MLAPI.")] + [Ignore("Disable test while we reevaluate the assumption that INetworkMetricEvent interfaces must be reported from MLAPI. This is tracked in MTT-11339")] public void ValidateThatAllMetricTypesAreRegistered(Type metricType) { var dispatcher = new NetworkMetrics().Dispatcher as MetricDispatcher; diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs index 1cccee03fe..cd48944567 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs @@ -492,7 +492,6 @@ public void WhenANetworkVariableDeltaMessageArrivesBeforeASpawnArrives_ItIsDefer } [Test] - //[Ignore("Disabling this temporarily until it is migrated into new integration test.")] public void WhenASpawnMessageArrivesBeforeThePrefabIsAvailable_ItIsDeferred() { m_SkipAddingPrefabsToClient = true; diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs index 68dc16e3d1..4ed1f816fc 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs @@ -48,7 +48,7 @@ protected override void OnServerAndClientsCreated() [UnityTest] // When this test fails it does so without an exception and will wait the default ~6 minutes - [Timeout(360000)] + [Timeout(360000)] // Tracked in MTT-11360 public IEnumerator WhenManyObjectsAreSpawnedAtOnce_AllAreReceived() { for (int x = 0; x < k_SpawnedObjects; x++) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs index 2203411617..5b11e84a48 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkTransformAnticipationTests.cs @@ -115,8 +115,7 @@ public AnticipatedNetworkTransform GetOtherClientComponent() } [Test] - // I will add this test to track in Jira as next step (after having working CI in place). The job is failing on Android - [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] + [UnityPlatform(exclude = new[] { RuntimePlatform.Android })] // Tracked in MTT-11361 public void WhenAnticipating_ValueChangesImmediately() { var testComponent = GetTestComponent(); diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs index b06bb97ea4..584a13ae62 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs @@ -918,7 +918,7 @@ public void RethrowTargetInvocationException(Action action) } } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingNoOverride : UniversalRpcTestsBase @@ -949,7 +949,7 @@ public void TestSendingNoOverride( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSenderClientId : UniversalRpcTestsBase @@ -980,7 +980,7 @@ public void TestSenderClientId( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingNoOverrideWithParams : UniversalRpcTestsBase @@ -1023,7 +1023,7 @@ public void TestSendingNoOverrideWithParams( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingNoOverrideWithParamsAndRpcParams : UniversalRpcTestsBase @@ -1066,7 +1066,7 @@ public void TestSendingNoOverrideWithParamsAndRpcParams( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestRequireOwnership : UniversalRpcTestsBase @@ -1103,7 +1103,7 @@ public void TestRequireOwnership( } } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestDisallowedOverride : UniversalRpcTestsBase @@ -1139,7 +1139,7 @@ public void TestDisallowedOverride( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingWithTargetOverride : UniversalRpcTestsBase @@ -1173,7 +1173,7 @@ public void TestSendingWithTargetOverride( } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingWithSingleOverride : UniversalRpcTestsBase @@ -1221,7 +1221,7 @@ public IEnumerator TestSendingWithSingleOverride() } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingWithSingleNotOverride : UniversalRpcTestsBase @@ -1269,7 +1269,7 @@ public IEnumerator TestSendingWithSingleNotOverride() } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingWithGroupOverride : UniversalRpcTestsBase @@ -1348,7 +1348,7 @@ [Values] AllocationType allocationType } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSendingWithGroupNotOverride : UniversalRpcTestsBase @@ -1427,7 +1427,7 @@ [Values] AllocationType allocationType } } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestDefaultSendToSpecifiedInParamsSendingToServerAndOwner : UniversalRpcTestsBase @@ -1438,7 +1438,7 @@ public UniversalRpcTestDefaultSendToSpecifiedInParamsSendingToServerAndOwner(Hos } } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestDeferLocal : UniversalRpcTestsBase @@ -1626,7 +1626,7 @@ public IEnumerator TestDeferLocalOverrideToFalse() } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestMutualRecursion : UniversalRpcTestsBase @@ -1676,7 +1676,7 @@ public void TestMutualRecursion() } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(HostOrServer.Host)] [TestFixture(HostOrServer.Server)] internal class UniversalRpcTestSelfRecursion : UniversalRpcTestsBase @@ -1716,7 +1716,7 @@ public void TestSelfRecursion() } - [Timeout(1200000)] + [Timeout(1200000)] // Tracked in MTT-11359 [TestFixture(ObjType.Server)] [TestFixture(ObjType.Client)] internal class UniversalRpcTestRpcTargetUse : UniversalRpcTestsBase From 4f04730431f660270b4a2135db79a8ac74c85284 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 18 Feb 2025 11:05:27 -0600 Subject: [PATCH 13/20] fix Fixing standards checks issues. Fixing issue with using the upm candidates. --- .../Tests/Runtime/Metrics/MetricsDispatchTests.cs | 2 +- .../Tests/Runtime/Metrics/NetworkObjectMetricsTests.cs | 3 +-- .../Tests/Runtime/Metrics/NetworkVariableMetricsTests.cs | 2 +- .../Tests/Runtime/Metrics/OwnershipChangeMetricsTests.cs | 4 ++-- .../Tests/Runtime/Metrics/PacketLossMetricsTests.cs | 1 - .../Tests/Runtime/Metrics/PacketMetricsTests.cs | 2 +- .../Tests/Runtime/Metrics/RpcMetricsTests.cs | 2 +- .../Tests/Runtime/Metrics/RttMetricsTests.cs | 2 +- .../Tests/Runtime/Metrics/ServerLogsMetricTests.cs | 2 +- .../Assets/Tests/Runtime/SceneEventTests.cs | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/MetricsDispatchTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/MetricsDispatchTests.cs index 519ddfa697..64eae45715 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/MetricsDispatchTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/MetricsDispatchTests.cs @@ -3,8 +3,8 @@ using System.Collections; using NUnit.Framework; using Unity.Multiplayer.Tools.NetStats; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkObjectMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkObjectMetricsTests.cs index 1679607d23..2289a3e769 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkObjectMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkObjectMetricsTests.cs @@ -4,11 +4,10 @@ using System.Linq; using NUnit.Framework; using Unity.Multiplayer.Tools.MetricTypes; +using Unity.Netcode.TestHelpers.Runtime.Metrics; using UnityEngine; using UnityEngine.TestTools; -using Unity.Netcode.TestHelpers.Runtime.Metrics; - namespace Unity.Netcode.RuntimeTests.Metrics { internal class NetworkObjectMetricsTests : SingleClientMetricTestBase diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkVariableMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkVariableMetricsTests.cs index 640cee4615..11f38cea1b 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkVariableMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/NetworkVariableMetricsTests.cs @@ -3,8 +3,8 @@ using System.Linq; using NUnit.Framework; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/OwnershipChangeMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/OwnershipChangeMetricsTests.cs index a3fcf30b3f..cc08dcd5b7 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/OwnershipChangeMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/OwnershipChangeMetricsTests.cs @@ -4,10 +4,10 @@ using NUnit.Framework; using Unity.Collections; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketLossMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketLossMetricsTests.cs index 4a008cfe5e..23d855580d 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketLossMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketLossMetricsTests.cs @@ -1,6 +1,5 @@ #if MULTIPLAYER_TOOLS #if MULTIPLAYER_TOOLS_1_0_0_PRE_7 - using System.Collections; using NUnit.Framework; using Unity.Collections; diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketMetricsTests.cs index 90707de0b8..b6bfd71bf9 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/PacketMetricsTests.cs @@ -4,8 +4,8 @@ using NUnit.Framework; using Unity.Collections; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RpcMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RpcMetricsTests.cs index b2b186a6f6..f68d502597 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RpcMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RpcMetricsTests.cs @@ -4,8 +4,8 @@ using NUnit.Framework; using Unity.Collections; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RttMetricsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RttMetricsTests.cs index 2c77c66f3a..3a1a2ca2d4 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RttMetricsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/RttMetricsTests.cs @@ -7,9 +7,9 @@ using NUnit.Framework; using Unity.Collections; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/ServerLogsMetricTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/ServerLogsMetricTests.cs index 4fbd75fe36..758d7aa114 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/ServerLogsMetricTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/Metrics/ServerLogsMetricTests.cs @@ -5,8 +5,8 @@ using NUnit.Framework; using Unity.Collections; using Unity.Multiplayer.Tools.MetricTypes; -using UnityEngine.TestTools; using Unity.Netcode.TestHelpers.Runtime.Metrics; +using UnityEngine.TestTools; namespace Unity.Netcode.RuntimeTests.Metrics { diff --git a/testproject-tools-integration/Assets/Tests/Runtime/SceneEventTests.cs b/testproject-tools-integration/Assets/Tests/Runtime/SceneEventTests.cs index c5d5a17812..eccaf57490 100644 --- a/testproject-tools-integration/Assets/Tests/Runtime/SceneEventTests.cs +++ b/testproject-tools-integration/Assets/Tests/Runtime/SceneEventTests.cs @@ -5,10 +5,10 @@ using NUnit.Framework; using Unity.Multiplayer.Tools.MetricTypes; using Unity.Netcode; +using Unity.Netcode.TestHelpers.Runtime; using Unity.Netcode.TestHelpers.Runtime.Metrics; using UnityEngine.SceneManagement; using UnityEngine.TestTools; -using Unity.Netcode.TestHelpers.Runtime; using SceneEventType = Unity.Netcode.SceneEventType; namespace TestProject.ToolsIntegration.RuntimeTests From 40be8a8ea82c53eb6ff83a4dfc15f6d7c966348b Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Tue, 18 Feb 2025 11:12:33 -0600 Subject: [PATCH 14/20] fix Adding Rider editor support for standards checks. --- minimalproject/Packages/manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/minimalproject/Packages/manifest.json b/minimalproject/Packages/manifest.json index ea60805edb..67bc08beac 100644 --- a/minimalproject/Packages/manifest.json +++ b/minimalproject/Packages/manifest.json @@ -1,5 +1,6 @@ { "dependencies": { + "com.unity.ide.rider": "3.0.34", "com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects" }, "testables": [ From 4622fa9d19b8584d8f71bb6cf8df40175e9f78bf Mon Sep 17 00:00:00 2001 From: Noel Stephens Date: Wed, 19 Feb 2025 08:56:41 -0600 Subject: [PATCH 15/20] Update WaitForMetricValues.cs Fixing modifier ordering --- .../TestHelpers/Runtime/Metrics/WaitForMetricValues.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/TestHelpers/Runtime/Metrics/WaitForMetricValues.cs b/com.unity.netcode.gameobjects/TestHelpers/Runtime/Metrics/WaitForMetricValues.cs index 01013851a4..10e8c6b8c5 100644 --- a/com.unity.netcode.gameobjects/TestHelpers/Runtime/Metrics/WaitForMetricValues.cs +++ b/com.unity.netcode.gameobjects/TestHelpers/Runtime/Metrics/WaitForMetricValues.cs @@ -21,7 +21,7 @@ public WaitForMetricValues(IMetricDispatcher dispatcher, DirectionalMetricInfo d dispatcher.RegisterObserver(this); } - abstract public void Observe(MetricCollection collection); + public abstract void Observe(MetricCollection collection); public void AssertMetricValuesHaveNotBeenFound() { From 47503b2821b034ca7e6825cfea17a297a02101ba Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 24 Feb 2025 10:31:31 +0100 Subject: [PATCH 16/20] Updated code coverage --- .yamato/code-coverage.yml | 11 +++++------ .yamato/package-pack.yml | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 8a58240c0c..c0aa7e59fd 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -16,14 +16,13 @@ code_coverage_{{ platform.name }}_{{ editor }}: commands: - npm install -g upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - unity-downloader-cli -u {{ editor }} -c Editor --fast --wait - - - upm-ci package pack --package-path com.unity.netcode.gameobjects - - - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path upm-ci~/packages/com.unity.netcode.gameobjects-*.tgz --artifacts-path=test-results --enable-code-coverage --coverage-results-path=CoverageResults --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=-testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" + - DISPLAY=:0 upm-ci package test -u {{ editor }} --package-path com.unity.netcode.gameobjects --enable-code-coverage --code-coverage-options 'generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime' --extra-utr-arg="--extra-editor-arg=--burst-disable-compilation --extra-editor-arg=testCategory --extra-editor-arg=!Performance --timeout=1800 --reruncount=1 --clean-library-on-rerun" artifacts: logs: paths: - - "test-results/**/*" - - "**/CoverageResults/**/*" + - "upm-ci~/test-results/**/*" + - "upm-ci~/test-results/CoverageResults/**/*" + dependencies: + - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }}_upmCI {% endfor -%} {% endfor -%} \ No newline at end of file diff --git a/.yamato/package-pack.yml b/.yamato/package-pack.yml index a9ab902847..d887b1cdfe 100644 --- a/.yamato/package-pack.yml +++ b/.yamato/package-pack.yml @@ -25,4 +25,27 @@ package_pack_-_ngo_{{ platform.name }}: packages: paths: - "upm-ci~/**" +{% endfor -%} + +# This is in essence the same job as the one above with the difference that upm-ci is used instead of upm-pvp +# The reason for using it is that I had some problems with Code Coverage which in its current form uses upm-ci but if we would use the other pack job (the one above) we would need to use upm-pvp +# I had some problems with getting it to work so as temporary solution I created this pack job which is used ONLY as a dependency of Code Coverage job (other jobs use the above definition of pack job) +# TODO: remove this job and utilize the above one for Code Coverage job +{% for platform in test_platforms.default -%} +{% for project in projects.default -%} +package_pack_-_ngo_{{ platform.name }}_upmCI: + name: Package Pack (legacy upm-ci) - NGO [{{ platform.name }}] + agent: + type: {{ platform.type }} + image: {{ platform.image }} + flavor: {{ platform.flavor }} + timeout: 0.25 + commands: + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm + - upm-ci project pack --project-path {{ project.path }} + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" +{% endfor -%} {% endfor -%} \ No newline at end of file From c3491ee15ec319668fc6464f14b3d983012ca1b3 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 24 Feb 2025 13:05:32 +0100 Subject: [PATCH 17/20] Disabled testproject standars on 2021 editor --- .yamato/_run-all.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 011a93208d..1f2d22a9d9 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -80,7 +80,9 @@ run_all_projects_standards: {% for platform in test_platforms.default -%} {% for project in projects.all -%} {% for editor in validation_editors.default -%} +{% if editor != "2021.3" or project.name != "testproject" %} # Tracked in MTT-11382 - .yamato/project-standards.yml#standards_{{ platform.name }}_{{ project.name }}_{{ editor }} +{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} From 5f0ddf3e9a3ee30402cae747924d35a3f559b71b Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 24 Feb 2025 13:10:15 +0100 Subject: [PATCH 18/20] Correction --- .yamato/_run-all.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 1f2d22a9d9..011a93208d 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -80,9 +80,7 @@ run_all_projects_standards: {% for platform in test_platforms.default -%} {% for project in projects.all -%} {% for editor in validation_editors.default -%} -{% if editor != "2021.3" or project.name != "testproject" %} # Tracked in MTT-11382 - .yamato/project-standards.yml#standards_{{ platform.name }}_{{ project.name }}_{{ editor }} -{% endif -%} {% endfor -%} {% endfor -%} {% endfor -%} From 02f480cdf44c405e9a8d2ec36c3bc9b23ef07750 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 24 Feb 2025 13:12:10 +0100 Subject: [PATCH 19/20] Modified trigger --- .yamato/_triggers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index e8e7a330ce..8b638e26af 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -42,7 +42,7 @@ develop_nightly: dependencies: # Run project standards to verify package/default project - .yamato/project-standards.yml#standards_ubuntu_testproject_trunk - - .yamato/project-standards.yml#standards_ubuntu_testproject_2021.3 +# - .yamato/project-standards.yml#standards_ubuntu_testproject_2021.3 # Tracked in MTT-11382 # Run APV jobs to make sure the change won't break any dependants - .yamato/wrench/preview-a-p-v.yml#all_preview_apv_jobs # Run package EditMode and Playmode tests on desktop platforms on trunk and 2021.3 From 3484b141d226279eec77bfde0a84aa05234c8b19 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Mon, 24 Feb 2025 13:32:53 +0100 Subject: [PATCH 20/20] added comment --- .yamato/package-pack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/package-pack.yml b/.yamato/package-pack.yml index d887b1cdfe..1d54e47212 100644 --- a/.yamato/package-pack.yml +++ b/.yamato/package-pack.yml @@ -30,7 +30,7 @@ package_pack_-_ngo_{{ platform.name }}: # This is in essence the same job as the one above with the difference that upm-ci is used instead of upm-pvp # The reason for using it is that I had some problems with Code Coverage which in its current form uses upm-ci but if we would use the other pack job (the one above) we would need to use upm-pvp # I had some problems with getting it to work so as temporary solution I created this pack job which is used ONLY as a dependency of Code Coverage job (other jobs use the above definition of pack job) -# TODO: remove this job and utilize the above one for Code Coverage job +# TODO: remove this job and utilize the above one for Code Coverage job. This is tracked in MTT-11383 {% for platform in test_platforms.default -%} {% for project in projects.default -%} package_pack_-_ngo_{{ platform.name }}_upmCI: