Skip to content

Commit ccf1efe

Browse files
committed
Add a native Galaxy workflow (.ga) testing test.
1 parent 63770ac commit ccf1efe

4 files changed

Lines changed: 125 additions & 2 deletions

File tree

tests/data/wf2-job.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WorkflowInput1:
2+
class: File
3+
path: hello.txt
4+
WorkflowInput2:
5+
class: File
6+
path: hello.txt

tests/data/wf2-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- doc: Simple concat workflow test
2+
job: wf2-job.yml
3+
outputs:
4+
wf_output_1:
5+
checksum: "sha1$a0b65939670bc2c010f4d5d6a0b3e4e4590fb92b"

tests/data/wf2.ga

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"a_galaxy_workflow": "true",
3+
"annotation": "simple workflow",
4+
"format-version": "0.1",
5+
"name": "TestWorkflow1",
6+
"steps": {
7+
"0": {
8+
"annotation": "input1 description",
9+
"id": 0,
10+
"input_connections": {},
11+
"inputs": [
12+
{
13+
"description": "input1 description",
14+
"name": "WorkflowInput1"
15+
}
16+
],
17+
"name": "Input dataset",
18+
"outputs": [],
19+
"position": {
20+
"left": 199.55555772781372,
21+
"top": 200.66666460037231
22+
},
23+
"tool_errors": null,
24+
"tool_id": null,
25+
"tool_state": "{\"name\": \"WorkflowInput1\"}",
26+
"tool_version": null,
27+
"type": "data_input",
28+
"user_outputs": []
29+
},
30+
"1": {
31+
"annotation": "",
32+
"id": 1,
33+
"input_connections": {},
34+
"inputs": [
35+
{
36+
"description": "",
37+
"name": "WorkflowInput2"
38+
}
39+
],
40+
"name": "Input dataset",
41+
"outputs": [],
42+
"position": {
43+
"left": 206.22221422195435,
44+
"top": 327.33335161209106
45+
},
46+
"tool_errors": null,
47+
"tool_id": null,
48+
"tool_state": "{\"name\": \"WorkflowInput2\"}",
49+
"tool_version": null,
50+
"type": "data_input",
51+
"user_outputs": []
52+
},
53+
"2": {
54+
"annotation": "",
55+
"id": 2,
56+
"input_connections": {
57+
"input1": {
58+
"id": 0,
59+
"output_name": "output"
60+
},
61+
"queries_0|input2": {
62+
"id": 1,
63+
"output_name": "output"
64+
}
65+
},
66+
"inputs": [],
67+
"name": "Concatenate datasets",
68+
"outputs": [
69+
{
70+
"name": "out_file1",
71+
"type": "input"
72+
}
73+
],
74+
"position": {
75+
"left": 419.33335876464844,
76+
"top": 200.44446563720703
77+
},
78+
"workflow_outputs": [
79+
{"output_name": "out_file1", "label": "wf_output_1"}
80+
],
81+
"post_job_actions": {},
82+
"tool_errors": null,
83+
"tool_id": "cat",
84+
"tool_state": "{\"__page__\": 0, \"__rerun_remap_job_id__\": null, \"input1\": \"null\", \"chromInfo\": \"\\\"/home/john/workspace/galaxy-central/tool-data/shared/ucsc/chrom/?.len\\\"\", \"queries\": \"[{\\\"input2\\\": null, \\\"__index__\\\": 0}]\"}",
85+
"tool_version": "1.0.0",
86+
"type": "tool",
87+
"user_outputs": []
88+
}
89+
}
90+
}

tests/test_cmd_test.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class CmdTestTestCase(CliTestCase):
1616
"""Integration tests for the ``test`` command."""
1717

1818
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
19-
def test_workflow_test_simple(self):
20-
"""Test testing a simple workflow with Galaxy."""
19+
def test_workflow_test_simple_yaml(self):
20+
"""Test testing a simple YAML workflow with Galaxy."""
2121
with self._isolate():
2222
random_lines = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "randomlines.xml")
2323
cat = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "cat.xml")
@@ -34,6 +34,28 @@ def test_workflow_test_simple(self):
3434
]
3535
self._check_exit_code(test_command, exit_code=0)
3636

37+
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
38+
def test_workflow_test_simple_ga(self):
39+
"""Test testing a simple GA workflow with Galaxy."""
40+
with self._isolate():
41+
cat = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "cat.xml")
42+
test_artifact = os.path.join(TEST_DATA_DIR, "wf2.ga")
43+
test_command = [
44+
"--verbose",
45+
"test"
46+
]
47+
test_command = self.append_profile_argument_if_needed(test_command)
48+
test_command += [
49+
"--extra_tools", cat,
50+
test_artifact,
51+
]
52+
# try:
53+
self._check_exit_code(test_command, exit_code=0)
54+
# except Exception:
55+
# with open(os.path.join(f, "tool_test_output.json"), "r") as o:
56+
# print(o.read())
57+
# raise
58+
3759
@skip_unless_python_2_7()
3860
@skip_if_environ("PLANEMO_SKIP_CWLTOOL_TESTS")
3961
def test_cwltool_tool_test(self):

0 commit comments

Comments
 (0)