Search in sources :

Example 6 with JobError

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);
}
Also used : AnalysisSubmission(ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission) JobError(ca.corefacility.bioinformatics.irida.model.workflow.analysis.JobError) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Aggregations

JobError (ca.corefacility.bioinformatics.irida.model.workflow.analysis.JobError)6 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)4 Test (org.junit.Test)3 WithMockUser (org.springframework.security.test.context.support.WithMockUser)3 AnalysisState (ca.corefacility.bioinformatics.irida.model.enums.AnalysisState)1 GalaxyWorkflowState (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowState)1 DTAnalysis (ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTAnalysis)1 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)1 JobsClient (com.github.jmchilton.blend4j.galaxy.JobsClient)1 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)1 HistoryContentsProvenance (com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance)1 HistoryDetails (com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails)1 JobDetails (com.github.jmchilton.blend4j.galaxy.beans.JobDetails)1 Tool (com.github.jmchilton.blend4j.galaxy.beans.Tool)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Future (java.util.concurrent.Future)1 Collectors (java.util.stream.Collectors)1 Authentication (org.springframework.security.core.Authentication)1