Search in sources :

Example 6 with PipelineRunParameter

use of com.epam.pipeline.entity.pipeline.run.parameter.PipelineRunParameter in project cloud-pipeline by epam.

the class LoaderVerificationUtils method verifyRunParameters.

public static void verifyRunParameters(final List<PipelineRunParameter> expectedRunParameters, final List<PipelineRunParameter> actualRunParameters) {
    verifyArray(expectedRunParameters, actualRunParameters);
    PipelineRunParameter expectedRunParameter = expectedRunParameters.get(0);
    PipelineRunParameter actualRunParameter = actualRunParameters.get(0);
    assertAll("runParameter", () -> assertEquals(expectedRunParameter.getName(), actualRunParameter.getName()), () -> assertEquals(expectedRunParameter.getValue(), actualRunParameter.getValue()));
}
Also used : PipelineRunParameter(com.epam.pipeline.entity.pipeline.run.parameter.PipelineRunParameter)

Example 7 with PipelineRunParameter

use of com.epam.pipeline.entity.pipeline.run.parameter.PipelineRunParameter 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);
}
Also used : MapperVerificationUtils.verifyPipelineRun(com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyPipelineRun) PipelineRun(com.epam.pipeline.entity.pipeline.PipelineRun) RunStatus(com.epam.pipeline.entity.pipeline.run.RunStatus) RunLog(com.epam.pipeline.entity.pipeline.RunLog) PipelineRunWithLog(com.epam.pipeline.elasticsearchagent.model.PipelineRunWithLog) RunInstance(com.epam.pipeline.entity.pipeline.RunInstance) PipelineTask(com.epam.pipeline.entity.pipeline.PipelineTask) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) PipelineRunParameter(com.epam.pipeline.entity.pipeline.run.parameter.PipelineRunParameter) Test(org.junit.jupiter.api.Test)

Aggregations

PipelineRunParameter (com.epam.pipeline.entity.pipeline.run.parameter.PipelineRunParameter)7 PipelineRun (com.epam.pipeline.entity.pipeline.PipelineRun)3 RunStatus (com.epam.pipeline.entity.pipeline.run.RunStatus)3 ArrayList (java.util.ArrayList)3 PipelineRunWithLog (com.epam.pipeline.elasticsearchagent.model.PipelineRunWithLog)2 PipelineTask (com.epam.pipeline.entity.pipeline.PipelineTask)2 RunInstance (com.epam.pipeline.entity.pipeline.RunInstance)2 RunLog (com.epam.pipeline.entity.pipeline.RunLog)2 HashMap (java.util.HashMap)2 Test (org.junit.jupiter.api.Test)2 LoaderVerificationUtils.verifyPipelineRun (com.epam.pipeline.elasticsearchagent.LoaderVerificationUtils.verifyPipelineRun)1 LoaderVerificationUtils.verifyRunInstance (com.epam.pipeline.elasticsearchagent.LoaderVerificationUtils.verifyRunInstance)1 MapperVerificationUtils.verifyPipelineRun (com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyPipelineRun)1 EntityContainer (com.epam.pipeline.elasticsearchagent.model.EntityContainer)1 AbstractSecuredEntity (com.epam.pipeline.entity.AbstractSecuredEntity)1 PipeConfValueVO (com.epam.pipeline.entity.configuration.PipeConfValueVO)1 ExecutionPreferences (com.epam.pipeline.entity.pipeline.run.ExecutionPreferences)1 RestartRun (com.epam.pipeline.entity.pipeline.run.RestartRun)1 RunSid (com.epam.pipeline.entity.pipeline.run.parameter.RunSid)1 AclClass (com.epam.pipeline.entity.security.acl.AclClass)1