Add test tool and workflow for mapping over with mapping output

This doesn't quite work because of the dynamic output collection,
which fails with:

```
galaxy.tools.parameters.output_collect DEBUG 2018-06-06 18:40:38,784 (3) Add dynamic collection datasets to history for output [reverse] (171.970 ms)
galaxy.tools.parameters.output_collect ERROR 2018-06-06 18:40:38,839 Problem gathering output collection.
Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/lib/galaxy/tools/parameters/output_collect.py", line 340, in collect_dynamic_outputs
    collection_builder.populate()
  File "/Users/mvandenb/src/galaxy/lib/galaxy/dataset_collections/builder.py", line 88, in populate
    elements = self.build_elements()
  File "/Users/mvandenb/src/galaxy/lib/galaxy/dataset_collections/builder.py", line 59, in build_elements
    new_elements[identifier] = element.build()
AttributeError: 'HistoryDatasetAssociation' object has no attribute 'build'
```

This seems to happen because the inner collection is wrongly detected as
nested. In general I doubt that mapping over colleciton output works
with dynamically discovered output collections.
This commit is contained in:
mvdbeek
2018-06-20 09:54:40 -04:00
committed by John Chilton
parent f5aec1cdf1
commit 647ba8531a
3 changed files with 37 additions and 0 deletions
+20
View File
@@ -1359,6 +1359,26 @@ test_data:
""", history_id=history_id, wait=True)
self.assertEqual("0\n", self.dataset_populator.get_history_dataset_content(history_id))
@skip_without_tool("collection_type_source_map_over")
def test_mapping_and_subcollection_mapping(self):
with self.dataset_populator.test_history() as history_id:
jobs_summary = self._run_jobs("""
class: GalaxyWorkflow
steps:
- label: text_input1
type: input_collection
- tool_id: collection_type_source_map_over
state:
input_collect:
$link: text_input1
test_data:
text_input1:
type: "list:paired"
""", history_id=history_id)
hdca = self.dataset_populator.get_history_collection_details(history_id=jobs_summary.history_id, hid=5)
assert hdca['collection_type'] == 'list:paired'
assert len(hdca['elements'][0]['object']["elements"]) == 2
@skip_without_tool("empty_list")
@skip_without_tool("count_multi_file")
@skip_without_tool("random_lines1")
@@ -0,0 +1,16 @@
<tool id="collection_type_source_map_over" name="collection_type_source_map_over" version="0.1.0">
<command>
mkdir output;
#for $key in $input_collect.keys()#
cat "$input_collect[$key]" >> output/"$key";
#end for#
</command>
<inputs>
<param name="input_collect" type="data_collection" collection_type="list,paired" label="Input Collect" help="Input collection..." />
</inputs>
<outputs>
<collection name="list_output" type_source="input_collect" label="Duplicate List">
<discover_datasets pattern="__name__" directory="output" visible="true" />
</collection>
</outputs>
</tool>
@@ -125,6 +125,7 @@
<tool file="collection_creates_dynamic_nested_from_json_elements.xml" />
<tool file="collection_creates_dynamic_list_of_pairs.xml" />
<tool file="collection_type_source.xml" />
<tool file="collection_type_source_map_over.xml" />
<tool file="collection_creates_list_fail.xml" />
<tool file="collection_creates_dynamic_nested_fail.xml" />
<tool file="cheetah_casting.xml" />