Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

inspector glitch, anyone?

Discussion in '2018.1 Beta' started by laurentlavigne, Jan 24, 2018.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    I'm getting this but QA can't repro, does anyone else have that?
     
  2. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    I saw this once, but it was 2am and I was just trying some new features out in an empty project. Just deleted the project and went to bed. I recall clicking something in the inspector when it happened. I thought I had somehow accidentally 'expanded' the top part of the inspector.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    found it: when you open the profiler and add gpu, the inspector gets stretched
     
  4. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    Sounds like someone is modifying a style, rather than a copy of the style, in there.
     
    Last edited: Feb 1, 2018
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,106
    Did you tell QA? Could you post the case #?
     
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    yeah i looks like that doesn't it, but it's doing it even on a brand new project so unless styles persist across new launch of the editor that's ruled out
    qa knows, can't repro, case# is 989953
     
  7. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    By someone I mean Unity. Not the first time it’s happened, if that’s the case. :p
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    I've got a repro, the tricky part was that the bottom view in Profiler needed to be in Hierachy view with a Details View on the right hand side (not open by default but state saved to Editor Prefs, which is probably why you missed it in the repro steps and QA missed it when trying to repro). GPU or CPU doesn't matter. Oh yeah, and you also need to be profiling or have some profiled frames loaded, otherwise, Hierachy is showing nothing.

    I'll fix it asap, thanks for reporting :)
     
    Last edited: Feb 2, 2018
    Havokki, laurentlavigne and Peter77 like this.
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    gg
     
  10. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    Fixed it, it might be a while until it goes through all the motions and lands in a beta release down the road, though.
     
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    why a while? battery of tests?
     
  12. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    yes, every change needs to first pass a series of reviews and tests before it gets merged into the main line (trunk) and then again for a backport into an already branched off beta cycle like in this case. We're taking the potential for regressions serious and we also don't want bugs fixed in the beta and suddenly reappear in trunk so that's why it's this slightly staggered process :)
     
    laurentlavigne likes this.
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    how are gui bugs auto tested?
     
  14. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    Well, in this case the change is very contained and will not really get tested, but the changeset still needs to go through our entire test framework to verify that didn't break anything. There are tests that might fail if the fix would contain more involved changes e.g. somewhere deep in IMGui Code. Also, there are UI automation frameworks that would simulate button presses and can read window contents, but they aren't used here.

    So yeah, the testing for this fix is mostly there to uphold the process so I can't just claim: here's a fix, it wont break anything.

    Also, QA will have to verify this fix before the relevant build would be released.
     
    laurentlavigne and Peter77 like this.
  15. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    interesting, can you elaborate how this works?
     
  16. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    We have some internal tooling for that and with that it looks somewhat like this:

    Code (CSharp):
    1. using UnityEngine.TestTools;
    2. using NUnit.Framework;
    3. using UnityEditor;
    4. using System.Linq;
    5. using UnityEngine;
    6.  
    7.     [Test]
    8.     public void CanClickOK()
    9.     {
    10.         InspectorWindow inspector = EditorWindow.GetWindow<InspectorWindow>();
    11.         using (var automatedInspector = new UnityEditor.UIAutomation.AutomatedWindow<InspectorWindow>(inspector))
    12.         {
    13.             var okButton = automatedInspector.FindElementsByGUIContent(new GUIContent("OK")).First();
    14.             Assert.NotNull(okButton);
    15.             automatedInspector.Click(okButton);
    16.         }
    17.     }
    There are some caveats and gotchas when using this like, if the element is not visible, it can't be clicked. Since our build/test farm runs the windows unmaximised and at a low screen resolution, tests like that can be rather unstable if you're not careful about the window setup. I think that's one reason why it is not used too much, the other being that we're exposing a lot of API so the need to go through a window to test functionality isn't that huge and UI tests are pretty high level and therefore slower and more prone to breakage as we rearrange stuff.


    A quick google search revealed this small package for ingame UI testing:
    https://github.com/taphos/unity-uitest
    https://assetstore.unity.com/packages/tools/unity-ui-test-automation-72693
    I glanced over it and it seems to offer some similar functionality.
     
    Last edited: Feb 8, 2018
    Peter77 likes this.
  17. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,987
    I see both UT and this ui tester use the button name or string compare to validate UI so they wouldn't catch a layout bug like this one. Thanks for the info, it's useful.
     
  18. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    You're right and testing layout would be a whole other mess I fear. I just had a discussion if we could ad some tests or safeguards for this specific case but it seems impractical at this point. But I'm glad I could shed some light on the testing process :)
     
    laurentlavigne and Peter77 like this.