-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[root.exe] Use non-zero exit status when invalid arguments are passed #19196
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
Conversation
f8f008e
to
c177567
Compare
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.
LGTM.
Side note: The RUFF does not seem to handle well deleted files, see:
https://github.com/root-project/root/actions/runs/15901873603/job/44846574695?pr=19196
which says:
Run files=$(cat changed_files.txt | grep '\.py$' || echo "")
Error: tutorials/.enableImplicitMTWrapper.py:1:1: E902 No such file or directory (os error 2)
Error: Process completed with exit code 123.
Test Results 20 files 20 suites 3d 11h 41m 11s ⏱️ For more details on these failures, see this check. Results for commit a07f891. ♻️ This comment has been updated with latest results. |
@pcanal I had noticed the same, but this problem was fixed in the mean time here: #19197 |
c177567
to
4720fd7
Compare
This invocation root.exe "-e EnableImplicitMT(4)" (single argument instead of two) broke the IMT tutorials, but went undetected. Here, we set the exit status to 2 if root.exe's arguments could not be parsed correctly. (When the interpreter command fails, the exit status is set to 1, so these two cases can be told apart.) Since the executable now exits with a non-zero status, the test had to be pulled out of gtest, and is now split into one that tests the exit status and one that checks the error message.
4720fd7
to
a07f891
Compare
Followup to #19195:
RDF IMT tutorials didn't run since 10 months, since the following passed with a 0 exit status:
To avoid similar problem in the future, I suggest here to exit with a non-zero exit status. I chose 2 because 1 usually means that the script/macro/command that was running in the interpreter failed:
Whereas a failure to parse the argument would now be: