Skip to content

Commit 5802bb7

Browse files
authored
Merge branch 'develop' into isx-2279-spike-module-dependency
2 parents 432e3d9 + 9506d23 commit 5802bb7

File tree

95 files changed

+1354
-442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1354
-442
lines changed

.github/codecov.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
codecov:
2+
max_report_age: false
3+
require_ci_to_pass: false
4+
notify:
5+
wait_for_ci: true
6+
7+
coverage:
8+
precision: 2
9+
round: down
10+
range: "50...70"
11+
status:
12+
patch:
13+
default:
14+
target: auto
15+
threshold: 1%
16+
base: auto
17+
if_ci_failed: success
18+
informational: true
19+
only_pulls: true
20+
default_rules:
21+
flag_coverage_not_uploaded_behavior: exclude
22+
project:
23+
default:
24+
target: auto
25+
threshold: 1%
26+
base: auto
27+
if_ci_failed: success
28+
informational: true
29+
only_pulls: true
30+
31+
comment:
32+
layout: "diff,flags,files"
33+
behavior: default
34+
require_changes: false
35+
require_base: true
36+
require_head: true
37+
after_n_builds: 1
38+
39+
flag_management:
40+
default_rules:
41+
carryforward: true

.yamato/analyze.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ code_analyser:
1717
- upm-ci project test --project-path Tools/CodeAnalyzerTestProject -u 2021.3
1818
triggers:
1919
cancel_old_ci: true
20-
pull_requests:
21-
- targets:
22-
only:
23-
- "develop"
20+
expression: pull_request.(target eq "develop" AND NOT changes.all match "**/*.md")
2421
artifacts:
2522
UTR_Output.zip:
2623
paths:

.yamato/config.metadata

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ editors:
66
run_tvos: false
77
- version: 6000.1
88
run_tvos: false
9+
- version: 6000.2
10+
run_tvos: false
911
- version: trunk
1012
run_tvos: false
1113

.yamato/format.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,4 @@ check_formatting:
1212
- perl unity-meta/Tools/Format/format.pl Assets Packages --dry-run
1313
triggers:
1414
cancel_old_ci: true
15-
pull_requests:
16-
- targets:
17-
only:
18-
- "develop"
15+
expression: pull_request.(target eq "develop" AND NOT changes.all match "**/*.md")

.yamato/test-samples.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ test_sample_projects_{{ editor.version }}:
1414
- Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=DryRun sh ExternalSampleProjects/publish.sh
1515
triggers:
1616
cancel_old_ci: true
17-
pull_requests:
18-
- targets:
19-
only:
20-
- "develop"
17+
expression: pull_request.(target eq "develop" AND NOT changes.all match "**/*.md")
2118
artifacts:
2219
UTR_Output.zip:
2320
paths:

.yamato/upm-ci.yml

