Trouble getting RunStarted callback in editor using attribute TestRunCallback

Good day,

I am attempting to set up a class to receive callbacks using ITestRunCallback during test started in the editor. I registered my class with TestRunCallback, however I do not seem to be receiving the RunStarted callback. The other 3 callbacks from the interface all work (somewhat) correctly: TestStarted, TestFinished, and even RunFinished. I created an class based on the example provided by Unity, but I seem to be missing a call to RunStarted and I believe a call to the project’s test group TestStarted.

using UnityEngine;
using NUnit.Framework.Interfaces;
using UnityEngine.TestRunner;

[assembly: TestRunCallback(typeof(TestCallbackExample))]
public class TestCallbackExample : ITestRunCallback
{
    public void RunStarted(ITest testsToRun)
    {
        Debug.Log($"RUN STARTED - Test Count: { testsToRun.Tests.Count }");
    }

    public void RunFinished(ITestResult testResults)
    {
        Debug.Log($"RUN FINISHED - Pass Count: { testResults.PassCount }");
    }

    public void TestStarted(ITest test)
    {
        Debug.Log($"TEST STARTED - { test.Name }");
    }

    public void TestFinished(ITestResult result)
    {
        Debug.Log($"TEST FINISHED - { result.Name }");
    }
}

Code compiles and runs without errors, but from the output, it would seem that my class is being registered for the callbacks after the tests have already started. I would expect to have seen “RUN STARTED - Test Count: 1” followed by “TEST STARTED - TestProject” prior to the first output in the log below.

TEST STARTED - Tests.dll
TEST STARTED - MyTests
TEST STARTED - test1
TEST FINISHED - test1
TEST FINISHED - MyTests
TEST FINISHED - Tests.dll
TEST FINISHED - TestProject
RUN FINISHED - Pass Count: 1```

Some additional troubleshooting details:
I have tried moving the file both in and out of an editor folder and also tried placing it in the same assembly as my tests. I have a breakpoint set at the missing callback and I can confirm that it does not hit. I am currently using Unity 2022.3.10f1. I have tried searching for other help topics on the subject, but so far it does not seem like anyone else is having this issue.

Some information on alternatives:
I am able to create a class using the ICallbacks interface and manually register it with TestRunnerApi to receive the RunStarted(ITestAdapter) callback. However, I would like to use the ITestRunCallback if possible for its compatibility in standalone player. It would appear that this should be possible, but if not, I would appreciate the lesson on what I missed that would have told me such. Much appreciated.

I’m also seeing this in TestFramework 1.4.4

Why isn’t RunStarted called?

Bug Submitted: IN-76277