Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Test Runner Api - EndTime and StartTime unset with in a standalone test

Discussion in 'Testing & Automation' started by purplezergling2, Aug 4, 2022.

  1. purplezergling2

    purplezergling2

    Joined:
    May 24, 2022
    Posts:
    1
    Hello,

    I'm having an issue with the Test Runner Api from Unity Test Framework. When the tests are launched as a standalone application, for instance on platform StandaloneWindows64, the EndTime and StartTime return by the ITestResultAdaptor argument are set to 0001-01-01 00:00:00 in function RunFinished and TestFinished. However when the tests are launched from the editor, these variables are set with a valid time.

    To give some perspective, i'm using the test runner api to generate a test report with a customized format. I registred my ICallbacks interface with this code:

    Code (CSharp):
    1. [InitializeOnLoad]
    2. class RegisterTestReporter
    3. {
    4.  
    5.     static RegisterTestReporter()
    6.     {
    7.         EditorApplication.update += Update;
    8.     }
    9.  
    10.     static void Update()
    11.     {
    12.         var api = ScriptableObject.CreateInstance<TestRunnerApi>();
    13.         CustomReporterRunner reporter = new CustomReporterRunner();
    14.         api.RegisterCallbacks(reporter);
    15.     }
    16. }
    Does anyone have insight on what's happening? For info I tried UTF 1.31 and 1.33 and Unity 2021.3.1f1 with the same result.
    Thank you
     
    Last edited: Aug 9, 2022