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

Commandline Standalone tests not working.

Discussion in 'Testing & Automation' started by Q-Ted, Oct 8, 2020.

  1. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    I have been trying to automate some standalone tests, to incorporate it within our flow.
    However when I run the following command:
    "C:\Program Files\Unity\Hub\Editor\2020.1.7f1\Editor\Unity.exe" -runTests -projectPath ./ -testPlatform StandaloneWindows64 -testResults x64_results.xml -batchmode​
    It eventually opens the test build, displays "All test(s) succeeded", stays open and needs to be manually close. The test result are not getting saved as far as I can see and the Editor's process also stays alive and needs to be ended through the task manager.

    Am I doing something wrong or is there a bug somewhere?
    There are no errors in either the editor or player logs.
    I can successfully run it with the targetPlatform set to EditMode or PlayMode.
     
  2. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    After one of the failed runs I tried to just open the project normally. Which immediately ran a standalone test I did not ask for, closed the test build automatically and closed the editor afterwards, placing a results.xml file in the root of the project. After that, running the above command does work properly.

    Not sure what is going on, but it seems fixed now.. Really weird.