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

Correct way to retrieve stderr from command validation #520

Closed
AustinSchoen opened this issue Dec 13, 2019 · 1 comment
Closed

Correct way to retrieve stderr from command validation #520

AustinSchoen opened this issue Dec 13, 2019 · 1 comment
Labels

Comments

@AustinSchoen
Copy link

Hi, I am trying to use a command validation to run a database migration as part of controlling container start/stop in a docker compose environment. The process is working well so far but I notice that all I get in the output is the result of the tests:

artisan_1    | Failures/Skipped:
artisan_1    |
artisan_1    | Command: db-migrate: exit-status:
artisan_1    | Expected
artisan_1    |     <int>: 1
artisan_1    | to equal
artisan_1    |     <int>: 0
artisan_1    |
artisan_1    | Total Duration: 0.119s
artisan_1    | Count: 1, Failed: 1, Skipped: 0
artisan_1    | Retrying in 2s (elapsed/timeout time: 4.418s/30s)

I'd like to know how to get the stderr from the command to show up after the tests run. I noticed there was stdout & stderr optional parameters in the guide, but I don't quite understand how to use those.

Thanks! This is a great tool!

@aelsabbahy
Copy link
Member

Stdout/stderr checks are there to validate that the stdout and/or error contain a string or a pattern.

The command validator is intended to be used to test a systems state, not change it. The output is not retained.

A workaround when debugging is to use tee to store the output to a file.

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

No branches or pull requests

2 participants