-
Notifications
You must be signed in to change notification settings - Fork 68
Exit code doesn't change based on success or failure #535
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
Comments
I don't think that a failing test is a reason for a non-zero exit code. The exit code should be different in two situations:
We could probably introduce the third exit code to distinguish the situations "Global error in Preflight / Local errors while running a particular test":
|
From a programmatic/pipeline standpoint, having any sort of non-zero exit code would be beneficial. If I'm reading it correctly, exit 2 would be if a particular test or tests failed? |
As a point, not sure if this was expected, but if it fails the supported red hat image check it fails with a non-zero exit code, so this is potentially inconsistent? |
@ericgarff Which check specifically are you talking about? And do you have a publicly available container that does not pass that check to test with that you saw a different exit code? |
vs.
|
The first error is an internal application error and fails before any checks are even run. The 2nd all the checks are run and there were no internal application errors. This has been cleaned up in |
Closing this as a stale issue. If this issue needs additional work, please feel free to re-open. |
@komish I've just come across a need for this as well, can we re-open the issue? If I use the preflight in CI, it would be useful to have a non-zero exit code on any failure. It is common for other testing tools to indicate test failure with a non-zero exit code. Now, I have to instead parse the json, which is additional overhead and more error prone than a simple non-zero exit code. |
Bug Description
When running preflight, regardless of the result the exit code is 0 (shown via
echo $?
).Version and Command Invocation
preflight version 1.1.0-beta6 <commit: 2ebe874>
Steps to Reproduce:
(How can we reproduce this?)
Expected Result
In the case of a failure, a non-zero exit code
Actual Result
Always gets an zero exit code
The text was updated successfully, but these errors were encountered: