Search in sources :

Example 26 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessQueued.

/**
 * Tests successfully building a workflow status from history details (still
 * queued).
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessQueued() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("queued");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("queued", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertEquals("workflow status not in correct state", GalaxyWorkflowState.QUEUED, workflowStatus.getState());
    assertEquals("percentage complete not correct", 0.0f, workflowStatus.getProportionComplete(), DELTA);
}
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 27 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testIsRunningWhileQueued.

/**
 * Tests whether or not this workflow is considered still running (while
 * queued).
 */
@Test
public void testIsRunningWhileQueued() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("queued");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("queued", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not still running", workflowStatus.isRunning());
}
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 28 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testErrorOccuredEmpty.

/**
 * Tests whether or not this workflow is in an error state when it is an
 * empty state.
 */
@Test
public void testErrorOccuredEmpty() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("empty");
    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 29 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testErrorOccuredDiscardedStillRunning.

/**
 * Tests whether or not this workflow is in an error state when it is discarded
 * but the overall workflow is still running.
 */
@Test
public void testErrorOccuredDiscardedStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("discarded");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("discarded", 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 30 with GalaxyWorkflowStatus

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

the class GalaxyHistoriesServiceTest method testGetStatusPartialCompleteState.

/**
 * Tests getting status for a running workflow state.
 * @throws ExecutionManagerException
 */
@Test
public void testGetStatusPartialCompleteState() throws ExecutionManagerException {
    Map<String, List<String>> validStateIds = Util.buildStateIdsWithStateFilled("ok", Arrays.asList("1"));
    validStateIds.put("running", Arrays.asList("2"));
    when(historiesClient.showHistory(VALID_HISTORY_ID)).thenReturn(historyDetails);
    when(historyDetails.getState()).thenReturn("running");
    when(historyDetails.getStateIds()).thenReturn(validStateIds);
    GalaxyWorkflowStatus status = galaxyHistory.getStatusForHistory(VALID_HISTORY_ID);
    assertEquals(GalaxyWorkflowState.RUNNING, status.getState());
    assertEquals("proportion complete is invalid", 0.5f, status.getProportionComplete(), delta);
}
Also used : ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) 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