-
-
Notifications
You must be signed in to change notification settings - Fork 82
Improve console batch mode #1692
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
|
I reworked a bit this pr.
|
|
This looks good; I will test this later today. Did you see the "Additional Notes" above? Thanks for the improvements! PS: I will make additions to the docs once this PR is merged. |
|
@gramian All the tests are green and I adde a couple of tests in ConsoleBatchTest to verify the new flags. My intention was to not change the previous behavior. |
|
@robfrank If I remember correctly, the |
|
I figured it out. The test runs and seems to work as it is supposed to. |
|
I tested with a simple script and it seems to work as expected. |
What does this PR do?
Overall, this change alters the console behavior such that if an error occurs in batch mode or during a script, execution is halted and if in batch mode, the console is exited.
In particular these changes are introduced in
Console.java:parsemethod have 3 arguments (see line 731). The third argument is abooleanindicating batch mode, which is true by default.parsedoes not consume exeception anymore, but throws them upwards (see line 742ff).executemethod now throws alsoRuntimeExeception(see line line 223)executemethod uses newparsemethod depending on if batch mode is set.Motivation
Currently console continues to execute commands in scripts or batch even though previous command fails. This can produce unwanted results. Especially tracking errors is complicated since if the last line passes, it seems as if a script or batch is successful.
Additional Notes
@lvca
ConsoleTest:testNotNullPropertiesfails, is this test faulty?execute.Checklist
mvn clean packagecommand