Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

cppwfs
Copy link
Contributor

@cppwfs cppwfs commented Jul 30, 2019

resolves #3390

This is to support Acceptance Tests for validating how CTR handles properties

resolves spring-cloud#3390

This is to support Acceptance Tests for validating how CTR handles properties
@cppwfs cppwfs requested a review from ilayaperumalg July 30, 2019 14:53
@cppwfs
Copy link
Contributor Author

cppwfs commented Jul 31, 2019

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}.
Copy link
Contributor

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 {
Copy link
Contributor

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.

Copy link
Contributor

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"));
Copy link
Contributor

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) {
Copy link
Contributor

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.

@ilayaperumalg
Copy link
Contributor

LGTM, fixing the above minor comments and merging the PR.

@ilayaperumalg
Copy link
Contributor

Rebased and merged as d324ebe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TaskOperations needs to support the retrieval of logs
3 participants