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());
}
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);
}
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);
}
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());
}
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);
}
Aggregations