10401: Add integration tests for directory listing behavior.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 12 Apr 2017 16:08:52 +0000 (12:08 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 12 Apr 2017 16:08:52 +0000 (12:08 -0400)
sdk/cwl/arvados_cwl/arv-cwl-schema.yml
sdk/cwl/tests/arvados-tests.yml
sdk/cwl/tests/tmp1/tmp2/tmp3/.gitkeep [new file with mode: 0644]
sdk/cwl/tests/wf/listing_deep.cwl [new file with mode: 0644]
sdk/cwl/tests/wf/listing_none.cwl [new file with mode: 0644]
sdk/cwl/tests/wf/listing_shallow.cwl [new file with mode: 0644]

index 133638c7705f00b60bdea14dcbc46e0c008fb636..4e48216f32aefb962df7c93ea69769df9c9762a7 100644 (file)
@@ -21,7 +21,7 @@ $graph:
         - "null"
         - type: enum
           name: LoadListingEnum
-          symbols: [shallow, deep]
+          symbols: [no_listing, shallow_listing, deep_listing]
 
 - name: RunInSingleContainer
   type: record
index 1beadb9de4e4e4a3897f34f57f704caff75a30ac..87528b2ae595df94a73b24ff9b3e931336edf067 100644 (file)
   output: {}
   tool: cat.cwl
   doc: Test hashes in filenames
+
+- job: listing-job.yml
+  output: {
+    "out": {
+        "class": "File",
+        "location": "output.txt",
+        "size": 5,
+        "checksum": "sha1$724ba28f4a9a1b472057ff99511ed393a45552e1"
+    }
+  }
+  tool: wf/listing_shallow.cwl
+  doc: test shallow directory listing
+
+- job: listing-job.yml
+  output: {
+    "out": {
+        "class": "File",
+        "location": "output.txt",
+        "size": 5,
+        "checksum": "sha1$724ba28f4a9a1b472057ff99511ed393a45552e1"
+    }
+  }
+  tool: wf/listing_none.cwl
+  doc: test no directory listing
+
+- job: listing-job.yml
+  output: {
+    "out": {
+        "class": "File",
+        "location": "output.txt",
+        "size": 5,
+        "checksum": "sha1$724ba28f4a9a1b472057ff99511ed393a45552e1"
+    }
+  }
+  tool: wf/listing_deep.cwl
+  doc: test deep directory listing
diff --git a/sdk/cwl/tests/tmp1/tmp2/tmp3/.gitkeep b/sdk/cwl/tests/tmp1/tmp2/tmp3/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/sdk/cwl/tests/wf/listing_deep.cwl b/sdk/cwl/tests/wf/listing_deep.cwl
new file mode 100644 (file)
index 0000000..79ab368
--- /dev/null
@@ -0,0 +1,15 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  cwltool: "http://commonwl.org/cwltool#"
+requirements:
+  cwltool:LoadListingRequirement:
+    loadListing: deep_listing
+  InlineJavascriptRequirement: {}
+inputs:
+  d: Directory
+outputs:
+  out: stdout
+stdout: output.txt
+arguments:
+  [echo, "${if(inputs.d.listing[0].class === 'Directory' && inputs.d.listing[0].listing[0].class === 'Directory') {return 'true';} else {return 'false';}}"]
diff --git a/sdk/cwl/tests/wf/listing_none.cwl b/sdk/cwl/tests/wf/listing_none.cwl
new file mode 100644 (file)
index 0000000..584c8f5
--- /dev/null
@@ -0,0 +1,15 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  cwltool: http://commonwl.org/cwltool#
+requirements:
+  cwltool:LoadListingRequirement:
+    loadListing: no_listing
+  InlineJavascriptRequirement: {}
+inputs:
+  d: Directory
+outputs:
+  out: stdout
+stdout: output.txt
+arguments:
+  [echo, "${if(inputs.d.listing === undefined) {return 'true';} else {return 'false';}}"]
\ No newline at end of file
diff --git a/sdk/cwl/tests/wf/listing_shallow.cwl b/sdk/cwl/tests/wf/listing_shallow.cwl
new file mode 100644 (file)
index 0000000..b54f348
--- /dev/null
@@ -0,0 +1,15 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  cwltool: http://commonwl.org/cwltool#
+requirements:
+  cwltool:LoadListingRequirement:
+    loadListing: shallow_listing
+  InlineJavascriptRequirement: {}
+inputs:
+  d: Directory
+outputs:
+  out: stdout
+stdout: output.txt
+arguments:
+  [echo, "${if(inputs.d.listing[0].class === 'Directory' && inputs.d.listing[0].listing === undefined) {return 'true';} else {return 'false';}}"]