From 647ba8531acdf576cfefea71bc7bb73a89ed7a0a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 6 Jun 2018 18:38:49 +0200 Subject: [PATCH] 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. --- test/api/test_workflows.py | 20 +++++++++++++++++++ .../tools/collection_type_source_map_over.xml | 16 +++++++++++++++ test/functional/tools/samples_tool_conf.xml | 1 + 3 files changed, 37 insertions(+) create mode 100644 test/functional/tools/collection_type_source_map_over.xml diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index 47067be026e..ccc046a4f55 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -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") diff --git a/test/functional/tools/collection_type_source_map_over.xml b/test/functional/tools/collection_type_source_map_over.xml new file mode 100644 index 00000000000..cf008421275 --- /dev/null +++ b/test/functional/tools/collection_type_source_map_over.xml @@ -0,0 +1,16 @@ + + + mkdir output; + #for $key in $input_collect.keys()# + cat "$input_collect[$key]" >> output/"$key"; + #end for# + + + + + + + + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 116b3ac34a0..97e6c48bd74 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -125,6 +125,7 @@ +