-
Notifications
You must be signed in to change notification settings - Fork 0
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
[icon4pygen]: Print error message when codegen fails in tests #411
Conversation
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.
Just a question and a minor issue.
@@ -136,7 +137,10 @@ def test_codegen(cli, stencil_module, stencil_name, flags) -> None: | |||
with cli.isolated_filesystem(): | |||
cli_args = [module_path, BLOCK_SIZE, LEVELS_PER_THREAD, OUTPATH, *flags] | |||
result = cli.invoke(main, cli_args) | |||
assert result.exit_code == 0 | |||
if not result.exit_code == 0: | |||
traceback.format_exception(*result.exc_info) |
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.
traceback.format_exception(*result.exc_info) |
if not result.exit_code == 0: | ||
traceback.format_exception(*result.exc_info) | ||
msg = "".join(traceback.format_exception(*result.exc_info)) | ||
pytest.fail("Codegen failed with error:\n" + msg) |
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.
I like more to keep the assert
statement because it's way simpler to read. What about using an assert with a custom message:
if not result.exit_code == 0: | |
traceback.format_exception(*result.exc_info) | |
msg = "".join(traceback.format_exception(*result.exc_info)) | |
pytest.fail("Codegen failed with error:\n" + msg) | |
assert result.exit_code == 0, f"Codegen failed with error:\n{''.join(traceback.format_exception(*result.exc_info))}" |
Mandatory Tests Please make sure you run these tests via comment before you merge!
Optional Tests To run benchmarks you can use:
To run tests and benchmarks with the DaCe backend you can use:
In case your change might affect downstream icon-exclaim, please consider running
For more detailed information please look at CI in the EXCLAIM universe. |
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.
ILGTM.
cscs-ci run default |
launch jenkins spack |
When code generation fails we previously just printed the processes exit code in the tests. This PR forwards the exception for easier debugging.
When code generation fails we previously just printed the processes exit code in the tests. This PR forwards the exception for easier debugging.
When code generation fails we previously just printed the processes exit code in the tests. This PR forwards the exception for easier debugging.