Skip to content

Commit

Permalink
Replace API tests with workflow tests for various parameter replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jul 22, 2024
1 parent 7c94e5b commit 28425f5
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 48 deletions.
48 changes: 0 additions & 48 deletions lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2741,54 +2741,6 @@ def test_run_subworkflow_replacement_parameters(self):
details = self.dataset_populator.get_history_dataset_details(history_id)
assert details["name"] == "moocow suffix"

@skip_without_tool("create_2")
def test_placements_from_text_inputs(self):
with self.dataset_populator.test_history() as history_id:
run_def = """
class: GalaxyWorkflow
inputs: []
steps:
create_2:
tool_id: create_2
state:
sleep_time: 0
outputs:
out_file1:
rename: "${replaceme} name"
out_file2:
rename: "${replaceme} name 2"
test_data:
replacement_parameters:
replaceme: moocow
"""

self._run_jobs(run_def, history_id=history_id)
details = self.dataset_populator.get_history_dataset_details(history_id)
assert details["name"] == "moocow name 2"

run_def = """
class: GalaxyWorkflow
inputs:
replaceme: text
steps:
create_2:
tool_id: create_2
state:
sleep_time: 0
outputs:
out_file1:
rename: "${replaceme} name"
out_file2:
rename: "${replaceme} name 2"
test_data:
replaceme:
value: moocow
type: raw
"""
self._run_jobs(run_def, history_id=history_id)
details = self.dataset_populator.get_history_dataset_details(history_id)
assert details["name"] == "moocow name 2", details["name"]

def test_placements_from_text_inputs_nested(self):
with self.dataset_populator.test_history() as history_id:
run_def = """
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- doc: |
Test to verify legacy behavior of implicit runtime parameters continues to function correctly.
job:
replacement_parameters:
replaceme: moocow
outputs:
out1:
metadata:
name: 'moocow name'
out2:
metadata:
name: 'moocow name 2'
17 changes: 17 additions & 0 deletions lib/galaxy_test/workflow/replacement_parameters_legacy.gxwf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class: GalaxyWorkflow
inputs: {}
outputs:
out1:
outputSource: create_2/out_file1
out2:
outputSource: create_2/out_file2
steps:
create_2:
tool_id: create_2
state:
sleep_time: 0
outputs:
out_file1:
rename: "${replaceme} name"
out_file2:
rename: "${replaceme} name 2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- doc: |
Test to verify text parameters can be implicitly used as replacement parameters in subworkflows if they are connected up.
job:
replacemeouter:
value: moocow
type: raw
outputs:
out1:
metadata:
name: 'moocow name'
out2:
metadata:
name: 'moocow name 2'
31 changes: 31 additions & 0 deletions lib/galaxy_test/workflow/replacement_parameters_nested.gxwf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class: GalaxyWorkflow
inputs:
replacemeouter: text
outputs:
out1:
outputSource: nested_workflow/workflow_output_1
out2:
outputSource: nested_workflow/workflow_output_2
steps:
nested_workflow:
run:
class: GalaxyWorkflow
inputs:
replacemeinner: text
outputs:
workflow_output_1:
outputSource: create_2/out_file1
workflow_output_2:
outputSource: create_2/out_file2
steps:
create_2:
tool_id: create_2
state:
sleep_time: 0
outputs:
out_file1:
rename: "${replacemeinner} name"
out_file2:
rename: "${replacemeinner} name 2"
in:
replacemeinner: replacemeouter
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- doc: |
Test to verify text parameters can be implicitly used as replacement parameters in workflow step PJAs.
job:
replaceme:
value: moocow
type: raw
outputs:
out1:
metadata:
name: 'moocow name'
out2:
metadata:
name: 'moocow name 2'
18 changes: 18 additions & 0 deletions lib/galaxy_test/workflow/replacement_parameters_text.gxwf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class: GalaxyWorkflow
inputs:
replaceme: text
outputs:
out1:
outputSource: create_2/out_file1
out2:
outputSource: create_2/out_file2
steps:
create_2:
tool_id: create_2
state:
sleep_time: 0
outputs:
out_file1:
rename: "${replaceme} name"
out_file2:
rename: "${replaceme} name 2"

0 comments on commit 28425f5

Please sign in to comment.