-
Notifications
You must be signed in to change notification settings - Fork 52
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
added test_user_script_crash test (#709) #777
base: develop
Are you sure you want to change the base?
added test_user_script_crash test (#709) #777
Conversation
Detects if a by-design crashing black-box script Traceback is visible in the stderr output of orion.
def test_user_script_crash(capfd): | ||
"""Checks that the Traceback of a crashing user script is output to stderr""" | ||
|
||
orion.core.cli.main( |
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.
The test if failing because the script is not found. Pytest is executed from the root so it cannot find this file at the root. You can use monkeypatch to change the working dir temporarily: https://github.com/Epistimio/orion/blob/develop/tests/functional/commands/conftest.py#L61
Note, the first test of this module is not crashing because it has the fixture one_experiment
which does this change of working directory.
"-c", | ||
"-x~uniform(-5,5)", | ||
] | ||
) |
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.
You could test the exit-code at the same time. The main
should return it.
Co-authored-by: Xavier Bouthillier <[email protected]>
Description
Detects if a by-design crashing black-box script Traceback is visible in the stderr output of orion.
The test succeeds, which indicates that the stacktrace is indeed visible by the user on his terminal output.
Is meant to implement issue #709
Changes
Just a test, since the behaviour is already good.
Added a "black box" utility script that can return a code passed by argument, and/or crash if -c argument is specified.
Checklist
Tests
$ tox -e py38
; replace38
by your Python version if necessary)Documentation
Quality
$ tox -e lint
)Further comments
n/a