RetrieveTestList & Test Callbacks do not work in methods executed from command line

The setup:

  • calling BatchModeMethod from the command line (-executeMethod)

BatchModeMethod looks something like this:

public static async void BatchModeMethod()
        {
            Debug.Log("Inside BatchmodeMethod");
            var api = ScriptableObject.CreateInstance<TestRunnerApi>();
            api.RetrieveTestList(TestMode.EditMode, adaptor =>
            {
                Debug.Log("inside retrieveTestList callback");
            });

            var startTime = DateTime.Now;
            while ((DateTime.Now - startTime).TotalSeconds < 10)
            {
                await Task.Yield();
            }
            Debug.Log("Waited for: " + (DateTime.Now - startTime).TotalSeconds + "sec");
        }

The result

  • the first and last logs are logged correctly, indicating that the method is called correctly and waits for 10sec before finishing
  • BUT “inside retrieveTestList callback” is never logged, so the callback is never called.
  • the same happend when you try to get callbacks from tests run this way
  • BatchModeMethod works without problems if you run it in a manually started editor instance

So my question: how can I make the callbacks work in methods and editors called from commandline?

I see the same behavior. @fipsy was this ever resolved for you?
Although my tests are PlayMode, I get no callback from command line as well.