Hey there
I have some tests that require logs to be picked up and I do that with LogAssert. These tests work fine on Windows but when I upload it for GitHub actions to handle, or just plainly run it on Ubuntu, these tests fail.
I test if a particular log is called when leaving play mode, so the setup is a bit convoluted so I’ll just provide some example code.
// Editor test
[UnityTest]
public IEnumerator Test()
{
MySO instance = ScriptableObject.CreateInstance<MySO>();
instance.hideFlags = HideFlags.DontSave;
Assert.IsFalse(Application.isPlaying, "Already in play mode when entering play mode.");
yield return new EnterPlayMode(false);
Assert.IsTrue(Application.isPlaying, "Didn't enter play mode.");
LogAssert.Expect(LogType.Warning, "Warning log");
yield return new ExitPlayMode();
yield return null;
}
It fails on the LogAssert as the log is never logged. However, here’s the “funny” thing. The log is indeed being logged and shows up in the console (and output logs in CI) but the test never picks it up. I’ve even tried adding several frame delays before each action with no luck, so there’s no timing issue.
As I mentioned before, this works fine on Windows and only happens on (from my testing) Ubuntu.
I’m using the latest stable release on the test tools, 1.1.33. I also tested with the new experimental 2.0 with no luck.