Skip to content

Commit

Permalink
FIX: Broken CI (Unity-Technologies#1159).
Browse files Browse the repository at this point in the history
  • Loading branch information
karljj1 authored Jun 5, 2020
1 parent cb9f2f0 commit 3aa5e8b
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 44 deletions.
36 changes: 36 additions & 0 deletions .yamato/config.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
editors:
- version: 2019.1
- version: 2020.1
platforms:
- name: win
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
- name: win_standalone
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
runtime: StandaloneWindows64
- name: win_standalone_il2cpp
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
- name: mac
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
- name: mac_standalone
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
runtime: StandaloneOSX
- name: mac_standalone_il2cpp
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
runtime: StandaloneOSX
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
10 changes: 7 additions & 3 deletions .yamato/test-samples.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
test_sample_projects:
name : Test Sample Projects
{% metadata_file .yamato/config.metadata %}
---
{% for editor in editors %}
test_sample_projects_{{ editor.version }}:
name : Test Sample Projects {{ editor.version }}
agent:
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u 2019.1
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
- Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=DryRun sh ExternalSampleProjects/publish.sh
triggers:
branches:
Expand All @@ -17,3 +20,4 @@ test_sample_projects:
UTR_Output.zip:
paths:
- "upm-ci~/**/*"
{% endfor %}
47 changes: 12 additions & 35 deletions .yamato/upm-ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
editors:
- version: 2019.1
platforms:
- name: win
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
- name: win_standalone
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
runtime: StandaloneWindows64
- name: win_standalone_il2cpp
type: Unity::VM
image: package-ci/win10:latest
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: c:\python27\Scripts\unity-downloader-cli.exe -c editor -c StandaloneSupport-IL2CPP -w -u
- name: mac
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
- name: mac_standalone
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
runtime: StandaloneOSX
- name: mac_standalone_il2cpp
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
runtime: StandaloneOSX
scripting-backend: Il2Cpp
installscript: ~/Library/Python/3.7/bin/unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
{% metadata_file .yamato/config.metadata %}
---
{% for editor in editors %}
{% for platform in platforms %}
Expand All @@ -49,10 +15,12 @@ platforms:
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
{% if platform.installscript %}
- pip install unity-downloader-cli --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- {{ platform.installscript }} {{ editor.version }}
{% endif %}
- upm-ci~/tools/utr/utr --testproject . --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %}
triggers:
cancel_old_ci: true
branches:
only:
- "/.*/"
Expand All @@ -63,6 +31,15 @@ platforms:
{% endfor %}
{% endfor %}

all_tests:
name: All Tests
dependencies:
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/upm-ci.yml#{{ platform.name }}_{{ editor.version }}
{% endfor %}
{% endfor %}

publish:
name: Publish to Internal Registry
agent:
Expand Down
42 changes: 37 additions & 5 deletions Assets/Tests/InputSystem/Plugins/XRTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,31 @@ public void Components_CanUpdateGameObjectTransformThroughTrackedPoseDriver()

private const int kNumBaseHMDControls = 10;

#if UNITY_2019_3_OR_NEWER
static InputDeviceCharacteristics CharacteristicsFromInputDeviceRole(InputDeviceRole role)
{
switch (role)
{
case InputDeviceRole.Generic:
return InputDeviceCharacteristics.HeadMounted;
case InputDeviceRole.LeftHanded:
return InputDeviceCharacteristics.Controller | InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.Left;
case InputDeviceRole.RightHanded:
return InputDeviceCharacteristics.Controller | InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.Right;
case InputDeviceRole.GameController:
return InputDeviceCharacteristics.Controller;
case InputDeviceRole.TrackingReference:
return InputDeviceCharacteristics.TrackingReference;
case InputDeviceRole.HardwareTracker:
return InputDeviceCharacteristics.TrackedDevice;
case InputDeviceRole.LegacyController:
return InputDeviceCharacteristics.Controller;
}
return InputDeviceCharacteristics.None;
}

#endif

