Dinomite-Studios / unity-azure-pipelines-tasks

Azure DevOps extension adding tools to build and deploy Unity 3D projects using Azure Pipelines
https://unitydevops.com/
MIT License
121 stars 49 forks source link

UnityTestTask 1.4.2 stalls indefinitely #174

Closed fnuecke closed 3 years ago

fnuecke commented 3 years ago

UnityTestTask@1.4.2 stalls our pipeline indefinitely. The Unity log reaches the end, but the task never appears to detect that Unity quit. With diagnostics logging enabled, it is logged that Unity quits with exit code 0. Looking at the taks manager on the build machine, node appears to still be running unitl the job is canceled. Pinning the test tasks to 1.4.0 works and allows the pipeline to finish.

This happens for both Unity 2019.3.6f1 and Unity 2020.3.3f1.

I'm afraid I cannot say why exactly this is. It seems suspicious that the return code check changed, but looking at the diff it looks like it should not make a difference to me. Then again, I'm not very versed in TypeScript, so there may be a subtle difference in semantics I'm not seeing.

I have not tested whether this behaves differently (as in, does not stall) in case any tests fail. If this would be helpful information, let me know and I'll look into it.

ikriz commented 3 years ago

136 think this is related :) @fnuecke how did you pin the version? can you post your yml?

fnuecke commented 3 years ago

Oh, that definitely sounds related! Sorry, I missed that issue.

Here's the relevant task from our pipeline .yml:

  - task: UnityTestTask@1.4.0
    displayName: 'Editor Tests Development'
    inputs:
      unityEditorsPathMode: 'specify'
      customUnityEditorsPath: 'C:\Program Files\Unity\'
      unityProjectPath: 'Development'
      testResultsPath: 'TestResults'
      testCategory: 'CPU'

The @1.4.0 being what we use to work around the issue for now. Previously was just @1, so latest, so 1.4.2.

Edit: also, for completeness, the worker is a Windows box.

FejZa commented 3 years ago

Thank you everyone, this has been fixed in the just released 2.8.5 version of the extension.

FejZa commented 3 years ago

Please note there is a new input variable for the Test Task:

failOnTestFail: It defaults to true and will make the pipeline fail if any of the tests fail. Set it to false to have the pipeline continue with subsequent tasks even if tests failed.

You can then use the new output variable testsFailed to know in subsequent tasks whether any tests have failed and decide what to do e.g.

FejZa commented 3 years ago

I will close this issue, feel free to reopen in case you run into issues.