From 73455b48f60455c4acc42ced7f41efff06c9552c Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sat, 13 Jul 2024 17:47:39 -0400 Subject: [PATCH] Migrate a workflow test case for output renaming to workflow test framework. --- lib/galaxy_test/api/test_workflows.py | 46 ------------------- ...e_based_on_input_collection.gxwf-tests.yml | 22 +++++++++ .../rename_based_on_input_collection.gxwf.yml | 20 ++++++++ 3 files changed, 42 insertions(+), 46 deletions(-) create mode 100644 lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf-tests.yml create mode 100644 lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf.yml diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index d2e5f9d441a6..7c144ebadc81 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -6249,52 +6249,6 @@ def test_run_rename_based_on_input_conditional_legacy_pja_reference(self): name = content["name"] assert name == "fastq1 suffix", name - @skip_without_tool("mapper2") - def test_run_rename_based_on_input_collection(self): - with self.dataset_populator.test_history() as history_id: - self._run_jobs( - """ -class: GalaxyWorkflow -inputs: - fasta_input: data - fastq_inputs: data -steps: - mapping: - tool_id: mapper2 - state: - fastq_input: - fastq_input_selector: paired_collection - fastq_input1: - $link: fastq_inputs - reference: - $link: fasta_input - outputs: - out_file1: - rename: "#{fastq_input.fastq_input1 | basename} suffix" -""", - test_data=""" -fasta_input: - value: 1.fasta - type: File - name: fasta1 - file_type: fasta -fastq_inputs: - collection_type: list - name: the_dataset_pair - elements: - - identifier: forward - value: 1.fastq - type: File - - identifier: reverse - value: 1.fastq - type: File -""", - history_id=history_id, - ) - content = self.dataset_populator.get_history_dataset_details(history_id, wait=True, assert_ok=True) - name = content["name"] - assert name == "the_dataset_pair suffix", name - @skip_without_tool("collection_creates_pair") def test_run_hide_on_collection_output(self): with self.dataset_populator.test_history() as history_id: diff --git a/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf-tests.yml b/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf-tests.yml new file mode 100644 index 000000000000..a6b357635316 --- /dev/null +++ b/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf-tests.yml @@ -0,0 +1,22 @@ +- doc: | + Test output dataset renaming when the target basename is based on an input collection. + job: + fasta_input: + value: 1.fasta + type: File + name: fasta1 + file_type: fasta + fastq_inputs: + collection_type: list + name: the_dataset_pair + elements: + - identifier: forward + value: 1.fastq + type: File + - identifier: reverse + value: 1.fastq + type: File + outputs: + output: + metadata: + name: 'the_dataset_pair suffix' diff --git a/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf.yml b/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf.yml new file mode 100644 index 000000000000..0d6a19abfdd3 --- /dev/null +++ b/lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf.yml @@ -0,0 +1,20 @@ +class: GalaxyWorkflow +inputs: + fasta_input: data + fastq_inputs: data +outputs: + output: + outputSource: mapping/out_file1 +steps: + mapping: + tool_id: mapper2 + state: + fastq_input: + fastq_input_selector: paired_collection + fastq_input1: + $link: fastq_inputs + reference: + $link: fasta_input + outputs: + out_file1: + rename: "#{fastq_input.fastq_input1 | basename} suffix"