Search in sources :

Example 6 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testErrorOccured.

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

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete.

/**
 * Tests successfully building a workflow status from history details
 * (quater complete).
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete() {
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID, DATASET_ID2, DATASET_ID3));
    stateIds.put("ok", Lists.newArrayList(DATASET_ID));
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(stateIds);
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
    assertEquals("percentage complete not correct", 0.25f, workflowStatus.getProportionComplete(), DELTA);
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) List(java.util.List) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 8 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessRunning.

/**
 * Tests successfully building a workflow status from history details (still
 * running).
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID));
    stateIds.put("ok", Lists.newArrayList(DATASET_ID));
    historyDetails.setStateIds(stateIds);
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
    assertEquals("percentage complete not correct", 0.5f, workflowStatus.getProportionComplete(), DELTA);
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) List(java.util.List) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 9 with GalaxyWorkflowStatus

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

the class GalaxyWorkflowStatusTest method testIsRunning.

/**
 * Tests whether or not this workflow is still running.
 */
@Test
public void testIsRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("running", 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 10 with GalaxyWorkflowStatus

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

the class GalaxyHistoriesServiceIT method testGetStatusForHistory.

/**
 * Tests getting the status for a history successfully.
 * @throws ExecutionManagerException
 * @throws InterruptedException
 * @throws TimeoutException
 */
@Test
public void testGetStatusForHistory() throws ExecutionManagerException, TimeoutException, InterruptedException {
    History history = galaxyHistory.newHistoryForWorkflow();
    galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    Util.waitUntilHistoryComplete(history.getId(), galaxyHistory, 60);
    GalaxyWorkflowStatus status = galaxyHistory.getStatusForHistory(history.getId());
    assertEquals("state is invalid", GalaxyWorkflowState.OK, status.getState());
    assertEquals("proportion complete is invalid", 1.0f, status.getProportionComplete(), DELTA);
}
Also used : History(com.github.jmchilton.blend4j.galaxy.beans.History) 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