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

Revise exit codes for dotnet test #47550

Open
Youssef1313 opened this issue Mar 13, 2025 · 5 comments
Open

Revise exit codes for dotnet test #47550

Youssef1313 opened this issue Mar 13, 2025 · 5 comments
Assignees
Milestone

Comments

@Youssef1313
Copy link
Member

Just throwing ideas here 😄

For the new dotnet test experience for MTP, we should revise what final exit code of dotnet test should.

dotnet test will be invoking test executables. Each executable may exit with a different exit code.

See https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-exit-codes

Should we define some order of importance for exit codes, and return the exit code that's "most" important?
I would love if MTP exit codes were powers of two, dotnet test can simply bitwise-OR the values together to be able to more accurately model the exit codes, but that's currently not the case.

Another question that arises is, what if MTP in future adds a new exit code that SDK doesn't know about (yet)? What should we do?

Or, should we simply keep using exit code 1, as it's today, to denote "generic failure"?

Another idea is to check, if all executables are exiting with the same exit code, dotnet test should use that. Otherwise, dotnet test can exit with 1 denoting generic failure.

Related to #45927

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-dotnet test untriaged Request triage from a team member labels Mar 13, 2025
@Youssef1313 Youssef1313 removed the untriaged Request triage from a team member label Mar 13, 2025
@Youssef1313 Youssef1313 added this to the 10.0.1xx milestone Mar 13, 2025
@Youssef1313 Youssef1313 changed the title Revise exist codes for dotnet test Revise exit codes for dotnet test Mar 13, 2025
@Evangelink
Copy link
Member

Another idea is to check, if all executables are exiting with the same exit code, dotnet test should use that. Otherwise, dotnet test can exit with 1 denoting generic failure.

This seems to me like the more logical choice and also the easiest to understand as final user.

@mariam-abdulla
Copy link
Member

Now, if at least 1 executable returned non-zero exit code, the exit code will be a generic failure.

Another idea is to check, if all executables are exiting with the same exit code, dotnet test should use that. Otherwise, dotnet test can exit with 1 denoting generic failure.

I also agree with @Evangelink, this seems like the most logical.

@Youssef1313
Copy link
Member Author

I agree as well!

@Youssef1313
Copy link
Member Author

Another question here is if we should explicitly print out the exit code in case of failure, with a link to https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-exit-codes (probably via aka.ms link)

@Evangelink
Copy link
Member

I like the idea of the aka.ms link to exit code doc page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants