15241: Fix input bare collection as directory
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 20 May 2019 19:46:17 +0000 (15:46 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 20 May 2019 19:46:17 +0000 (15:46 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

sdk/cwl/arvados_cwl/arvcontainer.py
sdk/cwl/tests/15241-writable-dir-job.json [new file with mode: 0644]
sdk/cwl/tests/15241-writable-dir.cwl [new file with mode: 0644]
sdk/cwl/tests/arvados-tests.yml

index b194f3dfcaa0be1cf676ea771e008cbcc9b0b2c0..ec144abf3ee36adfe5e8594e4cd1219632f79528 100644 (file)
@@ -155,7 +155,7 @@ class ArvadosContainer(JobBase):
                                 vwd.mkdirs(p.target)
                             else:
                                 source, path = self.arvrunner.fs_access.get_collection(p.resolved)
-                                vwd.copy(path, p.target, source_collection=source)
+                                vwd.copy(path or ".", p.target, source_collection=source)
                         elif p.type == "CreateFile":
                             if self.arvrunner.secret_store.has_secret(p.resolved):
                                 secret_mounts["%s/%s" % (self.outdir, p.target)] = {
diff --git a/sdk/cwl/tests/15241-writable-dir-job.json b/sdk/cwl/tests/15241-writable-dir-job.json
new file mode 100644 (file)
index 0000000..f30578e
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "filesDir": {
+        "location": "keep:d7514270f356df848477718d58308cc4+94",
+        "class": "Directory"
+    }
+}
diff --git a/sdk/cwl/tests/15241-writable-dir.cwl b/sdk/cwl/tests/15241-writable-dir.cwl
new file mode 100644 (file)
index 0000000..bfd17f7
--- /dev/null
@@ -0,0 +1,20 @@
+cwlVersion: v1.0
+class: CommandLineTool
+
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.filesDir)
+        writable: true
+
+inputs:
+  filesDir:
+    type: Directory
+
+outputs:
+  results:
+    type: Directory
+    outputBinding:
+      glob: .
+
+arguments: [touch, $(inputs.filesDir.path)/blurg.txt]
index 8b8ff28c789d771ba0c2e54855beb82381ee6a83..d649c3bf67706669ee93076a2640958f3194d734 100644 (file)
     }
   tool: 13931-size.cwl
   doc: Test that size is set for files in Keep
+
+- job: 15241-writable-dir-job.json
+  output: {
+    "results": {
+        "basename": "keep:6dd5fa20622d5a7a23c9147d0927da2a+180",
+        "class": "Directory",
+        "listing": [
+            {
+                "basename": "d7514270f356df848477718d58308cc4+94",
+                "class": "Directory",
+                "listing": [
+                    {
+                        "basename": "a",
+                        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
+                        "class": "File",
+                        "location": "a",
+                        "size": 0
+                    },
+                    {
+                        "basename": "blurg.txt",
+                        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
+                        "class": "File",
+                        "location": "blurg.txt",
+                        "size": 0
+                    },
+                    {
+                        "basename": "c",
+                        "class": "Directory",
+                        "listing": [
+                            {
+                                "basename": "d",
+                                "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
+                                "class": "File",
+                                "location": "d",
+                                "size": 0
+                            }
+                        ],
+                        "location": "c"
+                    },
+                    {
+                        "basename": "b",
+                        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
+                        "class": "File",
+                        "location": "b",
+                        "size": 0
+                    }
+                ],
+                "location": "d7514270f356df848477718d58308cc4+94"
+            }
+        ],
+        "location": "keep:6dd5fa20622d5a7a23c9147d0927da2a+180"
+    }
+  }
+  tool: 15241-writable-dir.cwl
+  doc: Test for writable collections