-
Notifications
You must be signed in to change notification settings - Fork 584
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
Support Task Operations and shell commands for task logs #3393
Conversation
resolves spring-cloud#3390 This is to support Acceptance Tests for validating how CTR handles properties
Closing PR per request. |
@@ -105,6 +105,23 @@ | |||
*/ | |||
TaskExecutionResource taskExecutionStatus(long id); | |||
|
|||
/** | |||
* Return the task execution log. The platform to from which to retrieve the log will be set to {@code default}. |
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.
we can remove to
return id; | ||
} | ||
|
||
private void waitForDBToBePopulated(long id) throws Exception { |
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.
Not sure why do we need this method.
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.
sorry, I get this now.
public String getTaskExecutionLog(String taskName) throws Exception{ | ||
long id = launchTaskExecutionForLog(taskName); | ||
CommandResult cr = shell.executeCommand("task execution log --id " + id); | ||
assertTrue(cr.toString().contains("Starting TimestampTaskApplication")); |
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.
Checking TimestampTaskApplication
here may not be correct as this method looks generic.
@@ -229,6 +230,20 @@ public String stop(@CliOption(key = { "", "ids" }, help = "the task execution id | |||
return String.format("Request to stop the task execution with id(s): %s has been submitted", ids); | |||
} | |||
|
|||
@CliCommand(value = LOG, help = "Retrieve task execution log") | |||
public String retrieveTaskExecutionLog(@CliOption(key = { "", "id" }, help = "the task execution id", mandatory = true) long id, | |||
@CliOption(key = { "", "platform" }, help = "the platform of the task execution", mandatory = false) String platform) { |
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.
We can remove key ""
option for the platform key as we can only have one of the options with the default empty key.
LGTM, fixing the above minor comments and merging the PR. |
Rebased and merged as d324ebe |
resolves #3390
This is to support Acceptance Tests for validating how CTR handles properties