-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Improve 'bin/run-all-petstore' #133
Conversation
This should fail, because |
bin/run-all-petstore
Outdated
@@ -3,6 +3,8 @@ | |||
# execute the script and check the result (exit code) to see if | |||
# there's any error | |||
|
|||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already what the -e
on the first line of this file does.
@jmini I've added a fix to the latest commit of #57 (ec3cd97) to exit with status code 1 when the CLI is run without args. When run with invalid args, it already throws a parser exception. Adding an exit code internally to the command would cause issues if someone wanted to pipe the output of this default command to I think Here's an example:
This script will run all generators. If one or more failed, you'd receive an exit code of 1 and an error like
If it succeeded it would output a friendly message like
I did some testing with the current Because this PR is targeting a fix for #132. I was wondering if you'd mind evaluating the script I have above to see what you think about usability and CI visibility to successes/failures? We may have differing concerns about running this script (e.g. fail fast if it's a "build script", aggregate concerns if it's an "integration test"). |
In this build we have the notification that a build that is failing (this is what we want, be notified by the CI when something is broken) Log in Shippable job 323:
|
You seems to be much better bash developer than I am... Sorry I missed your second response in my first one. Are you sure that this is working:
Or do we need to add something in each script to propagate back the error status sent by the |
Yes the |
@jmini that's weird. I tested with Per bash documentation (https://www.gnu.org/software/bash/manual/bashref.html#Invoking-Bash):
manpage on OS X reads:
However, when I test with minimal implementations outside of
I personally create bash scripts with a structure of:
But, I wonder why the shebang and bash arguments don't work as document by bash? I'm sure whoever originally wrote this script believed the |
Thank you a lot of this investigations. I now have pushed your version (where we do not want to use Let see how it works. Then I will push a test commit, where I break again the |
@jmini I don't know if you're interested, but I've found reasoning why the
This would explain why this is different via CI, and could explain why you and I have different experiences. I also found on TLDP that |
Test for commit d578369
I see this in the log:
|
I now have pushed a wrong commit b5c30f9, with this commit Shippable CI shoud fail with an error message. PLEASE DO NOT MERGE THIS PR NOW |
It works as expected for b5c30f9:
I see in the log:
|
This reverts commit b5c30f9.
After f90f9ab :
This looks good to me. I think we can implement it like this. Thank you a lot @jimschubert |
I'm on mobile atm, and can't merge due to CircleCI failure. Looks like this can be merged now, it someone else wants to merge it. If not, I'll get it done by this evening. |
ci/circleci — Your tests failed on CircleCI, Logs:
|
Fix for #132.