From b118766507565d0b4984334e51178ed2e25782d7 Mon Sep 17 00:00:00 2001 From: Jason Smalridge Date: Tue, 8 Sep 2020 15:03:31 -0400 Subject: [PATCH 1/3] add editor test version --- .yamato/test.yml | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.yamato/test.yml b/.yamato/test.yml index d44d7da79..a52f4798d 100644 --- a/.yamato/test.yml +++ b/.yamato/test.yml @@ -1,5 +1,10 @@ -test_editors: +blocking_test_editors: - version: 2019.1.14f1 +nonblocking_test_editors: + - version: 2019.3.0f6 + - version: 2019.4 + - version: 2020.1 + - version: 2020.2 test_platforms: - name: win type: Unity::VM @@ -11,7 +16,7 @@ test_platforms: flavor: m1.mac --- -{% for editor in test_editors %} +{% for editor in blocking_test_editors %} {% for platform in test_platforms %} test_{{ platform.name }}_{{ editor.version }}: name : Test {{ editor.version }} on {{ platform.name }} @@ -21,7 +26,27 @@ test_{{ platform.name }}_{{ editor.version }}: flavor: {{ platform.flavor}} commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests + - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests --enable-code-coverage + artifacts: + logs: + paths: + - "upm-ci~/test-results/**/*" + dependencies: + - .yamato/pack.yml#pack +{% endfor %} +{% endfor %} + +{% for editor in nonblocking_test_editors %} +{% for platform in test_platforms %} +test_{{ platform.name }}_{{ editor.version }}: + name : Test {{ editor.version }} on {{ platform.name }} + agent: + type: {{ platform.type }} + image: {{ platform.image }} + flavor: {{ platform.flavor}} + commands: + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm + - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests --enable-code-coverage artifacts: logs: paths: @@ -33,7 +58,7 @@ test_{{ platform.name }}_{{ editor.version }}: # Validate the package on each editor version and each platform # Validation only occurs in editmode. -{% for editor in test_editors %} +{% for editor in blocking_test_editors %} {% for platform in test_platforms %} validate_{{ platform.name }}_{{ editor.version }}: name : Validate {{ editor.version }} on {{ platform.name }} @@ -65,9 +90,14 @@ test_trigger: - "/.*/" dependencies: - .yamato/pack.yml#pack - {% for editor in test_editors %} + {% for editor in blocking_test_editors %} {% for platform in test_platforms %} - .yamato/test.yml#test_{{platform.name}}_{{editor.version}} - .yamato/test.yml#validate_{{platform.name}}_{{editor.version}} {% endfor %} {% endfor %} + {% for editor in nonblocking_test_editors %} + {% for platform in test_platforms %} + - .yamato/test.yml#test_{{platform.name}}_{{editor.version}} + {% endfor %} + {% endfor %} \ No newline at end of file From cb8f8f1ea878a01d627170c8a00dc7e692912e66 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 10 Sep 2020 19:35:36 -0700 Subject: [PATCH 2/3] Remove code coverage tests to resolve failures on 2019.1 --- .yamato/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.yamato/test.yml b/.yamato/test.yml index a52f4798d..ab5bec20b 100644 --- a/.yamato/test.yml +++ b/.yamato/test.yml @@ -26,7 +26,7 @@ test_{{ platform.name }}_{{ editor.version }}: flavor: {{ platform.flavor}} commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests --enable-code-coverage + - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests artifacts: logs: paths: @@ -46,7 +46,7 @@ test_{{ platform.name }}_{{ editor.version }}: flavor: {{ platform.flavor}} commands: - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm - - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests --enable-code-coverage + - {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests artifacts: logs: paths: @@ -100,4 +100,4 @@ test_trigger: {% for platform in test_platforms %} - .yamato/test.yml#test_{{platform.name}}_{{editor.version}} {% endfor %} - {% endfor %} \ No newline at end of file + {% endfor %} From 11207a4554645ac89828dc593394230db952093c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 10 Sep 2020 22:47:00 -0700 Subject: [PATCH 3/3] Remove tests that require edit mode support with #ifdef in 2020.x --- Runtime/Scripts/Core/VRView.cs | 4 ++-- Tests/Editor/Unit/Core/EditingContextManagerTests.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/Core/VRView.cs b/Runtime/Scripts/Core/VRView.cs index 9fcfd17ad..1ab538245 100644 --- a/Runtime/Scripts/Core/VRView.cs +++ b/Runtime/Scripts/Core/VRView.cs @@ -552,5 +552,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled) } } #endif - } - } + } +} diff --git a/Tests/Editor/Unit/Core/EditingContextManagerTests.cs b/Tests/Editor/Unit/Core/EditingContextManagerTests.cs index 30849fec4..d888cf292 100644 --- a/Tests/Editor/Unit/Core/EditingContextManagerTests.cs +++ b/Tests/Editor/Unit/Core/EditingContextManagerTests.cs @@ -1,3 +1,8 @@ +// Edit mode support requires legacy VR, which was removed in 2020.1 +#if UNITY_EDITOR && !UNITY_2020_1_OR_NEWER +#define UNITY_EDITORXR_EDIT_MODE_SUPPORT +#endif + using NUnit.Framework; using System.Collections.Generic; using System.IO; @@ -47,6 +52,7 @@ public void Setup() EditingContextManager.SaveProjectSettings(settings); } +#if UNITY_EDITORXR_EDIT_MODE_SUPPORT [Test] public void Initializes_WithDefaultContext() { @@ -87,6 +93,7 @@ public void RestorePreviousContext_SetsPreviousContextToCurrent() manager.RestorePreviousContext(); Assert.AreEqual(beginningContext, manager.currentContext); } +#endif [Test] public void LoadProjectSettings_IfAssetFound() @@ -163,10 +170,15 @@ public void SaveUserSettings_UpdatesUserSettingsFile() [OneTimeTearDown] public void Cleanup() { +#if UNITY_EDITORXR_EDIT_MODE_SUPPORT manager.SetEditingContext(EditingContextManager.defaultContext); +#endif UnityObjectUtils.Destroy(context); UnityObjectUtils.Destroy(context2); + +#if UNITY_EDITORXR_EDIT_MODE_SUPPORT VRView.activeView.Close(); +#endif } }