[ARVADOS] updated: 9c7b05def00a04c560e408eab65d3554a59fff94

Git user git at public.curoverse.com
Fri Apr 22 18:03:26 EDT 2016


Summary of changes:
 sdk/cwl/tests/order/empty_order.json       |  1 +
 sdk/cwl/tests/order/inputs_test_order.json |  9 ++++
 sdk/cwl/tests/test_submit.py               | 78 +++++++++++++++++++++++++++++-
 sdk/cwl/tests/wf/inputs_test.cwl           | 22 +++++++++
 4 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 sdk/cwl/tests/order/empty_order.json
 create mode 100644 sdk/cwl/tests/order/inputs_test_order.json
 create mode 100644 sdk/cwl/tests/wf/inputs_test.cwl

       via  9c7b05def00a04c560e408eab65d3554a59fff94 (commit)
      from  960e626794f8ea94759e5ef4d040df4f7eb68e4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9c7b05def00a04c560e408eab65d3554a59fff94
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Apr 22 18:03:24 2016 -0400

    8653: Add test cases for input types.

diff --git a/sdk/cwl/tests/order/empty_order.json b/sdk/cwl/tests/order/empty_order.json
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/sdk/cwl/tests/order/empty_order.json
@@ -0,0 +1 @@
+{}
diff --git a/sdk/cwl/tests/order/inputs_test_order.json b/sdk/cwl/tests/order/inputs_test_order.json
new file mode 100644
index 0000000..6eda14e
--- /dev/null
+++ b/sdk/cwl/tests/order/inputs_test_order.json
@@ -0,0 +1,9 @@
+{
+    "#fileInput": {
+        "class": "File",
+        "path": "../input/blorp.txt"
+    },
+    "#boolInput": true,
+    "#floatInput": 1.234,
+    "#optionalFloatInput": null
+}
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index 750eeae..12a1999 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -124,7 +124,7 @@ class TestSubmit(unittest.TestCase):
 
 class TestCreateTemplate(unittest.TestCase):
     @stubs
-    def test_create_pipeline_template(self, stubs):
+    def test_create(self, stubs):
         project_uuid = 'zzzzz-j7d0g-zzzzzzzzzzzzzzz'
 
         capture_stdout = cStringIO.StringIO()
@@ -152,3 +152,79 @@ class TestCreateTemplate(unittest.TestCase):
 
         self.assertEqual(capture_stdout.getvalue(),
                          json.dumps(stubs.expect_pipeline_template_uuid))
+
+    @stubs
+    def test_inputs_empty(self, stubs):
+        exited = arvados_cwl.main(
+            ["--create-template", "--no-wait",
+             "tests/wf/inputs_test.cwl", "tests/order/empty_order.json"],
+            cStringIO.StringIO(), sys.stderr, api_client=stubs.api)
+        self.assertEqual(exited, 0)
+
+        expect_template = {
+            "owner_uuid": stubs.fake_user_uuid,
+            "components": {
+                "inputs_test.cwl": {
+                    'runtime_constraints': {
+                        'docker_image': 'arvados/jobs',
+                    },
+                    'script_parameters': {
+                        'cwl:tool':
+                        '99999999999999999999999999999991+99/'
+                        'wf/inputs_test.cwl',
+                        '#optionalFloatInput': None,
+                        '#fileInput': {
+                            'path':
+                            '99999999999999999999999999999992+99/blorp.txt',
+                            'class': 'File',
+                        },
+                        '#floatInput': 1.234,
+                        '#boolInput': True,
+                    },
+                    'repository': 'arvados',
+                    'script_version': 'master',
+                    'script': 'cwl-runner',
+                },
+            },
+            "name": "inputs_test.cwl",
+        }
+        stubs.api.pipeline_templates().create.assert_called_with(
+            body=expect_template)
+
+    @stubs
+    def test_inputs(self, stubs):
+        exited = arvados_cwl.main(
+            ["--create-template", "--no-wait",
+             "tests/wf/inputs_test.cwl", "tests/order/inputs_test_order.json"],
+            cStringIO.StringIO(), sys.stderr, api_client=stubs.api)
+        self.assertEqual(exited, 0)
+
+        expect_template = {
+            "owner_uuid": stubs.fake_user_uuid,
+            "components": {
+                "inputs_test.cwl": {
+                    'runtime_constraints': {
+                        'docker_image': 'arvados/jobs',
+                    },
+                    'script_parameters': {
+                        'cwl:tool':
+                        '99999999999999999999999999999991+99/'
+                        'wf/inputs_test.cwl',
+                        '#optionalFloatInput': None,
+                        '#fileInput': {
+                            'path':
+                            '99999999999999999999999999999992+99/blorp.txt',
+                            'class': 'File',
+                        },
+                        '#floatInput': 1.234,
+                        '#boolInput': True,
+                    },
+                    'repository': 'arvados',
+                    'script_version': 'master',
+                    'script': 'cwl-runner',
+                },
+            },
+            "name": "inputs_test.cwl",
+        }
+        stubs.api.pipeline_templates().create.assert_called_with(
+            body=expect_template)
diff --git a/sdk/cwl/tests/wf/inputs_test.cwl b/sdk/cwl/tests/wf/inputs_test.cwl
new file mode 100644
index 0000000..03d924c
--- /dev/null
+++ b/sdk/cwl/tests/wf/inputs_test.cwl
@@ -0,0 +1,22 @@
+# Test case for arvados-cwl-runner. Used to test propagation of
+# various input types as script_parameters in pipeline templates.
+
+class: Workflow
+inputs:
+  - id: "#fileInput"
+    type: File
+    description: |
+      It's a file; we expect to find some characters in it.
+  - id: "#boolInput"
+    type: boolean
+  - id: "#floatInput"
+    type: float
+  - id: "#optionalFloatInput"
+    type: ["null", float]
+outputs: []
+steps:
+  - id: step1
+    inputs:
+      - { id: x, source: "#x" }
+    outputs: []
+    run: ../tool/submit_tool.cwl

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list