Skip to content

Commit 5ccf977

Browse files
committed
Verify collection is correctly consumed
1 parent d679127 commit 5ccf977

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

lib/galaxy_test/api/test_tools.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,27 @@ def test_dynamic_tool_shell_command(self):
18271827
output_content = self.dataset_populator.get_history_dataset_content(history_id)
18281828
assert output_content == "abc\n"
18291829

1830+
@skip_without_tool("cat_multiple_user_defined")
1831+
def test_collection_into_multiple_true(self):
1832+
with (
1833+
self.dataset_populator.test_history() as history_id,
1834+
self.dataset_populator.user_tool_execute_permissions(),
1835+
):
1836+
hdca = self.dataset_collection_populator.create_list_in_history(history_id, wait=True).json()[
1837+
"output_collections"
1838+
][0]
1839+
response = self._run(
1840+
"cat_multiple_user_defined",
1841+
history_id,
1842+
{"datasets": {"values": [{"src": "hdca", "id": hdca["id"]}]}},
1843+
assert_ok=True,
1844+
wait_for_job=True,
1845+
)
1846+
output_content = self.dataset_populator.get_history_dataset_content(
1847+
history_id, response["outputs"][0]["id"]
1848+
)
1849+
assert output_content == "TestData123\n" * 3
1850+
18301851
def test_show_dynamic_tools(self):
18311852
# Create tool.
18321853
original_list = self.dataset_populator.list_dynamic_tools()
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class: GalaxyUserTool
2+
id: cat_multiple_user_defined
3+
version: "0.1"
4+
name: Concatenate Multiple Files
5+
description: tail-to-head
6+
container: busybox
7+
shell_command: |
8+
cat $(inputs.datasets.map((input) => `'${input.path}'`).join(' ')) > output.txt
9+
inputs:
10+
- name: datasets
11+
type: data
12+
multiple: true
13+
outputs:
14+
- name: output1
15+
type: data
16+
format_source: datasets
17+
from_work_dir: output.txt
18+
tests:
19+
- inputs:
20+
datasets:
21+
- simple_line.txt
22+
- simple_line_alternative.txt
23+
outputs:
24+
output1:
25+
asserts:
26+
- has_line:
27+
line: This is a different line of text.
28+
- has_line:
29+
line: This is a line of text.

test/functional/tools/sample_tool_conf.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@
306306
<tool file="explicit_singularity_container.xml"/>
307307
<tool file="simple_constructs.yml" />
308308
<tool file="cat_user_defined.yml" />
309+
<tool file="cat_multiple_user_defined.yml" />
309310
<tool file="configfile_user_defined.yml" />
310311
<tool file="from_work_dir_glob.xml" />
311312

0 commit comments

Comments
 (0)