Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Test Runner Exit code 2 #167

Open
bdovaz opened this issue Jan 14, 2021 · 2 comments
Open

Handle Test Runner Exit code 2 #167

bdovaz opened this issue Jan 14, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@bdovaz
Copy link
Contributor

bdovaz commented Jan 14, 2021

If you look at this page, they clearly put that if the exit code is 2 it means that the Unity process has been executed correctly but that some tests have failed.

I am requesting this change because otherwise it would not be possible to subsequently execute a task that publishes the test results including the failures to analyze the cause.

Sources:

I put a link from an old version of Unity because in the new one it does not appear:

https://docs.unity3d.com/530/Documentation/Manual/testing-editortestsrunner.html

I put a link to a third party repository because the source code of the test framework package is not public, you can see the code there:

https://github.com/needle-mirror/com.unity.test-framework/blob/master/UnityEditor.TestRunner/CommandLineTest/ExitCallbacks.cs#L24

https://github.com/needle-mirror/com.unity.test-framework/blob/master/UnityEditor.TestRunner/CommandLineTest/Executer.cs#L60

Looking at the code I see that this exit code is not managed and the task is directly marked as failed so it does not allow you to execute tasks later in the pipeline.

https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks/blob/main/Tasks/UnityTest/UnityTestV1/unity-test.ts#L117

@FejZa FejZa added the enhancement New feature or request label Jan 16, 2021
@FejZa
Copy link
Member

FejZa commented Jan 16, 2021

Thank you @bdovaz for the detailed explaination. This change makes a lot of sense.

@bdovaz
Copy link
Contributor Author

bdovaz commented Apr 20, 2021

@FejZa I'm glad you have implemented this functionality but I would make two small changes:

  • It should be configurable whether the task fails or not with exit code == 2.
  • In case the task is configured to not fail, it should set a variable with the result of the exit code so that it can be read later in the pipeline and react in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants