Skip to content

Commit

Permalink
Add job resume test with HDCA input to paused dataset
Browse files Browse the repository at this point in the history
I am slightly surprised that this worked without change,
but it appears that the remapping occurs via the HDAs that
the HDCA is composed of.
  • Loading branch information
mvdbeek committed Dec 31, 2017
1 parent 2610341 commit 9fdf0a6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 13 deletions.
43 changes: 38 additions & 5 deletions test/api/test_workflows.py
Expand Up @@ -676,20 +676,53 @@ def test_workflow_resume_from_failed_step(self):
history_id = self.dataset_populator.new_history()
invocation_id = self.__invoke_workflow(history_id, workflow_id)
self.wait_for_invocation_and_jobs(history_id, workflow_id, invocation_id, assert_ok=False)
failed_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=1, wait=True, assert_ok=False)
assert failed_dataset['state'] == 'error', failed_dataset
paused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=2, wait=True, assert_ok=False)
failed_dataset_one = self.dataset_populator.get_history_dataset_details(history_id, hid=1, wait=True, assert_ok=False)
assert failed_dataset_one['state'] == 'error', failed_dataset_one
paused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=5, wait=True, assert_ok=False)
assert paused_dataset['state'] == 'paused', paused_dataset
inputs = {"thebool": "false",
"failbool": "false",
"rerun_remap_job_id": failed_dataset['creating_job']}
"rerun_remap_job_id": failed_dataset_one['creating_job']}
self.dataset_populator.run_tool(tool_id='job_properties',
inputs=inputs,
history_id=history_id,
assert_ok=True)
unpaused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=2, wait=True, assert_ok=False)
unpaused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=5, wait=True, assert_ok=False)
assert unpaused_dataset['state'] == 'ok'

@skip_without_tool("job_properties")
@skip_without_tool("identifier_multiple_in_conditional")
def test_workflow_resume_from_failed_step_with_hdca_input(self):
workflow_id = self._upload_yaml_workflow("""
class: GalaxyWorkflow
steps:
- tool_id: job_properties
state:
thebool: true
failbool: true
- tool_id: identifier_collection
state:
input1:
$link: 0#list_output
""")
with self.dataset_populator.test_history() as history_id:
invocation_id = self.__invoke_workflow(history_id, workflow_id)
self.wait_for_invocation_and_jobs(history_id, workflow_id, invocation_id, assert_ok=False)
failed_dataset_one = self.dataset_populator.get_history_dataset_details(history_id, hid=1, wait=True, assert_ok=False)
assert failed_dataset_one['state'] == 'error', failed_dataset_one
paused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=5, wait=True, assert_ok=False)
assert paused_dataset['state'] == 'paused', paused_dataset
inputs = {"thebool": "false",
"failbool": "false",
"rerun_remap_job_id": failed_dataset_one['creating_job']}
self.dataset_populator.run_tool(tool_id='job_properties',
inputs=inputs,
history_id=history_id,
assert_ok=True)
unpaused_dataset = self.dataset_populator.get_history_dataset_details(history_id, hid=5, wait=True,
assert_ok=False)
assert unpaused_dataset['state'] == 'ok'

@skip_without_tool("collection_creates_pair")
def test_workflow_run_output_collection_mapping(self):
workflow_id = self._upload_yaml_workflow("""
Expand Down
22 changes: 14 additions & 8 deletions test/functional/tools/job_properties.xml
@@ -1,26 +1,32 @@
<tool id="job_properties" name="Test Job Properties">
<command>
<command><![CDATA[
#if $thebool
echo "The bool is true";
echo "The bool is really true" 1>&amp;2;
echo "This is a line of text." > $out_file1
echo "The bool is true" &&
echo "The bool is really true" 1>&2 &&
echo "This is a line of text." > '$out_file1' &&
cp '$out_file1' $one &&
cp '$out_file1' $two
#else
echo "The bool is not true";
echo "The bool is very not true" 1>&amp;2;
echo "This is a different line of text." > $out_file1;
echo "The bool is not true" &&
echo "The bool is very not true" 1>&2 &&
echo "This is a different line of text." > '$out_file1' &&
sh -c "exit 2"
#end if
#if $failbool
; sh -c "exit 127"
#end if
</command>
]]></command>
<inputs>
<param name="thebool" type="boolean" label="The boolean property" />
<param name="failbool" type="boolean" label="The failure property" checked="false" />
</inputs>
<outputs>
<data name="out_file1" />
<collection name="list_output" type="list" label="A list output">
<data name="one" format="txt" />
<data name="two" format="txt" />
</collection>
</outputs>
<stdio>
<exit_code range="127" level="fatal" description="Failing exit code." />
Expand Down

0 comments on commit 9fdf0a6

Please sign in to comment.