Skip to content

Commit

Permalink
Add a native Galaxy workflow (.ga) testing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Feb 23, 2018
1 parent 63770ac commit ccf1efe
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/data/wf2-job.yml
@@ -0,0 +1,6 @@
WorkflowInput1:
class: File
path: hello.txt
WorkflowInput2:
class: File
path: hello.txt
5 changes: 5 additions & 0 deletions tests/data/wf2-test.yml
@@ -0,0 +1,5 @@
- doc: Simple concat workflow test
job: wf2-job.yml
outputs:
wf_output_1:
checksum: "sha1$a0b65939670bc2c010f4d5d6a0b3e4e4590fb92b"
90 changes: 90 additions & 0 deletions tests/data/wf2.ga
@@ -0,0 +1,90 @@
{
"a_galaxy_workflow": "true",
"annotation": "simple workflow",
"format-version": "0.1",
"name": "TestWorkflow1",
"steps": {
"0": {
"annotation": "input1 description",
"id": 0,
"input_connections": {},
"inputs": [
{
"description": "input1 description",
"name": "WorkflowInput1"
}
],
"name": "Input dataset",
"outputs": [],
"position": {
"left": 199.55555772781372,
"top": 200.66666460037231
},
"tool_errors": null,
"tool_id": null,
"tool_state": "{\"name\": \"WorkflowInput1\"}",
"tool_version": null,
"type": "data_input",
"user_outputs": []
},
"1": {
"annotation": "",
"id": 1,
"input_connections": {},
"inputs": [
{
"description": "",
"name": "WorkflowInput2"
}
],
"name": "Input dataset",
"outputs": [],
"position": {
"left": 206.22221422195435,
"top": 327.33335161209106
},
"tool_errors": null,
"tool_id": null,
"tool_state": "{\"name\": \"WorkflowInput2\"}",
"tool_version": null,
"type": "data_input",
"user_outputs": []
},
"2": {
"annotation": "",
"id": 2,
"input_connections": {
"input1": {
"id": 0,
"output_name": "output"
},
"queries_0|input2": {
"id": 1,
"output_name": "output"
}
},
"inputs": [],
"name": "Concatenate datasets",
"outputs": [
{
"name": "out_file1",
"type": "input"
}
],
"position": {
"left": 419.33335876464844,
"top": 200.44446563720703
},
"workflow_outputs": [
{"output_name": "out_file1", "label": "wf_output_1"}
],
"post_job_actions": {},
"tool_errors": null,
"tool_id": "cat",
"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}]\"}",
"tool_version": "1.0.0",
"type": "tool",
"user_outputs": []
}
}
}
26 changes: 24 additions & 2 deletions tests/test_cmd_test.py
Expand Up @@ -16,8 +16,8 @@ class CmdTestTestCase(CliTestCase):
"""Integration tests for the ``test`` command."""

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_workflow_test_simple(self):
"""Test testing a simple workflow with Galaxy."""
def test_workflow_test_simple_yaml(self):
"""Test testing a simple YAML workflow with Galaxy."""
with self._isolate():
random_lines = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "randomlines.xml")
cat = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "cat.xml")
Expand All @@ -34,6 +34,28 @@ def test_workflow_test_simple(self):
]
self._check_exit_code(test_command, exit_code=0)

@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
def test_workflow_test_simple_ga(self):
"""Test testing a simple GA workflow with Galaxy."""
with self._isolate():
cat = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "cat.xml")
test_artifact = os.path.join(TEST_DATA_DIR, "wf2.ga")
test_command = [
"--verbose",
"test"
]
test_command = self.append_profile_argument_if_needed(test_command)
test_command += [
"--extra_tools", cat,
test_artifact,
]
# try:
self._check_exit_code(test_command, exit_code=0)
# except Exception:
# with open(os.path.join(f, "tool_test_output.json"), "r") as o:
# print(o.read())
# raise

@skip_unless_python_2_7()
@skip_if_environ("PLANEMO_SKIP_CWLTOOL_TESTS")
def test_cwltool_tool_test(self):
Expand Down

0 comments on commit ccf1efe

Please sign in to comment.