Search in sources :

Example 21 with ScriptOutput

use of io.kestra.core.tasks.scripts.ScriptOutput in project kestra by kestra-io.

the class AbstractBashTest method longBashCreateTempFiles.

@Test
void longBashCreateTempFiles() throws Exception {
    List<String> commands = new ArrayList<>();
    for (int i = 0; i < 15000; i++) {
        commands.add("if [ \"" + i + "\" -eq 0 ] || [ \"" + i + "\" -eq 14999  ]; then echo " + i + ";fi;");
    }
    Bash bash = configure(Bash.builder().commands(commands.toArray(String[]::new))).build();
    RunContext runContext = TestsUtils.mockRunContext(runContextFactory, bash, ImmutableMap.of());
    ScriptOutput run = bash.run(runContext);
    assertThat(run.getExitCode(), is(0));
    assertThat(run.getStdOutLineCount(), is(2));
    assertThat(run.getStdErrLineCount() > 0, is(false));
}
Also used : ScriptOutput(io.kestra.core.tasks.scripts.ScriptOutput) RunContext(io.kestra.core.runners.RunContext) Bash(io.kestra.core.tasks.scripts.Bash) MicronautTest(io.micronaut.test.extensions.junit5.annotation.MicronautTest) Test(org.junit.jupiter.api.Test)

Aggregations

RunContext (io.kestra.core.runners.RunContext)21 ScriptOutput (io.kestra.core.tasks.scripts.ScriptOutput)21 MicronautTest (io.micronaut.test.extensions.junit5.annotation.MicronautTest)21 Test (org.junit.jupiter.api.Test)21 HashMap (java.util.HashMap)14 Python (io.kestra.core.tasks.scripts.Python)8 Bash (io.kestra.core.tasks.scripts.Bash)7 Node (io.kestra.core.tasks.scripts.Node)6 FileInputStream (java.io.FileInputStream)3 InputStream (java.io.InputStream)2 InputStreamReader (java.io.InputStreamReader)2 URI (java.net.URI)2 URL (java.net.URL)2 File (java.io.File)1 DisabledIfEnvironmentVariable (org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable)1