private static InputDeviceDescription CreateSimpleDeviceDescriptionByRole(InputDeviceRole role)
{
return new InputDeviceDescription
Expand All @@ -441,7 +466,9 @@ private static InputDeviceDescription CreateSimpleDeviceDescriptionByRole(InputD
manufacturer = "Manufacturer",
capabilities = new XRDeviceDescriptor
{
#if !UNITY_2019_3_OR_NEWER
#if UNITY_2019_3_OR_NEWER
characteristics = CharacteristicsFromInputDeviceRole(role),
#else
deviceRole = role,
#endif
inputFeatures = new List<XRFeatureDescriptor>()
Expand All @@ -465,10 +492,11 @@ private static InputDeviceDescription CreateMangledNameDeviceDescription()
manufacturer = "__Manufacturer::",
capabilities = new XRDeviceDescriptor
{
#if !UNITY_2019_3_OR_NEWER
#if UNITY_2019_3_OR_NEWER
characteristics = CharacteristicsFromInputDeviceRole(InputDeviceRole.Generic),
#else
deviceRole = InputDeviceRole.Generic,
#endif

inputFeatures = new List<XRFeatureDescriptor>()
{
new XRFeatureDescriptor()
Expand Down Expand Up @@ -502,7 +530,9 @@ public static InputDeviceDescription CreateDeviceDescription()
manufacturer = "XRManufacturer",
capabilities = new XRDeviceDescriptor
{
#if !UNITY_2019_3_OR_NEWER
#if UNITY_2019_3_OR_NEWER
characteristics = CharacteristicsFromInputDeviceRole(InputDeviceRole.Generic),
#else
deviceRole = InputDeviceRole.Generic,
#endif
inputFeatures = new List<XRFeatureDescriptor>()
Expand Down Expand Up @@ -576,7 +606,9 @@ public static InputDeviceDescription CreateDeviceDescription()
manufacturer = "XRManufacturer",
capabilities = new XRDeviceDescriptor
{
#if !UNITY_2019_3_OR_NEWER
#if UNITY_2019_3_OR_NEWER
characteristics = CharacteristicsFromInputDeviceRole(InputDeviceRole.Generic),
#else
deviceRole = InputDeviceRole.Generic,
#endif
inputFeatures = new List<XRFeatureDescriptor>()
Expand Down
2 changes: 2 additions & 0 deletions Packages/com.unity.inputsystem/InputSystem/InputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3147,6 +3147,8 @@ private static void Reset(bool enableRemoting = false, IInputRuntime runtime = n
InitializeInPlayer(runtime, settings);
#endif

Mouse.s_PlatformMouseDevice = null;

InputUser.ResetGlobals();
Profiling.Profiler.EndSample();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void Integration_CanSendAndReceiveEvents()

[UnityTest]
[Category("Integration")]
[Ignore("Unstable due to 1252825")]
public IEnumerator WindowsInput_RemoteDesktopMouseMovements_AreDetected()
{
var mouse = InputSystem.GetDevice<Mouse>();
Expand All @@ -69,6 +70,7 @@ public IEnumerator WindowsInput_RemoteDesktopMouseMovements_AreDetected()

[UnityTest]
[Category("Integration")]
[Ignore("Unstable due to 1252825")]
public IEnumerator WindowsInput_MouseMovements_AreDetected()
{
var mouse = InputSystem.GetDevice<Mouse>();
Expand Down
2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"com.unity.multiplayer-hlapi": "1.0.2",
"com.unity.package-manager-doctools": "1.1.1-preview.5",
"com.unity.package-manager-ui": "2.1.2",
"com.unity.probuilder": "4.0.5",
"com.unity.probuilder": "4.2.3",
"com.unity.purchasing": "2.0.6",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.0.0",
Expand Down
1 change: 1 addition & 0 deletions ProjectSettings/EditorSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ EditorSettings:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInPlayMode: 1
m_AssetPipelineMode: 1

0 comments on commit 3aa5e8b

Please sign in to comment.