use of com.epam.pipeline.entity.pipeline.RunLog in project cloud-pipeline by epam.
the class CloudPipelineAPIClient method loadPipelineRunWithLogs.
public PipelineRunWithLog loadPipelineRunWithLogs(final Long pipelineRunId) {
PipelineRunWithLog runWithLog = new PipelineRunWithLog();
runWithLog.setPipelineRun(loadPipelineRun(pipelineRunId));
List<RunLog> runLogs = QueryUtils.execute(cloudPipelineAPI.loadLogs(pipelineRunId));
runWithLog.setRunLogs(runLogs);
return runWithLog;
}
use of com.epam.pipeline.entity.pipeline.RunLog in project cloud-pipeline by epam.
the class LoaderVerificationUtils method verifyRunLogs.
public static void verifyRunLogs(final List<RunLog> expected, final List<RunLog> actual) {
verifyArray(expected, actual);
RunLog expectedRunLog = expected.get(0);
RunLog actualRunLog = actual.get(0);
assertAll("runLog", () -> assertEquals(expectedRunLog.getLogText(), actualRunLog.getLogText()), () -> assertEquals(expectedRunLog.getStatus(), actualRunLog.getStatus()), () -> assertEquals(expectedRunLog.getTask(), actualRunLog.getTask()));
}
use of com.epam.pipeline.entity.pipeline.RunLog in project cloud-pipeline by epam.
the class RunMapperTest method shouldMapRun.
@Test
void shouldMapRun() throws IOException {
PipelineRunMapper mapper = new PipelineRunMapper();
PipelineRunWithLog pipelineRunWithLog = new PipelineRunWithLog();
RunInstance instance = new RunInstance();
instance.setNodeType("type");
instance.setAwsRegionId(TEST_REGION);
instance.setSpot(true);
instance.setNodeDisk(NODE_DISK);
instance.setNodeId("id");
instance.setNodeImage(TEST_PATH);
instance.setNodeName(TEST_NAME);
RunStatus runStatus = new RunStatus();
runStatus.setRunId(1L);
runStatus.setStatus(TaskStatus.SUCCESS);
PipelineRunParameter parameter = new PipelineRunParameter();
parameter.setName(TEST_NAME);
parameter.setValue(TEST_VALUE);
PipelineRun run = new PipelineRun();
run.setId(1L);
run.setName(TEST_NAME);
run.setPipelineName(TEST_NAME);
run.setInstance(instance);
run.setStatus(TaskStatus.SUCCESS);
run.setPipelineName(TEST_NAME);
run.setVersion(TEST_VERSION);
run.setRunStatuses(Collections.singletonList(runStatus));
run.setPricePerHour(PRICE);
run.setPipelineRunParameters(Collections.singletonList(parameter));
RunLog runLog = new RunLog();
runLog.setLogText(TEST_DESCRIPTION);
runLog.setStatus(TaskStatus.SUCCESS);
runLog.setTask(new PipelineTask(TEST_NAME));
pipelineRunWithLog.setPipelineRun(run);
pipelineRunWithLog.setRunOwner(USER);
pipelineRunWithLog.setRunLogs(Collections.singletonList(runLog));
EntityContainer<PipelineRunWithLog> container = EntityContainer.<PipelineRunWithLog>builder().entity(pipelineRunWithLog).owner(USER).permissions(PERMISSIONS_CONTAINER).build();
XContentBuilder contentBuilder = mapper.map(container);
verifyPipelineRun(run, TEST_NAME + " " + TEST_VERSION, contentBuilder);
verifyRunParameters(Collections.singletonList(TEST_NAME + " " + TEST_VALUE), contentBuilder);
verifyRunLogs(Collections.singletonList(TEST_NAME + " " + TEST_DESCRIPTION), contentBuilder);
verifyPipelineUser(USER, contentBuilder);
verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder);
}
Aggregations