Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Include "Editor" platform does NOT show in test runner!

Discussion in 'Testing & Automation' started by MrLucid72, Sep 8, 2022.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    I am getting some compile errors for my unit tests (which shouldn't build anyway...? +bug here)

    I INCLUDE only the editor:
    upload_2022-9-8_17-55-10.png

    My tests in my Test Runner PlayMode are now gone in 2021 LTS.

    upload_2022-9-8_17-56-3.png

    I *must* include my current BUILD platform for test runner to show these.

    Expected: Including only editor should... show test runner tests in editor :)
     
  2. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    Found a hilarious bug workaround:

    upload_2022-9-8_17-59-29.png

    If I EXCLUDE everything EXCEPT Editor ... works fine.
     
  3. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    TL;DR:
    upload_2022-9-8_18-6-15.png
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,533
    If you only check Editor, then the Play Mode tests won't appear because you made them editor-only. It seems you got this backwards, or there is something I'm missing.
     
  5. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    When I build targeting that platform, I get errs. It shoudlnt try to build the tests at all.
     
  6. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,533
    Could you post the exact error messages you get?
    And the contents of the test assembly definition (.asmdef file). This kind of error happens when the asmdef does not include the constraint as explained here.