Unity Test Tools - Headless running (batch mode) does not execute any unit tests

Hi,

I am having an issue with running my Unity unit tests from the command line. When running in headless mode the test run doesn’t pick up any tests to run so it just starts and stops with no results.

Environment:
Mac OSX 10.9.1
Unity version v4.3.4f1
Unity Test Tools v1.2

I believe the issue has to do with the UnitTestView.testEngines list not initialized properly before starting tests when running from the command line. Modifying the UnityTest.Batch.RunUnitTests method to initialize testEngines allows the tests to run with a results xml generated.

The command I am using is the one provided by the documentation:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath <project_path> -batchmode -quit -logFile -executeMethod UnityTest.Batch.RunUnitTests -resultFilePath=<result_xml>

I have attached the test log.

Thank you.

1552404–91107–$test.txt (12.9 KB)

Thanks slao258!

We’re gonna check this as soon as possible!

Tomek

Check the 1.2.1 update

as

Hi Tomek, I’m still having the same issue with the 1.2.1 update. I deleted the UnityTestTools root folder and re-imported from the Asset Store and ran the command again.

UPDATE: Attached log.

1552567–91133–$test1.txt (13 KB)

The log unfortunately doesn’t say much. (We should probably add more debug output there…) It looks like the engines are still not initialized.
If you want to try it out, try adding a debug print before line 79 in UnityTestTools\UnitTesting\Editor\TestRunner\TestRunner.cs. Something like Debug.Log(TestEngines.Count()).

Maybe it’s a mac specific issue. We’ll give it a look tomorrow. Sorry for inconvenience!

I added the debug log and get this output:
0
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
UnityTest.UnitTestView:StartTestRun(String[ ], ITestRunnerCallback, Boolean) (at Assets/UnityTestTools/UnitTesting/Editor/TestRunner/TestRunner.cs:79)
UnityTest.Batch:RunUnitTests() (at Assets/UnityTestTools/UnitTesting/Editor/Batch.cs:22)

By the way, I checked the diff (checked in 1.2 into git on my machine, look at changes in files after replacing with 1.2.1) between Unity Test Tools on my machine between 1.2 and 1.2.1 and there were no differences. Thinking I had imported incorrectly, I tried it again with a new blank Unity project, and there still was no code difference in Unity Test Tools between the project with 1.2.1 and the project with 1.2.

Could be that it didn’t get updated. Maybe it requires some time for the Asset Store to spread out the changes.

btw. you can see the current version in the changelog file.

Yep, you’re right the changelog shows 1.2 as the latest. Weird that the Asset Store is telling me I’m getting 1.2.1 when I’m actually getting 1.2. I’ll wait for 1.2.1. Thanks!

Let me know if it still doesn’t update itself. Cheers!

I just tried to import it from the Asset Store again, and the latest entry in the change log still only shows 1.2. Looks like it still hasn’t been updated.

Hey slao258,
Is it working for you now? I talked with the Asset Store guy and they looked into it. Should be ok now.

I just tried again and got the updated version. Everything works for me now. Thanks, and thanks for fixing the result xml location as well. :slight_smile: