diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index 933a51cef75..f9a8af32044 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -166,6 +166,12 @@ class BaseWorkflowsApiTestCase( api.ApiTestCase, ImporterGalaxyInterface ): return invocation_details def _run_jobs( self, has_workflow, history_id=None, wait=True, source_type=None, jobs_descriptions=None ): + def read_test_data(test_dict): + test_data_resolver = TestDataResolver() + filename = test_data_resolver.get_filename(test_dict["value"]) + content = open(filename, "r").read() + return content + if history_id is None: history_id = self.history_id workflow_id = self._upload_yaml_workflow( @@ -188,7 +194,11 @@ class BaseWorkflowsApiTestCase( api.ApiTestCase, ImporterGalaxyInterface ): elements = [] for element_data in elements_data: identifier = element_data[ "identifier" ] - content = element_data["content"] + input_type = element_data.get("type", "raw") + if input_type == "File": + content = read_test_data(element_data) + else: + content = element_data["content"] elements.append( ( identifier, content ) ) # TODO: make this collection_type collection_type = value["type"] @@ -204,9 +214,7 @@ class BaseWorkflowsApiTestCase( api.ApiTestCase, ImporterGalaxyInterface ): elif is_dict and "type" in value: input_type = value["type"] if input_type == "File": - test_data_resolver = TestDataResolver() - filename = test_data_resolver.get_filename(value["value"]) - content = open(filename, "r").read() + content = read_test_data(value) hda = self.dataset_populator.new_dataset( history_id, content=content ) label_map[key] = self._ds_entry( hda ) has_uploads = True @@ -741,6 +749,48 @@ steps: content = self.dataset_populator.get_history_dataset_content( history_id, hid=7 ) self.assertEquals(content.strip(), "samp1\t10.0\nsamp2\t20.0") + @skip_without_tool( "mapper" ) + @skip_without_tool( "pileup" ) + def test_workflow_metadata_validation_0( self ): + # Testing regression of + # https://github.com/galaxyproject/galaxy/issues/1514 + history_id = self.dataset_populator.new_history() + self._run_jobs(""" +class: GalaxyWorkflow +steps: + - label: input_fastqs + type: input_collection + - label: reference + type: input + - label: map_over_mapper + tool_id: mapper + state: + input1: + $link: input_fastqs + reference: + $link: reference + - label: pileup + tool_id: pileup + state: + input1: + $link: map_over_mapper#out_file1 + reference: + $link: reference +test_data: + input_fastqs: + type: list + elements: + - identifier: samp1 + value: 1.fastq + type: File + - identifier: samp2 + value: 1.fastq + type: File + reference: + value: 1.fasta + type: File +""", history_id=history_id) + def test_run_subworkflow_simple( self ): history_id = self.dataset_populator.new_history() self._run_jobs(SIMPLE_NESTED_WORKFLOW_YAML, history_id=history_id) diff --git a/test/functional/tools/for_workflows/1.bam b/test/functional/tools/for_workflows/1.bam new file mode 120000 index 00000000000..27a1dd550ca --- /dev/null +++ b/test/functional/tools/for_workflows/1.bam @@ -0,0 +1 @@ +../../../../test-data/1.bam \ No newline at end of file diff --git a/test/functional/tools/for_workflows/mapper.xml b/test/functional/tools/for_workflows/mapper.xml new file mode 100644 index 00000000000..505e517c7db --- /dev/null +++ b/test/functional/tools/for_workflows/mapper.xml @@ -0,0 +1,16 @@ + + + cp $__tool_directory__/1.bam $out_file1 + + + + + + + + + + + + + diff --git a/test/functional/tools/for_workflows/pileup.xml b/test/functional/tools/for_workflows/pileup.xml new file mode 100644 index 00000000000..df6c6af4149 --- /dev/null +++ b/test/functional/tools/for_workflows/pileup.xml @@ -0,0 +1,18 @@ + + + printf "Summary" > $out_file1 + + + + + + + + + + + + + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 3d7be1d164b..553c704f15c 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -89,6 +89,8 @@ + +