Skip to content

Commit d5c480b

Browse files
authored
Merge pull request #770 from jmchilton/workflow_fixes_2
Add a native Galaxy workflow (.ga) testing test.
2 parents 63770ac + 08c073f commit d5c480b

7 files changed

Lines changed: 134 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- doc: Simple concat workflow test
2+
job: wf2-job.yml
3+
outputs:
4+
wf_output_1:
5+
checksum: 'sha1$7bd92c6cd84285e4fc7215d506bbabfe328acb8f'
6+

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_serve.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def _run(self, serve_args=[]):
109109
test_cmd = [
110110
"serve",
111111
"--install_galaxy",
112+
"--no_dependency_resolution",
112113
"--port",
113114
str(self._port),
114115
self._serve_artifact,

tests/test_cmd_test.py

Lines changed: 26 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")
@@ -28,12 +28,36 @@ def test_workflow_test_simple(self):
2828
]
2929
test_command = self.append_profile_argument_if_needed(test_command)
3030
test_command += [
31+
"--no_dependency_resolution",
3132
"--extra_tools", random_lines,
3233
"--extra_tools", cat,
3334
test_artifact,
3435
]
3536
self._check_exit_code(test_command, exit_code=0)
3637

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

tests/test_galaxy_serve.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_serve_daemon(self):
3232
install_galaxy=True,
3333
port=port,
3434
daemon=True,
35+
no_dependency_resolution=True,
3536
)
3637

3738
assert network_util.wait_net_service(
@@ -63,6 +64,7 @@ def test_serve_workflow(self):
6364
port=port,
6465
daemon=True,
6566
extra_tools=extra_tools,
67+
no_dependency_resolution=True,
6668
)
6769
user_gi = config.user_gi
6870
assert user_gi.tools.get_tools(tool_id="random_lines1")

tests/test_run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_run_gxtool_randomlines(self):
5959
test_cmd = [
6060
"--verbose",
6161
"run",
62+
"--no_dependency_resolution",
6263
tool_path,
6364
job_path,
6465
]
@@ -73,6 +74,7 @@ def test_run_cat(self):
7374
job_path = _cwl_file("cat-job.json")
7475
test_cmd = [
7576
"run",
77+
"--no_dependency_resolution",
7678
tool_path,
7779
job_path,
7880
]
@@ -88,6 +90,7 @@ def test_run_output_directory(self):
8890
test_cmd = [
8991
"--verbose",
9092
"run",
93+
"--no_dependency_resolution",
9194
"--output_directory",
9295
f,
9396
tool_path,

0 commit comments

Comments
 (0)