Search in sources :

Example 1 with ResultEnum

use of io.elastest.etm.model.TJobExecution.ResultEnum in project elastest-torm by elastest.

the class TJobExecOrchestratorService method saveFinishStatus.

public void saveFinishStatus(TJobExecution tJobExec, DockerExecution dockerExec) {
    String resultMsg = "";
    ResultEnum finishStatus = ResultEnum.SUCCESS;
    if (tJobExec.getTestSuites() != null) {
        for (TestSuite testSuite : tJobExec.getTestSuites()) {
            if (testSuite.getFinalStatus() == ResultEnum.FAIL) {
                // Else
                // always
                // success
                finishStatus = testSuite.getFinalStatus();
                break;
            }
        }
    } else {
        if (dockerExec.getTestContainerExitCode() != 0) {
            finishStatus = ResultEnum.FAIL;
        }
    }
    resultMsg = "Finished: " + finishStatus;
    updateTJobExecResultStatus(tJobExec, finishStatus, resultMsg);
}
Also used : TestSuite(io.elastest.etm.model.TestSuite) ReportTestSuite(org.apache.maven.plugins.surefire.report.ReportTestSuite) ResultEnum(io.elastest.etm.model.TJobExecution.ResultEnum)

Aggregations

ResultEnum (io.elastest.etm.model.TJobExecution.ResultEnum)1 TestSuite (io.elastest.etm.model.TestSuite)1 ReportTestSuite (org.apache.maven.plugins.surefire.report.ReportTestSuite)1