Lines changed: 38 additions & 40 deletions
Large diffs are not rendered by default.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS && UNITY_6000_0_OR_NEWER
2+
3+
using System;
4+
using NUnit.Framework;
5+
using System.Collections;
6+
using System.Linq;
7+
using UnityEditor;
8+
using UnityEngine;
9+
using UnityEngine.InputSystem;
10+
using UnityEngine.InputSystem.Editor;
11+
using UnityEngine.TestTools;
12+
using UnityEngine.UIElements;
13+
14+
internal enum SomeEnum
15+
{
16+
OptionA = 10,
17+
OptionB = 20
18+
}
19+
20+
#if UNITY_EDITOR
21+
[InitializeOnLoad]
22+
#endif
23+
internal class CustomProcessor : InputProcessor<float>
24+
{
25+
public SomeEnum SomeEnum;
26+
27+
#if UNITY_EDITOR
28+
static CustomProcessor()
29+
{
30+
Initialize();
31+
}
32+
33+
#endif
34+
35+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
36+
private static void Initialize()
37+
{
38+
InputSystem.RegisterProcessor<CustomProcessor>();
39+
}
40+
41+
public override float Process(float value, InputControl control)
42+
{
43+
return value;
44+
}
45+
}
46+
47+
internal class CustomProcessorEnumTest : UIToolkitBaseTestWindow<InputActionsEditorWindow>
48+
{
49+
InputActionAsset m_Asset;
50+
51+
public override void OneTimeSetUp()
52+
{
53+
base.OneTimeSetUp();
54+
m_Asset = AssetDatabaseUtils.CreateAsset<InputActionAsset>();
55+
56+
var actionMap = m_Asset.AddActionMap("Action Map");
57+
58+
actionMap.AddAction("Action", InputActionType.Value, processors: "Custom(SomeEnum=10)");
59+
}
60+
61+
public override void OneTimeTearDown()
62+
{
63+
AssetDatabaseUtils.Restore();
64+
base.OneTimeTearDown();
65+
}
66+
67+
public override IEnumerator UnitySetup()
68+
{
69+
m_Window = InputActionsEditorWindow.OpenEditor(m_Asset);
70+
yield return null;
71+
}
72+
73+
[UnityTest]
74+
public IEnumerator ProcessorEnum_ShouldSerializeByValue_WhenSerializedToAsset()
75+
{
76+
// Serialize current asset to JSON, and check that initial JSON contains default enum value for OptionA
77+
var json = m_Window.currentAssetInEditor.ToJson();
78+
79+
Assert.That(json.Contains("Custom(SomeEnum=10)"), Is.True,
80+
"Serialized JSON does not contain the expected custom processor string for OptionA.");
81+
82+
// Query the dropdown with exactly two enum choices and check that the drop down is present in the UI
83+
var dropdownList = m_Window.rootVisualElement.Query<DropdownField>().Where(d => d.choices.Count == 2).ToList();
84+
Assume.That(dropdownList.Count > 0, Is.True, "Enum parameter dropdown not found in the UI.");
85+
86+
// Determine the new value to be set in the dropdown, focus the dropdown before dispatching the change
87+
var dropdown = dropdownList.First();
88+
var newValue = dropdown.choices[1];
89+
dropdown.Focus();
90+
dropdown.value = newValue;
91+
92+
// Create and send a change event from OptionA to OptionB
93+
var changeEvent = ChangeEvent<Enum>.GetPooled(SomeEnum.OptionA, SomeEnum.OptionB);
94+
changeEvent.target = dropdown;
95+
dropdown.SendEvent(changeEvent);
96+
97+
// Find the save button in the window, focus and click the save button to persist the changes
98+
var saveButton = m_Window.rootVisualElement.Q<Button>("save-asset-toolbar-button");
99+
Assume.That(saveButton, Is.Not.Null, "Save Asset button not found in the UI.");
100+
saveButton.Focus();
101+
SimulateClickOn(saveButton);
102+
103+
Assert.That(dropdown.value, Is.EqualTo(newValue));
104+
105+
// Verify that the updated JSON contains the new enum value for OpitonB
106+
var updatedJson = m_Window.currentAssetInEditor.ToJson();
107+
Assert.That(updatedJson.Contains("Custom(SomeEnum=20)"), Is.True, "Serialized JSON does not contain the updated custom processor string for OptionB.");
108+
109+
yield return null;
110+
}
111+
}
112+
#endif

Assets/Tests/InputSystem.Editor/CustomProcessorEnumTest.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ IEnumerator WaitForActionRename(int index, bool isActive, double timeoutSecs = 5
7474
#endregion
7575

7676
[Test]
77-
[Ignore("Instability, see ISXB-1284")]
7877
public void CanListActionMaps()
7978
{
8079
var actionMapsContainer = m_Window.rootVisualElement.Q("action-maps-container");
@@ -88,7 +87,6 @@ public void CanListActionMaps()
8887
}
8988

9089
[UnityTest]
91-
[Ignore("Instability, see ISXB-1284")]
9290
public IEnumerator CanCreateActionMap()
9391
{
9492
var button = m_Window.rootVisualElement.Q<Button>("add-new-action-map-button");
@@ -117,7 +115,6 @@ public IEnumerator CanCreateActionMap()
117115
}
118116

119117
[UnityTest]
120-
[Ignore("Instability, see ISXB-1284")]
121118
public IEnumerator CanRenameActionMap()
122119
{
123120
var actionMapsContainer = m_Window.rootVisualElement.Q("action-maps-container");
@@ -166,7 +163,6 @@ public IEnumerator CanRenameActionMap()
166163
}
167164

168165
[UnityTest]
169-
[Ignore("Instability, see ISXB-1284")]
170166
public IEnumerator CanDeleteActionMap()
171167
{
172168
var actionMapsContainer = m_Window.rootVisualElement.Q("action-maps-container");
@@ -195,7 +191,6 @@ public IEnumerator CanDeleteActionMap()
195191
}
196192

197193
[UnityTest]
198-
[Ignore("Instability, see ISXB-1284")]
199194
public IEnumerator CanRenameAction()
200195
{
201196
var actionContainer = m_Window.rootVisualElement.Q("actions-container");
@@ -215,6 +210,8 @@ public IEnumerator CanRenameAction()
215210

216211
// Click twice to start the rename
217212
SimulateClickOn(actionItem[1]);
213+
yield return WaitForNotDirty();
214+
218215
// If the item is already focused, don't click again
219216
if (!actionItem[1].IsFocused)
220217
{

Assets/Tests/InputSystem.Editor/ProjectWideInputActionsEditorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public void Report(string message)
236236
}
237237
}
238238

239-
[Test(Description = "Verifies that the default asset do not generate any verification errors (Regardless of existing requirements)")]
239+
[Test(Description = "Verifies that the default asset does not generate any verification errors (Regardless of existing requirements)")]
240240
[Category(kTestCategory)]
241241
public void ProjectWideActions_ShouldSupportAssetVerification_AndHaveNoVerificationErrorsForDefaultAsset()
242242
{

0 commit comments

Comments
 (0)