microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6.02k stars 2.12k forks source link

UnityUI far interaction in Play Mode Tests, batch mode does not work #5887

Closed julenka closed 3 years ago

julenka commented 5 years ago

Overview

We should be able to use hand rays to interact with UnityUI in our playmode tests, however using far interaction with UnityUI doesn't actually in playmode tests when running in batch mode. Things run fine in the Unity Editor

Repro steps

  1. In PressableButtonTests.TriggerButtonFarInteraction(), remove the block which does Asset.Ignore() and yield break;
  2. Run the test in batch mode a. Run this command .\run_playmode_tests.ps1 H:\mrtk.dev -unityExePath = "C:\Program Files\Unity\Hub\Editor\2018.4.1f1\Editor\Unity.exe" b. Tip, you can edit run_playmode_tests.ps1 to run only this test by adding this to the Unity command line args around line 37 "-editorTestsFilter TriggerButtonFarInteraction",

Expected

Both variants of the test (collider based prefab and unity ui based prefab) should pass in Editor and in batch/headless mode.

Actual

The unity ui variant of TriggerButtonFarInteraction works in Editor but fails in batch/headless mode.

Expected Behavior

Tests pass

Actual Behavior

Test fails

AdamMitchell-ms commented 5 years ago

Repro steps

  1. In PressableButtonTests.TriggerButtonFarInteraction(), remove the block which does Asset.Ignore() and yield break;
  2. Run the test in batch mode a. Run this command .\run_playmode_tests.ps1 H:\mrtk.dev -unityExePath = "C:\Program Files\Unity\Hub\Editor\2018.4.1f1\Editor\Unity.exe" b. Tip, you can edit run_playmode_tests.ps1 to run only this test by adding this to the Unity command line args around line 37 "-editorTestsFilter TriggerButtonFarInteraction",

Expected

Both variants of the test (collider based prefab and unity ui based prefab) should pass in Editor and in batch/headless mode.

Actual

The unity ui variant of TriggerButtonFarInteraction works in Editor but fails in batch/headless mode.

stale[bot] commented 4 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

stale[bot] commented 4 years ago

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.

julenka commented 4 years ago

RE-opening as I believe this bug still exists (nobody has made fixes to hand rays with UnityUI)

stale[bot] commented 4 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

keveleigh commented 4 years ago

@MaxWang-MS found this was fixed, and re-enabled in #8790

MaxWang-MS commented 4 years ago

Note: The tests can now pass because the Interactable script has been added to the pressable button UnityUI prefab. The issue of UGUI Button script not correctly responding to press in batch mode tests is still present.

keveleigh commented 3 years ago

@MaxWang-MS Do you think this is fixed by https://github.com/microsoft/MixedRealityToolkit-Unity/pull/8837? It wouldn't surprise me if the input module was previously failing to initialize on batch mode.

MaxWang-MS commented 3 years ago

@keveleigh I am not completely certain if that is the case, but given we currently have no tests that are potentially impacted by this could-have-been-fixed bug I'll just close the issue for now.