Skip to content

Commit

Permalink
fix warning and test launching
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred2g committed Nov 23, 2023
1 parent aba7f4d commit ef241fe
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci_run_jobs_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
{
"name": "--job_id",
"data": "CI_Jobs_Thing_Job_1"
},
{
"name": "--is_ci",
"data": "true"
}
]
}
39 changes: 29 additions & 10 deletions samples/jobs/describe_job_execution/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ int main(int argc, char *argv[])
fprintf(stderr, "Error %d occurred\n", ioErr);
return;
}
fprintf(stdout, "Received Job:\n");
fprintf(stdout, "Job Id: %s\n", response->Execution->JobId->c_str());
fprintf(stdout, "ClientToken: %s\n", response->ClientToken->c_str());
fprintf(stdout, "Execution Status: %s\n", JobStatusMarshaller::ToString(*response->Execution->Status));
if (response)
{
fprintf(stdout, "Received Job:\n");
fprintf(stdout, "Job Id: %s\n", response->Execution->JobId->c_str());
fprintf(stdout, "ClientToken: %s\n", response->ClientToken->c_str());
fprintf(stdout, "Execution Status: %s\n", JobStatusMarshaller::ToString(*response->Execution->Status));
}
};

jobsClient.SubscribeToDescribeJobExecutionAccepted(
Expand Down Expand Up @@ -206,11 +209,17 @@ int main(int argc, char *argv[])
{
auto OnSubscribeToStartNextPendingJobExecutionAcceptedResponse =
[&](StartNextJobExecutionResponse *response, int ioErr) {
fprintf(stdout, "Start Job %s\n", response->Execution.value().JobId.value().c_str());
currentJobId = response->Execution->JobId.value();
currentExecutionNumber = response->Execution->ExecutionNumber.value();
currentVersionNumber = response->Execution->VersionNumber.value();

if (ioErr)
{
fprintf(stderr, "Error %d occurred\n", ioErr);
}
if (response)
{
fprintf(stdout, "Start Job %s\n", response->Execution.value().JobId.value().c_str());
currentJobId = response->Execution->JobId.value();
currentExecutionNumber = response->Execution->ExecutionNumber.value();
currentVersionNumber = response->Execution->VersionNumber.value();
}
pendingExecutionPromise.set_value();
};

Expand Down Expand Up @@ -245,7 +254,12 @@ int main(int argc, char *argv[])
{
pendingExecutionPromise = std::promise<void>();
auto OnSubscribeToUpdateJobExecutionAcceptedResponse = [&](UpdateJobExecutionResponse *response,
int iotErr) {
int ioErr) {
(void)response;
if (ioErr)
{
fprintf(stderr, "Error %d occurred\n", ioErr);
}
fprintf(stdout, "Marked Job %s IN_PROGRESS", currentJobId.c_str());
pendingExecutionPromise.set_value();
};
Expand Down Expand Up @@ -288,6 +302,11 @@ int main(int argc, char *argv[])
subscriptionRequest.JobId = currentJobId;

auto subscribeHandler = [&](UpdateJobExecutionResponse *response, int ioErr) {
(void)response;
if (ioErr)
{
fprintf(stderr, "Error %d occurred\n", ioErr);
}
fprintf(stdout, "Marked job %s currentJobId SUCCEEDED", currentJobId.c_str());
pendingExecutionPromise.set_value();
};
Expand Down

0 comments on commit ef241fe

Please sign in to comment.