Skip to content

Commit e6efb0f

Browse files
authored
Merge pull request #843 from jmchilton/collection_inputs
Tests for collection inputs to workflows.
2 parents a121c3e + d2694fc commit e6efb0f

5 files changed

Lines changed: 80 additions & 2 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ virtualenv
1313
lxml
1414
gxformat2>=0.2.0
1515
ephemeris>=0.8
16-
galaxy-lib>=18.5.12
16+
galaxy-lib>=18.5.13
1717
html5lib>=0.9999999,!=0.99999999,!=0.999999999,!=1.0b10,!=1.0b09
1818
cwltool==1.0.20180508202931

tests/data/cat_list.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<tool id="cat_list" name="Concatenate multiple datasets (for test workflows)">
2+
<description>tail-to-head</description>
3+
<command>
4+
cat #for $q in $input1# $q #end for# > $out_file1
5+
</command>
6+
<inputs>
7+
<param name="input1" type="data" label="Concatenate Dataset" multiple="true" />
8+
</inputs>
9+
<outputs>
10+
<data name="out_file1" format="input" metadata_source="input1"/>
11+
</outputs>
12+
<tests>
13+
</tests>
14+
<help>
15+
</help>
16+
</tool>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- doc: Test Explicit Collection Creation.
2+
job:
3+
input1:
4+
class: Collection
5+
collection_type: list
6+
elements:
7+
- identifier: el1
8+
class: File
9+
path: hello.txt
10+
outputs:
11+
wf_output_1:
12+
checksum: "sha1$a0b65939670bc2c010f4d5d6a0b3e4e4590fb92b"
13+
- doc: Test CWL-style list inputs.
14+
job:
15+
input1:
16+
- class: File
17+
path: hello.txt
18+
outputs:
19+
wf_output_1:
20+
checksum: "sha1$a0b65939670bc2c010f4d5d6a0b3e4e4590fb92b"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class: GalaxyWorkflow
2+
name: "Test Workflow - Collection Inputs"
3+
4+
inputs:
5+
- id: input1
6+
type: collection
7+
collection_type: list
8+
9+
outputs:
10+
- id: wf_output_1
11+
source: first_cat#out_file1
12+
13+
steps:
14+
- tool_id: cat_list
15+
label: first_cat
16+
state:
17+
input1:
18+
$link: input1

tests/test_cmd_test.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_workflow_test_simple_ga(self):
6262

6363
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
6464
def test_workflow_test_distro_tool(self):
65-
"""Test testing a simple GA workflow with Galaxy."""
65+
"""Test testing a workflow that uses distro tools."""
6666
with self._isolate():
6767
test_artifact = os.path.join(TEST_DATA_DIR, "wf4-distro-tools.gxwf.yml")
6868
test_command = [
@@ -82,6 +82,30 @@ def test_workflow_test_distro_tool(self):
8282
# print(o.read())
8383
# raise
8484

85+
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
86+
def test_workflow_test_collection_inputs(self):
87+
"""Test testing a workflow with collection inputs Galaxy."""
88+
with self._isolate():
89+
test_artifact = os.path.join(TEST_DATA_DIR, "wf5-collection-input.gxwf.yml")
90+
cat_list = os.path.join(TEST_DATA_DIR, "cat_list.xml")
91+
test_command = [
92+
"--verbose",
93+
"test"
94+
]
95+
test_command = self.append_profile_argument_if_needed(test_command)
96+
test_command += [
97+
"--no_dependency_resolution",
98+
"--galaxy_branch", "release_18.01", # Much better workflow output detection than master for now (pre-release of 18.01)
99+
"--extra_tools", cat_list,
100+
test_artifact,
101+
]
102+
# try:
103+
self._check_exit_code(test_command, exit_code=0)
104+
# except Exception:
105+
# with open(os.path.join(f, "tool_test_output.json"), "r") as o:
106+
# print(o.read())
107+
# raise
108+
85109
@skip_if_environ("PLANEMO_SKIP_CWLTOOL_TESTS")
86110
def test_cwltool_tool_test(self):
87111
"""Test testing a CWL tool with cwltool."""

0 commit comments

Comments
 (0)