Search in sources :

Example 1 with CmdExecutor

use of pipelite.executor.CmdExecutor in project pipelite by enasequence.

the class TestType method setNextExitCode.

static void setNextExitCode(TestType testType, Stage stage, StageMapKey key) {
    // Execution count.
    Integer execCount = stageExecCount.get(key);
    if (execCount == null) {
        execCount = 0;
    }
    ++execCount;
    stageExecCount.put(key, execCount);
    // Next exit code.
    String nextExitCode = testType.exitCode(execCount);
    stageNextExitCode.put(key, nextExitCode);
    String pipelineName = key.getPipelineName();
    String processId = key.getProcessId();
    String stageName = key.getStageName();
    if (!nextExitCode.equals("")) {
        if (stage.getExecutor() instanceof KubernetesExecutor) {
            KubernetesExecutor executor = (KubernetesExecutor) stage.getExecutor();
            executor.setImageArgs(testType.nextImageArgs(pipelineName, processId, stageName));
        } else if (stage.getExecutor() instanceof AbstractLsfExecutor<?>) {
            AbstractLsfExecutor<?> executor = (AbstractLsfExecutor<?>) stage.getExecutor();
            executor.setCmd(testType.nextCmd(pipelineName, processId, stageName));
        } else if (stage.getExecutor() instanceof CmdExecutor<?>) {
            CmdExecutor<?> executor = (CmdExecutor<?>) stage.getExecutor();
            executor.setCmd(testType.nextCmd(pipelineName, processId, stageName));
        } else {
            testType.failedAsserts.add("Unexpected executor type when changing executor exit code: " + stage.getExecutor().getClass().getSimpleName());
        }
    }
}
Also used : AbstractLsfExecutor(pipelite.executor.AbstractLsfExecutor) CmdExecutor(pipelite.executor.CmdExecutor) KubernetesExecutor(pipelite.executor.KubernetesExecutor)

Aggregations

AbstractLsfExecutor (pipelite.executor.AbstractLsfExecutor)1 CmdExecutor (pipelite.executor.CmdExecutor)1 KubernetesExecutor (pipelite.executor.KubernetesExecutor)1