Skip to content

Commit

Permalink
Migrate a workflow test case for output renaming to workflow test fra…
Browse files Browse the repository at this point in the history
…mework.
  • Loading branch information
jmchilton committed Jul 22, 2024
1 parent 5dde290 commit 73455b4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 46 deletions.
46 changes: 0 additions & 46 deletions lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
20 changes: 20 additions & 0 deletions lib/galaxy_test/workflow/rename_based_on_input_collection.gxwf.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 73455b4

Please sign in to comment.