-
Notifications
You must be signed in to change notification settings - Fork 470
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
stderr exec check results show in goss validate #976
Comments
There's an stderr check in goss.
|
Ahh, I did not read enough. Thanks and I will close the issue! |
FYI, this Pattern link is broken in Manually editing Goss files. Also, I was not able to determine how to properly write
it will always succeed since
So how can I write a check that will show the |
|
Thanks for your help and timely replies, it sure is appreciated. I will try my best to get Goss integrated into our stack! |
Describe the feature:
have-patterns replace the *"object: bytes.Reader" in the
goss validate
result with something human-readable. This is great, but this only works forstdout
not withstderr
. A simple test explaining what I mean:This check fails as expected because
foo
does not equal thestdout
result and runninggoss v -f json| jq '.results[] ."matcher-result"'
results in:
Let's try this with a check that errors.
This check fails as expected because
foo
does not equal thestdout
result (onlystderr
) and runninggoss v -f json| jq '.results[] ."matcher-result"'
results in:
This is not great because
"actual": ""
is empty. A workaround can be achieved with switching the check to:exec: cat this_file_does_not_exist.txt
->exec: "cat this_file_does_not_exist.txt" 2>&1
Describe the solution you'd like
Ideally, the
goss.yaml
author should not have to consider redirectingstderr
tostdout
per check. Maybe add a CLI command option likegoss v --include-stderr
.Describe alternatives you've considered
If change in functionality to the binary is not possible (for whatever reason), I would like to see the docs updated explaining what to do in case a check outputs to
stderr
because I think this is quite a common scenario for Goss users.The text was updated successfully, but these errors were encountered: