Repository navigation
fix(validate): exit with code 1 when overwrite is declined - #386
Merged
marcosmc merged 3 commits intoAug 24, 2026
Merged
Conversation
When a user declines to overwrite an existing output directory in __initialize_working_environment(), Validation previously called sys.exit() with no arguments, yielding exit code 0. Call sys.exit(1) so the abort signals a failure to callers and CI scripts. Fixes dynawo#381
snowyukitty
requested review from
guiuomsfont-aia,
jl-marin,
louisg-rte and
marcosmc
as code owners
August 16, 2026 00:20
Collaborator
|
Thanks for the contribution — the change is correct. Completed on top of your branch: the same bare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user declines to overwrite an existing output/results directory in
__initialize_working_environment(),Validationcalledsys.exit()with no arguments. This resulted in an exit code of 0, incorrectly indicating success to caller scripts or CI workflows (#381).Solution
src/dycov/validate/validation.py, changesys.exit()tosys.exit(1)when the output directory check prompts the exit warning.tests/dycov/validate/test_validation.py:test_validation_exits_on_existing_output_dir, assert thatexc_info.value.code == 1.Fixes #381