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

Unity Tests not running from command line

Discussion in 'Editor & General Support' started by Infenix, Feb 2, 2021.

  1. Infenix

    Infenix

    Joined:
    May 5, 2019
    Posts:
    7
    I am experimenting with the Unity Tests Framework and everything is working fine inside of the GUI editor. I ran the tests as standalone from the GUI and it worked well. But then I tried to run it from the command line, and my tests result return me the following:


    <?xml version="1.0" encoding="utf-8"?>
    <test-run id="2" testcasecount="0" result="Passed" total="0" passed="0" failed="0" inconclusive="0" skipped="0" asserts="0" engine-version="3.5.0.0" clr-version="4.0.30319.42000" start-time="2021-02-02 02:20:19Z" end-time="2021-02-02 02:20:19Z" duration="0,005112">
    <test-suite type="TestSuite" id="1003" name="UnityCI_TestProject" fullname="UnityCI_TestProject" runstate="Runnable" testcasecount="0" result="Passed" start-time="2021-02-02 02:20:19Z" end-time="2021-02-02 02:20:19Z" duration="0.005112" total="0" passed="0" failed="0" inconclusive="0" skipped="0" asserts="0">
    <properties />
    </test-suite>
    </test-run>


    It looks like the -runTests doesn't find any of my tests... I have a folder with Play Mode tests in which an assembly is defined, but adding it to the command line doesn't seem to work. Am i doing it wrong ?

    My command line input is the following:
    "C:\Program Files\Unity\Hub\Editor\2019.4.18f1\Editor\Unity.exe" -batchmode -projectPath . -runTests -testResults .\results.xml -testPlateform StandaloneWindows64 -assemblyNames="PlayModeTests"

    The sample project can be found here:
    https://github.com/ImInfenix/UnityCI_TestProject