Skip to content

Commit

Permalink
Fixed the workflows error in 16.07
Browse files Browse the repository at this point in the history
I wasn't grabbing the right history id for some reason
  • Loading branch information
cwytko committed Nov 16, 2017
1 parent a2ded38 commit f2167b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/Workflows.inc
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ class GalaxyWorkflows extends GalaxyAPIService {
*/
public function invoke($params) {

//print_r($params);

// Check for required fields.
if (!$this->checkRequiredParams($params, array('workflow_id', 'inputs'))) {
return FALSE;
Expand Down
15 changes: 7 additions & 8 deletions tests/WorkflowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ function testInvoke($galaxy, $workflow_id){
$this->assertTrue((count($content_list) > 0) , "Content was not added to history.");
$content_id = $content_list[0]['id'];


// Case 1: Successfully execute workflow with defualt perameters
$invocation = $workflows->invoke(array('workflow_id' => $workflow_id, 'input_dataset_ids' => array($content_id)));
$invocation = $workflows->invoke(array('workflow_id' => $workflow_id, 'inputs' => array(array('id' => $content_id, 'src' => 'hda'))));
$this->assertTrue(is_array($invocation), $galaxy->getErrorMessage());
$this->assertTrue(array_key_exists('state', $invocation) and $invocation['state'] == 'new',
"Workflow invoked returned an array but the workflow is not in the proper state.");
Expand All @@ -158,20 +157,20 @@ function testInvoke($galaxy, $workflow_id){
// Case 2: Successfully execute workflow with history id
$invocation = $workflows->invoke(array(
'workflow_id' => $workflow_id,
'input_dataset_ids' => array($content_id),
'hist_id' => $history_id
'inputs' => array(array('id' => $content_id, 'src' => 'hda')),
'history_id' => $history_id

));
$this->assertTrue(is_array($invocation), $galaxy->getErrorMessage());
// Make sure the newly created invoke workflow is not of state 'new' or state
// 'running'.
while ($invocation['state'] == 'running' or $invocation['state'] == 'new' ) {
sleep(1);
$invocation = $workflows->showInvocations(array('workflow_id' => $workflow_id, 'invocation_id' => $invocation['id']));
$this->assertTrue(is_array($invocation), $galaxy->getErrorMessage());
sleep(1);
$invocation = $workflows->showInvocations(array('workflow_id' => $workflow_id, 'invocation_id' => $invocation['id']));
$this->assertTrue(is_array($invocation), $galaxy->getErrorMessage());
}
// Check to make sure history has the outputted dataset
$content_list = $history_content->index(array('history_id' => $history_id));
$content_list = $history_content->index(array('history_id' => $invocation['history_id']));
$this->assertTrue(count($content_list) > 1 and
array_key_exists('name', $content_list[1]) and $content_list[1]['name'] ==
'Line/Word/Character count on data 1', "Content not in the desired history");
Expand Down

0 comments on commit f2167b5

Please sign in to comment.