Search in sources :

Example 16 with StageExecutorRequest

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

the class LsfDefinitionFilePathResolverTest method testWithoutDirWithUser.

@Test
public void testWithoutDirWithUser() {
    StageExecutorRequest request = request();
    LsfExecutorParameters params = LsfExecutorParameters.builder().user("user").build();
    LsfDefinitionFilePathResolver resolver = new LsfDefinitionFilePathResolver(request, params);
    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 17 with StageExecutorRequest

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

the class LsfDefinitionFilePathResolverTest method testWithDirWithoutUser.

@Test
public void testWithDirWithoutUser() {
    StageExecutorRequest request = request();
    LsfExecutorParameters params = LsfExecutorParameters.builder().definitionDir("a/b").build();
    LsfDefinitionFilePathResolver resolver = new LsfDefinitionFilePathResolver(request, params);
    String user = System.getProperty("user.name");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/" + user + "/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/" + user + "/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".job");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%U/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%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 18 with StageExecutorRequest

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

the class LsfDefinitionFilePathResolverTest method testWithDirWithUser.

@Test
public void testWithDirWithUser() {
    StageExecutorRequest request = request();
    LsfExecutorParameters params = LsfExecutorParameters.builder().definitionDir("a/b").user("user").build();
    LsfDefinitionFilePathResolver resolver = new LsfDefinitionFilePathResolver(request, params);
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/user/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/user/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".job");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%U/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%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 19 with StageExecutorRequest

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

the class LsfLogFilePathResolverTest method testWithDirWithoutUser.

@Test
public void testWithDirWithoutUser() {
    StageExecutorRequest request = request();
    AbstractLsfExecutorParameters params = AbstractLsfExecutorParameters.builder().logDir("a/b").build();
    LsfLogFilePathResolver resolver = new LsfLogFilePathResolver(request, params);
    String user = System.getProperty("user.name");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/" + user + "/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN)).isEqualTo("a/b/" + user + "/" + PIPELITE_NAME + "/" + PROCESS_ID + "/" + STAGE_NAME + ".out");
    assertThat(resolver.getDir(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%U/" + PIPELITE_NAME + "/" + PROCESS_ID);
    assertThat(resolver.getFile(LsfFilePathResolver.Format.WITH_LSF_PATTERN)).isEqualTo("a/b/%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 20 with StageExecutorRequest

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

the class LsfLogFilePathResolverTest method testWithoutDirWithUser.

@Test
public void testWithoutDirWithUser() {
    StageExecutorRequest request = request();
    AbstractLsfExecutorParameters params = AbstractLsfExecutorParameters.builder().user("user").build();
    LsfLogFilePathResolver resolver = new LsfLogFilePathResolver(request, params);
    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)

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