From d8b6c8f4f51b11499601f3b1acb13150168d1cea Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 8 Nov 2016 09:45:30 -0500 Subject: [PATCH] Add tests for file and directory literals in output as produced by expression tool. --- v1.0/conformance_test_v1.0.yaml | 36 ++++++++++++++++++++++++++++++++- v1.0/v1.0/dir7.cwl | 12 +++++++++++ v1.0/v1.0/dir7.yml | 5 +++++ v1.0/v1.0/file-literal-ex.cwl | 11 ++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 v1.0/v1.0/dir7.cwl create mode 100644 v1.0/v1.0/dir7.yml create mode 100644 v1.0/v1.0/file-literal-ex.cwl diff --git a/v1.0/conformance_test_v1.0.yaml b/v1.0/conformance_test_v1.0.yaml index 1d9fe920e..1d0d2e5dc 100644 --- a/v1.0/conformance_test_v1.0.yaml +++ b/v1.0/conformance_test_v1.0.yaml @@ -925,4 +925,38 @@ } } tool: v1.0/docker-array-secondaryfiles.cwl - doc: Test secondaryFiles on array of files. \ No newline at end of file + doc: Test secondaryFiles on array of files. + +- job: v1.0/dir7.yml + output: { + "dir": { + "location": "a_directory", + "class": "Directory", + "listing": [ + { + "class": "File", + "location": "whale.txt", + "checksum": "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376", + "size": 1111 + }, + { + "class": "File", + "location": "hello.txt", + "checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b", + "size": 13 + } + ] + } + } + tool: v1.0/dir7.cwl + doc: Test directory literal output created by ExpressionTool + +- job: v1.0/empty.json + output: + lit: + location: "a_file" + class: "File" + checksum: "sha1$fea23663b9c8ed71968f86415b5ec091bb111448" + size: 19 + tool: v1.0/file-literal-ex.cwl + doc: Test file literal output created by ExpressionTool diff --git a/v1.0/v1.0/dir7.cwl b/v1.0/v1.0/dir7.cwl new file mode 100644 index 000000000..88171e6dd --- /dev/null +++ b/v1.0/v1.0/dir7.cwl @@ -0,0 +1,12 @@ +class: ExpressionTool +cwlVersion: v1.0 +requirements: + InlineJavascriptRequirement: {} +inputs: + files: File[] +outputs: + dir: Directory +expression: | + ${ + return {"dir": {"class": "Directory", "basename": "a_directory", "listing": inputs.files}}; + } \ No newline at end of file diff --git a/v1.0/v1.0/dir7.yml b/v1.0/v1.0/dir7.yml new file mode 100644 index 000000000..7ad068585 --- /dev/null +++ b/v1.0/v1.0/dir7.yml @@ -0,0 +1,5 @@ +files: + - class: File + location: hello.txt + - class: File + location: whale.txt diff --git a/v1.0/v1.0/file-literal-ex.cwl b/v1.0/v1.0/file-literal-ex.cwl new file mode 100644 index 000000000..9f809f34f --- /dev/null +++ b/v1.0/v1.0/file-literal-ex.cwl @@ -0,0 +1,11 @@ +class: ExpressionTool +cwlVersion: v1.0 +requirements: + InlineJavascriptRequirement: {} +inputs: [] +outputs: + lit: File +expression: | + ${ + return {"lit": {"class": "File", "basename": "a_file", "contents": "Hello file literal."}}; + } \ No newline at end of file