Skip to content

[Tools] Handling Exceptions better when building tests #2855

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

Merged
merged 1 commit into from
Sep 30, 2016

Conversation

bridadan
Copy link
Contributor

@bridadan bridadan commented Sep 28, 2016

Description

Previously, when building tests with test.py, if an exception occurred, the
error message would be masked by the function 'build_tests'. This commit
handles NotSupportedExceptions and ToolExceptions, but lets all other
Exceptions propigate up to the caller function. In most cases, this is the
CLI scripts, which will print a traceback. This will allow us to better
debug the python tools if errors occur.

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Todos

result = False

if continue_on_build_fail:
continue
else:
break
else:
raise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing could also be:

except NotSupportedException:
    pass
except ToolException:
    result = False
    if continue_on_build_fail:
        continue
    else:
        break

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That it could, and it is now so

@bridadan bridadan force-pushed the handle-exceptions-better branch from 5adb2f7 to fa3257d Compare September 28, 2016 19:12
Previously, when building tests with test.py, if an exception occurred, the
error message would be masked by the function 'build_tests'. This commit
handles NotSupportedExceptions and ToolExceptions, but lets all other
Exceptions propigate up to the caller function. In most cases, this is the
CLI scripts, which will print a traceback. This will allow us to better
debug the python tools if errors occur.
@bridadan bridadan force-pushed the handle-exceptions-better branch from fa3257d to cadcc80 Compare September 28, 2016 19:13
@bridadan
Copy link
Contributor Author

/morph test

@sg- sg- added the needs: CI label Sep 28, 2016
@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: null

Examples Build failed!

@bridadan
Copy link
Contributor Author

Oops this was my fault! Messing with CI again, retriggering now.

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 993

All builds and test passed!

@bridadan
Copy link
Contributor Author

@sg- Should be good to go

@sg- sg- merged commit b3522fe into ARMmbed:master Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants