Skip to content

Commit

Permalink
Migrate workflow flatten test to workflow test framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jul 29, 2024
1 parent eeafa48 commit efedd7c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
29 changes: 0 additions & 29 deletions lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2800,35 +2800,6 @@ def run_test(workflow_text):

run_test(NESTED_WORKFLOW_AUTO_LABELS_MODERN_SYNTAX)

@skip_without_tool("collection_paired_test")
def test_workflow_flatten(self):
with self.dataset_populator.test_history() as history_id:
self._run_jobs(
"""
class: GalaxyWorkflow
steps:
nested:
tool_id: collection_creates_dynamic_nested
state:
sleep_time: 0
foo: 'dummy'
flatten:
tool_id: '__FLATTEN__'
state:
input:
$link: nested/list_output
join_identifier: '-'
""",
test_data={},
history_id=history_id,
)
details = self.dataset_populator.get_history_collection_details(history_id, hid=14)
assert details["collection_type"] == "list"
elements = details["elements"]
identifiers = [e["element_identifier"] for e in elements]
assert len(identifiers) == 6
assert "oe1-ie1" in identifiers

@skip_without_tool("collection_paired_test")
def test_workflow_flatten_with_mapped_over_execution(self):
with self.dataset_populator.test_history() as history_id:
Expand Down
18 changes: 18 additions & 0 deletions lib/galaxy_test/workflow/flatten_collection.gxwf-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- doc: |
Test to verify collection flatten collection operation in the context of a workflow.
job: {}
outputs:
out:
elements:
'oe1-ie1':
asserts:
- that: has_text
text: "A"
'oe1-ie2':
asserts:
- that: has_text
text: "B"
'oe2-ie1':
asserts:
- that: has_text
text: "C"
17 changes: 17 additions & 0 deletions lib/galaxy_test/workflow/flatten_collection.gxwf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class: GalaxyWorkflow
inputs: {}
outputs:
out:
outputSource: flatten/output
steps:
nested:
tool_id: collection_creates_dynamic_nested
state:
sleep_time: 0
foo: 'dummy'
flatten:
tool_id: '__FLATTEN__'
state:
join_identifier: '-'
in:
input: nested/list_output

0 comments on commit efedd7c

Please sign in to comment.