Skip to content

Commit 6bfc950

Browse files
committed
Merge branch 'isxb-1482/fix-custom-processor-serializesbyIndex' of https://github.com/Unity-Technologies/InputSystem into isxb-1482/fix-custom-processor-serializesbyIndex
2 parents df47f12 + f724dc1 commit 6bfc950

8 files changed

Lines changed: 172 additions & 33 deletions

File tree

.github/codecov.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: true
13+
default_rules:
14+
flag_coverage_not_uploaded_behavior: exclude
15+
project:
16+
default:
17+
target: auto
18+
threshold: 1%
19+
base: auto
20+
if_ci_failed: success
21+
informational: true
22+
only_pulls: true
23+
24+
comment:
25+
layout: "diff,flags,files"
26+
behavior: default
27+
require_changes: false
28+
require_base: true
29+
require_head: true
30+
after_n_builds: 1
31+
32+
flag_management:
33+
default_rules:
34+
carryforward: true

.yamato/upm-ci.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
2727
# Run upm-ci verification tests as well as tests contained in the package.
2828
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u %EDITOR_VERSION%
29-
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages"
30-
--extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
29+
{% if platform.name == "win" and category.name == "functional" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package --coverage-upload-options=\"reportsDir:upm-ci~/test-results/CodeCoverage/Package;name:{{platform.name}}_{{editor.version}}_pkg;flags:{{platform.name}}_{{editor.version}}_pkg\"" {% endif %}
3130
{% if platform.installscript %}
3231
- {{ unity_downloader_install }}
3332
- {{ platform.installscript }} %EDITOR_VERSION%
@@ -37,11 +36,9 @@
3736
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
3837
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
3938
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
40-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
41-
# Merge all the code coverage results into one report.
39+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "win" %} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if platform.name == "win" and category.name == "functional" %}--enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project --coverage-upload-options="reportsDir:upm-ci~/test-results/CodeCoverage/Project;name:{{platform.name}}_{{editor.version}}_project;flags:{{platform.name}}_{{editor.version}}_project" {% endif %}
4240
{% if platform.name == "win" and category.name == "functional" %}
43-
- '{{ yamato_source_dir_win }}/.Editor/Unity.exe -projectPath {{ yamato_source_dir_win }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_win }}/Packages/com.unity.inputsystem/" -quit'
44-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
41+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
4542
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Package"
4643
- rmdir /s/q "{{ yamato_source_dir_win }}/upm-ci~/test-results/CodeCoverage/Project"
4744
{% endif %}
@@ -52,6 +49,11 @@
5249
UTR_Output.zip:
5350
paths:
5451
- "upm-ci~/test-results/**/*"
52+
{% if platform.name == "win" and category.name == "functional" %}
53+
triggers:
54+
expression: push.branch eq "develop"
55+
cancel_old_ci: true
56+
{% endif %}
5557
{% endfor %} # test_category
5658
{% endfor %} # platforms_win
5759

