Search in sources :

Example 1 with GalaxyWorkflowStatus

use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.

the class GalaxyWorkflowStatusTest method testErrorOccuredFailedMetadata.

/**
 * Tests whether or not this workflow is in an error state when there is
 * failed metadata.
 */
@Test
public void testErrorOccuredFailedMetadata() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("failed_metadata");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("failed_metadata", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 2 with GalaxyWorkflowStatus

use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.

the class GalaxyWorkflowStatusTest method testErrorOccuredEmptyStillRunning.

/**
 * Tests whether or not this workflow is in an error state when it is empty
 * but the overall workflow is still running.
 */
@Test
public void testErrorOccuredEmptyStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("empty", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 3 with GalaxyWorkflowStatus

use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.

the class GalaxyWorkflowStatusTest method testErrorOccuredFailedMetadataStillRunning.

/**
 * Tests whether or not this workflow is in an error state when there is
 * failed metadata but the overall workflow is still running.
 */
@Test
public void testErrorOccuredFailedMetadataStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("failed_metadata", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 4 with GalaxyWorkflowStatus

use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.

the class GalaxyWorkflowStatusTest method testErrorOccuredWhileStillRunning.

/**
 * Tests whether or not an error occured even while still running.
 */
@Test
public void testErrorOccuredWhileStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("error", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 5 with GalaxyWorkflowStatus

use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.

the class GalaxyWorkflowStatusTest method testCompletedSuccessfully.

/**
 * Tests whether or not this workflow completed successfully.
 */
@Test
public void testCompletedSuccessfully() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("ok");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("ok", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow did not complete successfully", workflowStatus.completedSuccessfully());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Aggregations

GalaxyWorkflowStatus (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus)36 Test (org.junit.Test)32 HistoryDetails (com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails)18 WorkflowOutputs (com.github.jmchilton.blend4j.galaxy.beans.WorkflowOutputs)6 GalaxyWorkflowState (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowState)5 List (java.util.List)5 Set (java.util.Set)5 History (com.github.jmchilton.blend4j.galaxy.beans.History)4 LinkedList (java.util.LinkedList)4 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)3 Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)3 ArrayList (java.util.ArrayList)3 TimeoutException (java.util.concurrent.TimeoutException)2 ExecutionManagerException (ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerException)1 NoPercentageCompleteException (ca.corefacility.bioinformatics.irida.exceptions.NoPercentageCompleteException)1 AnalysisState (ca.corefacility.bioinformatics.irida.model.enums.AnalysisState)1 HistoryContentsProvenance (com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance)1 ToolParameter (com.github.jmchilton.blend4j.galaxy.beans.ToolParameter)1 Path (java.nio.file.Path)1 Future (java.util.concurrent.Future)1