Skip to content

Commit

Permalink
Merge pull request #6951 from bernt-matthias/topic/test-colouts-backport
Browse files Browse the repository at this point in the history
[18.09] Backport: tests need to count data sets and collections
  • Loading branch information
nsoranzo committed Nov 5, 2018
2 parents 3d91738 + 9b42032 commit 2deb302
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tools/verify/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def _verify_outputs(testdef, history, jobs, tool_id, data_list, data_collection_
maxseconds = testdef.maxseconds
if testdef.num_outputs is not None:
expected = testdef.num_outputs
actual = len(data_list)
actual = len(data_list) + len(data_collection_list)
if expected != actual:
message_template = "Incorrect number of outputs - expected %d, found %s."
message = message_template % (expected, actual)
Expand Down
1 change: 1 addition & 0 deletions test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2200,6 +2200,7 @@ def test_optional_workflow_output(self):
state:
produce_out_1: False
filter_text_1: '1'
produce_collection: False
test_data: {}
""", history_id=history_id, wait=False)
self.wait_for_invocation_and_jobs(history_id, run_object.workflow_id, run_object.invocation_id)
Expand Down
20 changes: 18 additions & 2 deletions test/functional/tools/output_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<inputs>
<param name="produce_out_1" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Do Filter 1" />
<param name="filter_text_1" type="text" value="1" />
<param name="produce_collection" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Collection Filter" />
</inputs>
<outputs>
<data format="txt" from_work_dir="1" name="out_1">
Expand All @@ -19,8 +20,11 @@
<!-- Must pass all filters... -->
<filter>filter_text_1 == "foo"</filter>
</data>
<data format="txt" from_work_dir="3" name="out_3">
</data>
<data format="txt" from_work_dir="3" name="out_3"/>
<collection name="list_output" type="list" label="List">
<discover_datasets pattern="(?P&lt;identifier_0&gt;[45])" ext="txt" visible="true" />
<filter>produce_collection is True</filter>
</collection>
</outputs>
<tests>
<test expect_num_outputs="3">
Expand All @@ -41,6 +45,18 @@
<param name="filter_text_1" value="not_foo_or_bar" />
<output name="out_3"><assert_contents><has_line line="test" /></assert_contents></output>
</test>
<test expect_num_outputs="4">
<param name="produce_out_1" value="true" />
<param name="filter_text_1" value="foo" />
<param name="produce_collection" value="true" />
<output name="out_1"><assert_contents><has_line line="test" /></assert_contents></output>
<output name="out_2"><assert_contents><has_line line="test" /></assert_contents></output>
<output name="out_3"><assert_contents><has_line line="test" /></assert_contents></output>
<output_collection name="list_output" type="list">
<element name="4"><assert_contents><has_line line="test" /></assert_contents></element>
<element name="5"><assert_contents><has_line line="test" /></assert_contents></element>
</output_collection>
</test>
</tests>
</tool>

0 comments on commit 2deb302

Please sign in to comment.