@@ -77,7 +79,7 @@
7779
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
7880
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
7981
# Run upm-ci verification tests as well as tests contained in the package.
80-
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package" {% endif %}
82+
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u $EDITOR_VERSION {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --code-coverage-options "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;pathReplacePatterns:@*,,Library/PackageCache,Packages" --extra-utr-arg="--coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package --coverage-upload-options=\"reportsDir:upm-ci~/test-results/CodeCoverage/Package;name:{{platform.name}}_{{editor.version}}_pkg;flags:{{platform.name}}_{{editor.version}}_pkg\"" {% endif %}
8183
{% if platform.installscript %}
8284
- {{ unity_downloader_install }}
8385
- {{ platform.installscript }} $EDITOR_VERSION
@@ -87,24 +89,24 @@
8789
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
8890
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
8991
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
90-
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project {% endif %}
91-
# Merge all the code coverage results into one report.
92-
{% if platform.name == "mac" and category.name == "functional" %}
93-
- '{{ yamato_source_dir_nix }}/.Editor/Unity.app/Contents/MacOS/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
94-
{% endif %}
95-
{% if platform.name == "linux" and category.name == "functional" %}
96-
- '{{ yamato_source_dir_nix }}/.Editor/Unity -projectPath {{ yamato_source_dir_nix }} -batchmode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/ -coverageOptions "generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem;sourcePaths:{{ yamato_source_dir_nix }}/Packages/com.unity.inputsystem/" -quit'
97-
{% endif %}
98-
# Delete the Package and Project reports, only keep the final merged one to keep Aritfacts.zip smaller
92+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode {% if platform.name == "mac" or platform.name == "linux"%} --suite=editor {% endif %} {% if category.name == "performance" %} --category=Performance {% else %} --category=!Performance {% endif %} --api-profile=NET_4_6 {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} {% if category.name == "performance" %} --report-performance-data --performance-project-id=InputSystem {% endif %} {% if category.name == "functional" and platform.name == "mac" or platform.name == "linux" %} --enable-code-coverage --coverage-options="generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+Unity.InputSystem" --coverage-results-path={{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project --coverage-upload-options="reportsDir:upm-ci~/test-results/CodeCoverage/Project;name:{{platform.name}}_{{editor.version}}_project;flags:{{platform.name}}_{{editor.version}}_project" {% endif %}
93+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
94+
# Delete the Package and Project reports & raw coverage data, to keep Artifacts.zip smaller
9995
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Package
100-
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
96+
- rm -rf {{ yamato_source_dir_nix }}/upm-ci~/test-results/CodeCoverage/Project
97+
{% endif %}
10198
after:
10299
- {{ instabilities_install_nix }}
103100
- {{ platform.instabilities_run }}
104101
artifacts:
105102
UTR_Output.zip:
106103
paths:
107104
- "upm-ci~/test-results/**/*"
105+
{% if category.name == "functional" and platform.name == "mac" or platform.name == "linux"%}
106+
triggers:
107+
expression: push.branch eq "develop"
108+
cancel_old_ci: true
109+
{% endif %}
108110
{% endfor %} # test_category
109111
{% endfor %} # platforms_nix
110112
{% endfor %} # editors

Assets/Tests/InputSystem/CoreTests_Actions_Interactions.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,78 @@ public void Actions_CanPerformTapInteraction()
669669
Assert.That(action.phase, Is.EqualTo(InputActionPhase.Waiting));
670670
}
671671

672+
[Test]
673+
[Category("Actions")]
674+
public void Actions_CanPerformTapInteractionWithAnalogControls()
675+
{
676+
ResetTime();
677+
678+
var gamepad = InputSystem.AddDevice<Gamepad>();
679+
680+
var action = new InputAction(binding: "<Gamepad>/leftTrigger", type: InputActionType.Button,
681+
interactions: "tap(duration=0.2)");
682+
683+
// This is the default value, which makes the release point to be 0.75 * 0.5 = 0.375.
684+
InputSystem.settings.defaultButtonPressPoint = 0.5f;
685+
686+
action.Enable();
687+
688+
currentTime = 0f;
689+
690+
using (var trace = new InputActionTrace())
691+
{
692+
trace.SubscribeTo(action);
693+
694+
currentTime = 0.1f;
695+
Set(gamepad.leftTrigger, 0.3f);
696+
currentTime = 0.2f;
697+
Set(gamepad.leftTrigger, 0.54f);
698+
699+
Assert.That(trace,
700+
Started<TapInteraction>(action, value: 0.54f, time: 0.2f));
701+
trace.Clear();
702+
703+
// Assert that a timeout will ocurr and a canceled event will be triggered.
704+
currentTime = 0.5f;
705+
Set(gamepad.leftTrigger, 0.9f);
706+
Assert.That(trace,
707+
Canceled<TapInteraction>(action));
708+
trace.Clear();
709+
710+
// Maintain a value above the press point for a while to assess that a start event is not triggered.
711+
// This was the case where the tap interaction was previously re-starting.
712+
currentTime = 1.2f;
713+
Set(gamepad.leftTrigger, 0.52f);
714+
715+
Assert.That(trace, Is.Empty);
716+
717+
// Go below the release point so check that no cancel event is triggered, since it didn't start.
718+
// This was the case where the tap interaction was previously re-starting and then would cancel after
719+
// timeout.
720+
currentTime = 1.5f;
721+
Set(gamepad.leftTrigger, 0.2f);
722+
723+
Assert.That(trace, Is.Empty);
724+
725+
// Go above the press point again and check that a start event is triggered.
726+
currentTime = 2.0f;
727+
Set(gamepad.leftTrigger, 0.6f);
728+
729+
Assert.That(trace,
730+
Started<TapInteraction>(action));
731+
trace.Clear();
732+
733+
currentTime = 2.10f;
734+
Set(gamepad.leftTrigger, 0.4f);
735+
736+
// Check that the tap is performed.
737+
currentTime = 2.15f;
738+
Set(gamepad.leftTrigger, 0.2f);
739+
Assert.That(trace,
740+
Performed<TapInteraction>(action));
741+
}
742+
}
743+
672744
[Test]
673745
[Category("Actions")]
674746
public void Actions_CanPerformDoubleTapInteraction()

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ however, it has to be formatted properly to pass verification tests.
2222
- Fixed Inspector Window being refreshed all the time when a PlayerInput component is present with Invoke Unity Events nofication mode chosen [ISXB-1448](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1448)
2323
- Fixed an issue where an action with a name containing a slash "/" could not be found via `InputActionAsset.FindAction(string,bool)`. [ISXB-1306](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1306).
2424
- Fixed Gamepad stick up/down inputs that were not recognized in WebGL. [ISXB-1090](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1090)
25+
- Fixed reenabling the VirtualMouseInput component may sometimes lead to NullReferenceException. [ISXB-1096](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1096)
26+
- Fixed PlayerInput component automatically switching away from the default ActionMap set to 'None'.
27+
- Fixed a console error being shown when targeting visionOS builds in 2022.3.
28+
- Fixed a Tap Interaction issue with analog controls. The Tap interaction would keep re-starting after timeout. [ISXB-627](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-627)
2529
- Fixed an issue that caused input processors with enum properties to incorrectly serialise by index instead of by value [ISXB-1474](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1474)
2630

2731
## [1.14.0] - 2025-03-20

0 commit comments

Comments
 (0)