From ccf1efe10f17eb13178d45e1d77b6a5e7bd7c9ea Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 21 Feb 2018 21:33:00 -0500 Subject: [PATCH] Add a native Galaxy workflow (.ga) testing test. --- tests/data/wf2-job.yml | 6 +++ tests/data/wf2-test.yml | 5 +++ tests/data/wf2.ga | 90 +++++++++++++++++++++++++++++++++++++++++ tests/test_cmd_test.py | 26 +++++++++++- 4 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 tests/data/wf2-job.yml create mode 100644 tests/data/wf2-test.yml create mode 100644 tests/data/wf2.ga diff --git a/tests/data/wf2-job.yml b/tests/data/wf2-job.yml new file mode 100644 index 000000000..d2262c767 --- /dev/null +++ b/tests/data/wf2-job.yml @@ -0,0 +1,6 @@ +WorkflowInput1: + class: File + path: hello.txt +WorkflowInput2: + class: File + path: hello.txt diff --git a/tests/data/wf2-test.yml b/tests/data/wf2-test.yml new file mode 100644 index 000000000..426a2f26c --- /dev/null +++ b/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" diff --git a/tests/data/wf2.ga b/tests/data/wf2.ga new file mode 100644 index 000000000..804d56e0b --- /dev/null +++ b/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": [] + } + } +} \ No newline at end of file diff --git a/tests/test_cmd_test.py b/tests/test_cmd_test.py index 0226a8e93..f999d8140 100644 --- a/tests/test_cmd_test.py +++ b/tests/test_cmd_test.py @@ -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") @@ -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):