-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make examples commands return a failure #8605
Conversation
Currently the following commands in examples.py, do_import() do_deploy() do_versionning() do_clone() all return a success status (ie 0) irrespective of any errors originating from their sub-functions. This PR fixes this. Now these commands will return one of: 0 - success 1 - general failure x - failure returned by a subprocess.call function
@adbridge, thank you for your changes. @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review. |
Fixes #8568 |
@adbridge Did you test this? I tested a bit suprocess.call() function and seems to work in a way that:
It seems that you expect the behaviour as shell=True but it is false as default |
[examples] Running shell script
|
Now fixed CI so that it also catch examples fetching problems right way. |
@OPpuolitaival Are you referring to this? |
tools/test/examples/examples_lib.py
Outdated
os.chdir("../..") | ||
if result: | ||
return result: |
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.
@OPpuolitaival found this, but the correct thing here would be:
return result: | |
return result |
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.
Yup copy paste there me thinks.
@OPpuolitaival mmmm I just looked at a call that was already in the code:
So from what you said that would never have worked either. |
Fixing... |
subprocess.call() does not by default return a status value. Update the commands to add shell=True which forces a return value. Also convert the commands to a single string rather than a list as this plays more nicely with both linux and windows. Also fix a spurious :
/morph build |
Build : SUCCESSBuild number : 3541 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3152 |
Test : SUCCESSBuild number : 3325 |
Description
Currently the following commands in examples.py,
do_import()
do_deploy()
do_versionning()
do_clone()
all return a success status (ie 0) irrespective of any errors
originating from their sub-functions.
This PR fixes this. Now these commands will return one of:
0 - success
1 - general failure
x - failure returned by a subprocess.call function
Pull request type