Skip to content

Commit 82a6bdc

Browse files
committed
Add regression test for #21139
1 parent 7fda731 commit 82a6bdc

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

lib/galaxy_test/api/test_workflows.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5639,6 +5639,54 @@ def test_run_with_default_file_in_step_inline(self):
56395639
content = self.dataset_populator.get_history_dataset_content(history_id)
56405640
assert "chr1" in content
56415641

5642+
def test_conditional_skip_on_database_operation_collection_output(self):
5643+
with self.dataset_populator.test_history() as history_id:
5644+
summary = self._run_workflow(
5645+
"""
5646+
class: GalaxyWorkflow
5647+
inputs:
5648+
input_collection: collection
5649+
steps:
5650+
filter:
5651+
tool_id: __FILTER_FAILED_DATASETS__
5652+
in:
5653+
input: input_collection
5654+
when: $(false)
5655+
""",
5656+
test_data="""
5657+
input_collection:
5658+
collection_type: list
5659+
elements:
5660+
- identifier: el1
5661+
content: "test content 1"
5662+
""",
5663+
history_id=history_id,
5664+
wait=True,
5665+
assert_ok=True,
5666+
)
5667+
invocation = self.workflow_populator.get_invocation(summary.invocation_id, step_details=True)
5668+
5669+
input_hdca_details = self.dataset_populator.get_history_collection_details(
5670+
history_id, content_id=invocation["inputs"]["0"]["id"]
5671+
)
5672+
input_hda = input_hdca_details["elements"][0]["object"]
5673+
filter_content = self.dataset_populator.get_history_dataset_content(
5674+
history_id=history_id, content_id=input_hda["id"]
5675+
)
5676+
assert "test content 1" in filter_content, f"Expected 'test content 1' in input, got: {filter_content}"
5677+
5678+
# Get the filter step output
5679+
filter_step = [s for s in invocation["steps"] if s["workflow_step_label"] == "filter"][0]
5680+
filter_output_id = filter_step["output_collections"]["output"]["id"]
5681+
hdca = self.dataset_populator.get_history_collection_details(history_id, content_id=filter_output_id)
5682+
hda = hdca["elements"][0]["object"]
5683+
5684+
# Assert that the filter output dataset contains the string 'null'
5685+
filter_content = self.dataset_populator.get_history_dataset_content(
5686+
history_id=history_id, content_id=hda["id"]
5687+
)
5688+
assert "null" in filter_content, f"Expected 'null' in filter output, got: {filter_content}"
5689+
56425690
def test_conditional_flat_crossproduct_subworkflow(self):
56435691
parent = yaml.safe_load(
56445692
"""

0 commit comments

Comments
 (0)