-
Notifications
You must be signed in to change notification settings - Fork 49
[Fix #898] RunShell minor improvements #910
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
[Fix #898] RunShell minor improvements #910
Conversation
| softly.assertThat(outputModel.asText().get()).isNotEmpty(); | ||
| softly.assertThat(outputModel.asText().get()).contains("ls: cannot access"); | ||
| softly.assertThat(outputModel.asText().get()).contains("No such file or directory"); | ||
| softly.assertThat(outputModel.asText().get()).contains("ls"); |
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.
This test only worked if the locale of the OS was english, so I do the trick of just checking that the stderr contains "ls"
Enable test only in linux (till we implement for other Operating systems) Run asynchrnously Signed-off-by: fjtirado <ftirados@redhat.com>
e01d199 to
13f154f
Compare
| return input; | ||
| } | ||
|
|
||
| return taskConfiguration.isAwait() |
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.
yes, this one was not needed, but I love ternary operator and could not refrain, sorry ;)
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.
😆
| if (entry.getValue() == null) { | ||
| commandBuilder.append(" ").append(argKey); | ||
| continue; | ||
| commandBuilder |
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 wanted to avoid the use of continue, which in this case was possible
| : shellCommand; | ||
|
|
||
| StringBuilder commandBuilder = new StringBuilder(command); | ||
| StringBuilder commandBuilder = |
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 saving a variable declaration
| ProcessBuilder processBuilder = this.processBuilderSupplier.apply(workflowContext, taskContext); | ||
| return CompletableFuture.completedFuture( | ||
| this.shellResultSupplier.apply(taskContext, input, processBuilder)); | ||
| return CompletableFuture.supplyAsync( |
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 forgot about that, nice
Enable test only in linux (till we implement for other Operating systems)
Run asynchronously