Search Unity

Question Running tests targetting StandaloneWindows64 from console with -nograhpics no longer works

Discussion in 'Testing & Automation' started by R2-RT, Nov 8, 2021.

  1. R2-RT

    R2-RT

    Joined:
    May 8, 2019
    Posts:
    38
    Hey,
    I've met an issue that I am not sure whenever to report as bug, or not.

    In short, running tests from command line with -nographics flag used to work in Unity 2021.1.5f1.

    In newer Unity versions (2021.2.0f1, 2021.1.28f1) -nographics flag causes no shader to compile and built test player window is simply pink.

    See attached logs in .zip archive:
    - editor-2021.2.0f1.log.txt contains successful tests run (without -nographics flag)
    - editor-nographics-2021.2.0f1.log.txt & Player-nographics-2021.2.0f1.log.txt contain logs for "pink" run.
    - editor-2021.1.5f1-nographics.log.txt contain log for successful run, even with -nographics

    Also, reproduce it with given project.

    Command:
    "C:\Program Files\Unity\Hub\Editor\2021.2.0f1\Editor\Unity.exe" -runTests -batchmode -projectPath "%CD%" -testPlatform StandaloneWindows64 -testResult "%CD%\results.xml" -logFile "%CD%\editor.log" -nographics


    or
    "C:\Program Files\Unity\Hub\Editor\2021.1.5f1\Editor\Unity.exe" -runTests -batchmode -projectPath "%CD%" -testPlatform StandaloneWindows64 -testResult "%CD%\results.xml" -logFile "%CD%\editor-2021.1.5f1-nographics.log.txt" -nographics



    upload_2021-11-8_23-20-10.png

    PS. While writing this, I've downloaded and checked:
    - Unity 2021.1.18f1, -nographics was still working for it.
    - Unity 2021.1.21f1, -nographics still works.
    - Unity 2021.1.22f1, -nographics no longer works.
    - Unity 2021.1.23f1, -nographics no longer works.

    So my guess is that whatever change causes this, it was shipped in Unity 2021.1.22f1.

    PPS. An obvious workaround is to simply skip -nographics flag. But I can find the scenerio, where build machine without GPU will be compiling the test player, which later is run on another machine. Espetially since this scenario is described by Documentation: https://docs.unity3d.com/Packages/c...tml#split-build-and-run-for-player-mode-tests
     

    Attached Files:

    Last edited: Nov 8, 2021
  2. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    I'm also experiencing this.
    Not just for tests, but also when doing builds in a build machine. In the latest Unity versions, if -nographics is set, then IOS builds render pink when deployed.
     
  3. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    I believe this is the same as this issue, which is fixed in 2021.2.2f1.
     
    R2-RT and Inter-Illusion like this.