Skip to content

Commit 567341c

Browse files
mtschoen-unityGitHub Enterprise
authored andcommitted
Merge pull request #18 from unity/jasons/add_editor_test_versions
add editor test version
2 parents 056fe5e + 11207a4 commit 567341c

3 files changed

Lines changed: 48 additions & 6 deletions

File tree

.yamato/test.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
test_editors:
1+
blocking_test_editors:
22
- version: 2019.1.14f1
3+
nonblocking_test_editors:
4+
- version: 2019.3.0f6
5+
- version: 2019.4
6+
- version: 2020.1
7+
- version: 2020.2
38
test_platforms:
49
- name: win
510
type: Unity::VM
@@ -11,7 +16,27 @@ test_platforms:
1116
flavor: m1.mac
1217
---
1318

14-
{% for editor in test_editors %}
19+
{% for editor in blocking_test_editors %}
20+
{% for platform in test_platforms %}
21+
test_{{ platform.name }}_{{ editor.version }}:
22+
name : Test {{ editor.version }} on {{ platform.name }}
23+
agent:
24+
type: {{ platform.type }}
25+
image: {{ platform.image }}
26+
flavor: {{ platform.flavor}}
27+
commands:
28+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
29+
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci package test -u {{ editor.version }} --package-path . --type package-tests
30+
artifacts:
31+
logs:
32+
paths:
33+
- "upm-ci~/test-results/**/*"
34+
dependencies:
35+
- .yamato/pack.yml#pack
36+
{% endfor %}
37+
{% endfor %}
38+
39+
{% for editor in nonblocking_test_editors %}
1540
{% for platform in test_platforms %}
1641
test_{{ platform.name }}_{{ editor.version }}:
1742
name : Test {{ editor.version }} on {{ platform.name }}
@@ -33,7 +58,7 @@ test_{{ platform.name }}_{{ editor.version }}:
3358

3459
# Validate the package on each editor version and each platform
3560
# Validation only occurs in editmode.
36-
{% for editor in test_editors %}
61+
{% for editor in blocking_test_editors %}
3762
{% for platform in test_platforms %}
3863
validate_{{ platform.name }}_{{ editor.version }}:
3964
name : Validate {{ editor.version }} on {{ platform.name }}
@@ -65,9 +90,14 @@ test_trigger:
6590
- "/.*/"
6691
dependencies:
6792
- .yamato/pack.yml#pack
68-
{% for editor in test_editors %}
93+
{% for editor in blocking_test_editors %}
6994
{% for platform in test_platforms %}
7095
- .yamato/test.yml#test_{{platform.name}}_{{editor.version}}
7196
- .yamato/test.yml#validate_{{platform.name}}_{{editor.version}}
7297
{% endfor %}
7398
{% endfor %}
99+
{% for editor in nonblocking_test_editors %}
100+
{% for platform in test_platforms %}
101+
- .yamato/test.yml#test_{{platform.name}}_{{editor.version}}
102+
{% endfor %}
103+
{% endfor %}

Runtime/Scripts/Core/VRView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,5 +552,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled)
552552
}
553553
}
554554
#endif
555-
}
556-
}
555+
}
556+
}

Tests/Editor/Unit/Core/EditingContextManagerTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Edit mode support requires legacy VR, which was removed in 2020.1
2+
#if UNITY_EDITOR && !UNITY_2020_1_OR_NEWER
3+
#define UNITY_EDITORXR_EDIT_MODE_SUPPORT
4+
#endif
5+
16
using NUnit.Framework;
27
using System.Collections.Generic;
38
using System.IO;
@@ -47,6 +52,7 @@ public void Setup()
4752
EditingContextManager.SaveProjectSettings(settings);
4853
}
4954

55+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
5056
[Test]
5157
public void Initializes_WithDefaultContext()
5258
{
@@ -87,6 +93,7 @@ public void RestorePreviousContext_SetsPreviousContextToCurrent()
8793
manager.RestorePreviousContext();
8894
Assert.AreEqual(beginningContext, manager.currentContext);
8995
}
96+
#endif
9097

9198
[Test]
9299
public void LoadProjectSettings_IfAssetFound()
@@ -163,10 +170,15 @@ public void SaveUserSettings_UpdatesUserSettingsFile()
163170
[OneTimeTearDown]
164171
public void Cleanup()
165172
{
173+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
166174
manager.SetEditingContext(EditingContextManager.defaultContext);
175+
#endif
167176
UnityObjectUtils.Destroy(context);
168177
UnityObjectUtils.Destroy(context2);
178+
179+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
169180
VRView.activeView.Close();
181+
#endif
170182
}
171183
}
172184

0 commit comments

Comments
 (0)