use of ca.corefacility.bioinformatics.irida.model.workflow.analysis.JobError in project irida by phac-nml.
the class GalaxyJobErrorsServiceIT method testFailingAnalysisReturnsJobError.
/**
* Test that a failure producing Galaxy workflow analysis returns a {@link JobError}
*/
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testFailingAnalysisReturnsJobError() throws Exception {
databaseSetupGalaxyITService.setupSubmissionInDatabase(1L, sequenceFilePath, referenceFilePath, iridaWorkflowIdWithError, false);
AnalysisSubmission submission = runAnalysis();
assertEquals(AnalysisState.ERROR, submission.getAnalysisState());
List<JobError> errors = galaxyJobErrorsService.createNewJobErrors(submission);
assertTrue("There should only be one JobError", errors.size() == 1);
JobError jobError = errors.get(0);
assertTrue("JobError should have some stderr message", jobError.getStandardError() != null && !jobError.getStandardError().equals(""));
assertTrue("JobError should be triggered by 'IndexError: list index out of range'", jobError.getStandardError().contains("IndexError: list index out of range"));
assertTrue("JobError tool ID should be 'Filter1'", jobError.getToolId().equals("Filter1"));
assertTrue("JobError exit code should be '1'", jobError.getExitCode() == 1);
}
Aggregations