-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
opa test exit value is the same for skipped as it is for failures #3773
Comments
Thanks for filing this Kirk. I believe the test subcommand exits with status code 2 because of this line. Changing the exit code to another value if there are no failures and at least one skip sounds reasonable to me. This would encourage people to make all of their tests pass but allow them to handle the exceptional case where some tests have to be skipped. How does that sound? |
Perfect 👍 |
I submitted a small PR #3774 |
…t#3774) When `-z` is passed to `opa test`, skipped tests will not affect the exit code. (When not passed, skipped tests produce the same exit code as failed tests.) Fixes open-policy-agent#3773. Signed-off-by: Kirk Patton <kpatton@verizonmedia.com> Signed-off-by: Dolev Farhi <farhi.dolev@gmail.com>
I created a unit test prefixed with "todo_" and then ran it with OPA test. As expected, the test was skipped. I checked the exit code and noted it was "2". When I remove the "todo_" and run the test, I get an expected failure. But, the exit value is also "2".
Expected Behavior
I expected some other exit value other that "2".
Actual Behavior
I expected some other value so that it would be possible to allow skipped tests in our CICD pipeline by checking the exit value.
Steps to Reproduce the Problem
Additional Info
The text was updated successfully, but these errors were encountered: