Search in sources :

Example 1 with StageExecutorRequest

use of pipelite.stage.executor.StageExecutorRequest in project pipelite by enasequence.

the class LsfDefinitionFilePathResolverTest method testWithoutDirWithoutUser.

@Test
public void testWithoutDirWithoutUser() {
    StageExecutorRequest request = request();
    LsfExecutorParameters params = LsfExecutorParameters.builder().build();
    LsfDefinitionFilePathResolver resolver = new LsfDefinitionFilePathResolver(request, params);
    String user = System.getProperty("user.name");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo(user + "/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo(user + "/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".job");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".job");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) LsfExecutorParameters(pipelite.stage.parameters.LsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 2 with StageExecutorRequest

use of pipelite.stage.executor.StageExecutorRequest in project pipelite by enasequence.

the class LsfLogFilePathResolverTest method request.

private final StageExecutorRequest request() {
    Stage stage = Mockito.mock(Stage.class);
    when(stage.getStageName()).thenReturn(STAGE_NAME);
    StageExecutorRequest request = new StageExecutorRequest(PIPELITE_NAME, PROCESS_ID, stage);
    return request;
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage)

Example 3 with StageExecutorRequest

use of pipelite.stage.executor.StageExecutorRequest in project pipelite by enasequence.

the class LsfLogFilePathResolverTest method testWithoutDirWithoutUser.

@Test
public void testWithoutDirWithoutUser() {
    StageExecutorRequest request = request();
    AbstractLsfExecutorParameters params = AbstractLsfExecutorParameters.builder().build();
    LsfLogFilePathResolver resolver = new LsfLogFilePathResolver(request, params);
    String user = System.getProperty("user.name");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo(user + "/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo(user + "/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".out");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".out");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) AbstractLsfExecutorParameters(pipelite.stage.parameters.AbstractLsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 4 with StageExecutorRequest

use of pipelite.stage.executor.StageExecutorRequest in project pipelite by enasequence.

the class AbstractLsfExecutorFilesTest method resolveDefaultLogFile.

@Test
public void resolveDefaultLogFile() {
    TestLsfExecutor executor = new TestLsfExecutor();
    Stage stage = Stage.builder().stageName("STAGE_NAME").executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName("PIPELINE_NAME").processId("PROCESS_ID").stage(stage).build();
    AbstractLsfExecutorParameters params = AbstractLsfExecutorParameters.builder().build();
    assertThat(params.resolveLogFile(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/PIPELINE_NAME/PROCESS_ID/STAGE_NAME.out");
    params = AbstractLsfExecutorParameters.builder().user("user").build();
    assertThat(params.resolveLogFile(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("user/PIPELINE_NAME/PROCESS_ID/STAGE_NAME.out");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) AbstractLsfExecutorParameters(pipelite.stage.parameters.AbstractLsfExecutorParameters) Stage(pipelite.stage.Stage) Test(org.junit.jupiter.api.Test)

Example 5 with StageExecutorRequest

use of pipelite.stage.executor.StageExecutorRequest in project pipelite by enasequence.

the class AbstractLsfExecutorFilesTest method resolveDefaultLogDir.

@Test
public void resolveDefaultLogDir() {
    TestLsfExecutor executor = new TestLsfExecutor();
    Stage stage = Stage.builder().stageName("STAGE_NAME").executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName("PIPELINE_NAME").processId("PROCESS_ID").stage(stage).build();
    AbstractLsfExecutorParameters params = AbstractLsfExecutorParameters.builder().build();
    assertThat(params.resolveLogDir(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("%U/PIPELINE_NAME/PROCESS_ID");
    params = AbstractLsfExecutorParameters.builder().user("user").build();
    assertThat(params.resolveLogDir(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("user/PIPELINE_NAME/PROCESS_ID");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) AbstractLsfExecutorParameters(pipelite.stage.parameters.AbstractLsfExecutorParameters) Stage(pipelite.stage.Stage) Test(org.junit.jupiter.api.Test)

Aggregations

StageExecutorRequest (pipelite.stage.executor.StageExecutorRequest)21 Test (org.junit.jupiter.api.Test)18 Stage (pipelite.stage.Stage)13 AbstractLsfExecutorParameters (pipelite.stage.parameters.AbstractLsfExecutorParameters)6 LsfExecutorParameters (pipelite.stage.parameters.LsfExecutorParameters)6 SimpleLsfExecutorParameters (pipelite.stage.parameters.SimpleLsfExecutorParameters)6 LsfFilePathResolver (pipelite.stage.path.LsfFilePathResolver)2 LsfLogFilePathResolver (pipelite.stage.path.LsfLogFilePathResolver)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 StageExecutorResult (pipelite.stage.executor.StageExecutorResult)1 LsfDefinitionFilePathResolver (pipelite.stage.path.LsfDefinitionFilePathResolver)1