Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Resolved [Unity Test Runner] Launch GameMode Test from Command Line

Discussion in 'Testing & Automation' started by Cylosis, May 9, 2017.

  1. Cylosis

    Cylosis

    Joined:
    Jun 1, 2016
    Posts:
    2
    Hello everyone !

    There are two kinds of tests runnable using Unity Test Runner framework :
    My assumptions about theses modes are :
    - GameMode : scene and Monobehaviour testing
    - EditMode : legacy NUnit testing

    I want to use Hudson in order to enjoy Continuous Integration in my custom project. Therefore, I need to run tests from my CI server. The only way I found is to run tests from command line.

    I read that we could run tests from command line using the -runEditorTests argument.
    When I use this command :
    "D:\Apps\Unity\Editor\Unity.exe" -runEditorTests -projectPath %WORKSPACE%\P101 -editorTestsResultFile %WORKSPACE%\P101\TestResults\DataGenerationTestResults.xml -logFile %WORKSPACE%\P101\Logs\test.log -batchmode

    For your information, the %WORKSPACE% environment variable is working as every other step (such as build the app) works on Hudson. Paths to project/logs/results are ok too.

    The issue is that Unity Test Runner runs only EditMode tests. I did not find any answer about GameMode tests using command line. Plus, the documentation about Unity Test Runner (link : https://docs.unity3d.com/Manual/testing-editortestsrunner.html) looks outdated.

    Any idea about how can I run GameMode tests using a command line instruction ?

    Thanks in advance,
    Jordan
     
    Last edited: May 9, 2017
  2. broersma

    broersma

    Joined:
    Apr 30, 2015
    Posts:
    11
unityunity