diff --git a/.github/workflows/cwltool.yml b/.github/workflows/cwltool.yml index 6a95340..d57ac9b 100644 --- a/.github/workflows/cwltool.yml +++ b/.github/workflows/cwltool.yml @@ -21,10 +21,10 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '3.9.x' + python-version: '3.10.x' - name: Setup prerequirements - run: pip install "cwltest>=2.3" pytest-xdist "cwltool>=3.1.20240909164951" + run: pip install "cwltest>=2.3" pytest-xdist git+https://github.com/common-workflow-language/cwltool.git@refs/pull/2177/head - name: Copy in cwltool-specific configuration for the cwltest pytest plugin run: cp "$(python -c 'from cwltool.tests.util import get_data; print(get_data("tests/cwl-conformance/cwltool-conftest.py"))')" conftest.py diff --git a/CommandLineTool.yml b/CommandLineTool.yml index 604c668..23b674d 100644 --- a/CommandLineTool.yml +++ b/CommandLineTool.yml @@ -51,6 +51,17 @@ $graph: ## Changelog for v1.3.0-dev1 + * [Output Binding](#Output_binding): Any output present in the + "cwl.output.json" file but not declared in the `outputs` section must + be discarded from the output object. Previous versions of CWL did not + define if undeclared outputs in "cwl.output.json" should be present + in the output object. + + ### Updated Conformance Tests for v1.3.0 + + * Reduced the usage of `ShellCommandRequirement` in the conformance tests, + making several more of the `required`. + See also the [CWL Workflow Description, v1.3.0-dev1 changelog](Workflow.html#Changelog). For other changes since CWL v1.0, see the [CWL Command Line Tool Description, v1.1 changelog](https://www.commonwl.org/v1.1/CommandLineTool.html#Changelog) diff --git a/conformance_tests.yaml b/conformance_tests.yaml index 2cad4f7..0de2c0f 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -109,7 +109,7 @@ checksum: sha1$f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 size: 4 location: error.txt - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/empty.json tool: tests/stderr-shortcut.cwl @@ -121,7 +121,7 @@ checksum: sha1$f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 size: 4 location: Any - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - output: output_file: @@ -133,7 +133,7 @@ tool: tests/stderr-mediumcut.cwl id: stderr_redirect_mediumcut doc: Test command line with stderr redirection, named brief syntax - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/cat-job.json output: @@ -951,7 +951,7 @@ doc: >- Test support for reading cwl.output.json when running in a Docker container and just 'path' is provided. - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/empty.json output: { @@ -1110,7 +1110,7 @@ tool: tests/dir.cwl id: directory_input_param_ref doc: Test directory input with parameter reference - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/dir-job.yml output: @@ -1123,7 +1123,7 @@ tool: tests/dir2.cwl id: directory_input_docker doc: Test directory input in Docker - tags: [ command_line_tool, shell_command ] + tags: [ required, command_line_tool ] - job: tests/dir3-job.yml output: @@ -1161,7 +1161,7 @@ tool: tests/dir4.cwl id: directory_secondaryfiles doc: Test directories in secondaryFiles - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/dir-job.yml output: { @@ -1175,7 +1175,7 @@ tool: tests/dir5.cwl id: dynamic_initial_workdir doc: Test dynamic initial work dir - tags: [ shell_command, initial_work_dir, command_line_tool ] + tags: [ initial_work_dir, command_line_tool ] - job: tests/stagefile-job.yml output: { @@ -1257,14 +1257,14 @@ tool: tests/envvar.cwl id: env_home_tmpdir doc: Test $HOME and $TMPDIR are set correctly - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/empty.json output: {} tool: tests/envvar2.cwl id: env_home_tmpdir_docker doc: Test $HOME and $TMPDIR are set correctly in Docker - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/empty.json output: @@ -1316,14 +1316,14 @@ tool: tests/docker-array-secondaryfiles.cwl id: filesarray_secondaryfiles doc: Test required, optional and null secondaryFiles on array of files. - tags: [ docker, inline_javascript, shell_command, command_line_tool ] + tags: [ docker, inline_javascript, command_line_tool ] - job: tests/docker-array-secondaryfiles-job2.json should_fail: true tool: tests/docker-array-secondaryfiles.cwl id: filesarray_secondaryfiles2 doc: Test required, optional and null secondaryFiles on array of files. - tags: [ docker, inline_javascript, shell_command, command_line_tool ] + tags: [ docker, inline_javascript, command_line_tool ] - job: tests/dir7.yml output: { @@ -1477,7 +1477,7 @@ tool: tests/recursive-input-directory.cwl id: input_dir_recurs_copy_writable doc: Test if a writable input directory is recursively copied and writable - tags: [ initial_work_dir, shell_command, command_line_tool ] + tags: [ initial_work_dir, command_line_tool ] - output: out: "t\n" @@ -1819,7 +1819,7 @@ tool: tests/envvar3.cwl id: env_home_tmpdir_docker_no_return_code doc: Test $HOME and $TMPDIR are set correctly in Docker without using return code - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/scatter-valuefrom-job1.json output: @@ -1877,7 +1877,7 @@ tool: tests/dir4.cwl id: job_input_secondary_subdirs doc: Test specifying secondaryFiles in subdirectories of the job input document. - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/dir4-subdir-2-job.yml output: { @@ -1891,7 +1891,7 @@ tool: tests/dir4.cwl id: job_input_subdir_primary_and_secondary_subdirs doc: Test specifying secondaryFiles in same subdirectory of the job input as the primary input file. - tags: [ shell_command, command_line_tool ] + tags: [ required, command_line_tool ] - job: tests/count-lines3-job.json output: @@ -2773,7 +2773,7 @@ "location": "lsout", "size": 32 } - tags: [ resource, command_line_tool, initial_work_dir ] + tags: [ command_line_tool, initial_work_dir ] id: initial_work_dir_for_null_and_arrays - job: tests/stage-array-dirs-job.yml @@ -2869,7 +2869,7 @@ "baesname": "symlink.txt" "checksum": "sha1$cd28ec34f3f9425aca544b6332453708e8aaa82a" should_fail: true - tags: [ command_line_tool ] + tags: [ required, command_line_tool ] id: illegal_symlink - job: tests/empty.json @@ -2881,7 +2881,7 @@ "size": 27 "basename": "symlink.txt" "checksum": "sha1$cd28ec34f3f9425aca544b6332453708e8aaa82a" - tags: [ command_line_tool ] + tags: [ required, command_line_tool ] id: legal_symlink - job: tests/empty.json @@ -3399,7 +3399,7 @@ } tool: tests/stdout_chained_commands.cwl doc: | - Test that chaining two echo calls causes the workflow tool to emit the output to stdout. + Test that chaining two echo calls causes the tool to emit the output to stdout. This is to confirm that the workflow tool will **not** create an expression such as `echo a && echo b > out.txt`, but instead will produce the correct `echo a && echo b`, and capture the output correctly. @@ -3618,4 +3618,28 @@ an_array_of_trues: [ true, true, true ] an_int: 42 +- id: cwl_output_json_new_output + tool: tests/test-cwl-out5.cwl + job: tests/empty.json + doc: >- + Confirm that undeclared outputs from cwl.output.json are discarded + tags: [ required, command_line_tool ] + output: {} + +- id: cwl_output_json_wrong_type + tool: tests/test-cwl-out6.cwl + job: tests/empty.json + doc: Confirm that outputs from cwl.output.json are type-checked + tags: [ required, command_line_tool ] + should_fail: true + +- id: cwl_output_json_missing_required_output + tool: tests/test-cwl-out7.cwl + job: tests/empty.json + doc: >- + Confirm that non-optional outputs not present in cwl.output.json + are still checked + tags: [ required, command_line_tool ] + should_fail: true + - $import: tests/loop/test-index.yaml diff --git a/invocation.md b/invocation.md index 8f7e8d7..97a7596 100644 --- a/invocation.md +++ b/invocation.md @@ -159,7 +159,9 @@ The exit code of the process is available to expressions in If the output directory contains a file named "cwl.output.json", that file must be loaded and used as the output object. In this case, the output object should still be type-checked against the `outputs` -section, but `outputBinding` is ignored. +section, but `outputBinding` is ignored. Any output is present in the +"cwl.output.json" file but not declared in the `outputs` section must +be discarded from the output object. For Files and Directories, if the value of `path` is a relative path pattern (does not begin with a slash '/') then it is resolved relative diff --git a/tests/dir.cwl b/tests/dir.cwl index 49ee5dd..3e316b0 100644 --- a/tests/dir.cwl +++ b/tests/dir.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement inputs: indir: Directory outputs: @@ -9,9 +7,9 @@ outputs: type: File outputBinding: glob: output.txt -arguments: ["cd", "$(inputs.indir.path)", - {shellQuote: false, valueFrom: "&&"}, - "find", ".", - {shellQuote: false, valueFrom: "|"}, - "sort"] -stdout: output.txt \ No newline at end of file +arguments: + - sh + - -c + - | + cd $(inputs.indir.path) && find . | sort +stdout: output.txt diff --git a/tests/dir2.cwl b/tests/dir2.cwl index 1bd3543..1a95d8b 100644 --- a/tests/dir2.cwl +++ b/tests/dir2.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - ShellCommandRequirement: {} hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim @@ -12,9 +10,9 @@ outputs: type: File outputBinding: glob: output.txt -arguments: ["cd", "$(inputs.indir.path)", - {shellQuote: false, valueFrom: "&&"}, - "find", ".", - {shellQuote: false, valueFrom: "|"}, - "sort"] +arguments: + - sh + - -c + - | + cd $(inputs.indir.path) && find . | sort stdout: output.txt diff --git a/tests/dir4.cwl b/tests/dir4.cwl index 2097996..5743a0d 100644 --- a/tests/dir4.cwl +++ b/tests/dir4.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement inputs: inf: File outputs: @@ -9,9 +7,9 @@ outputs: type: File outputBinding: glob: output.txt -arguments: ["cd", "$(inputs.inf.dirname)/xtestdir", - {shellQuote: false, valueFrom: "&&"}, - "find", ".", - {shellQuote: false, valueFrom: "|"}, - "sort"] +arguments: + - sh + - -c + - | + cd $(inputs.inf.dirname)/xtestdir && find . | sort stdout: output.txt diff --git a/tests/dir5.cwl b/tests/dir5.cwl index 5b42463..b591c96 100644 --- a/tests/dir5.cwl +++ b/tests/dir5.cwl @@ -1,7 +1,6 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 requirements: - - class: ShellCommandRequirement - class: InitialWorkDirRequirement listing: $(inputs.indir.listing) inputs: @@ -13,7 +12,9 @@ outputs: type: File outputBinding: glob: output.txt -arguments: ["find", "-L", ".", "!", "-path", "*.txt", - {shellQuote: false, valueFrom: "|"}, - "sort"] +arguments: + - sh + - -c + - | + find -L . ! -path "*.txt" | sort stdout: output.txt diff --git a/tests/dir6.cwl b/tests/dir6.cwl index 19d445c..13dcb57 100644 --- a/tests/dir6.cwl +++ b/tests/dir6.cwl @@ -18,4 +18,4 @@ arguments: [ "find", ".", {shellQuote: false, valueFrom: "|"}, "sort"] -stdout: output.txt \ No newline at end of file +stdout: output.txt diff --git a/tests/docker-array-secondaryfiles.cwl b/tests/docker-array-secondaryfiles.cwl index fd567a2..b28731d 100644 --- a/tests/docker-array-secondaryfiles.cwl +++ b/tests/docker-array-secondaryfiles.cwl @@ -6,7 +6,6 @@ requirements: - class: DockerRequirement dockerPull: docker.io/debian:stable-slim - class: InlineJavascriptRequirement - - class: ShellCommandRequirement class: CommandLineTool @@ -37,14 +36,15 @@ outputs: - pattern: "${ return null }" arguments: - - valueFrom: ${ + - sh + - -c + - | + ${ var fai_list = ""; for (var i = 0; i < inputs.fasta_path.length; i ++) { fai_list += " cat " + inputs.fasta_path[i].path +".fai" + " >> fai.list && " } return fai_list.slice(0,-3) - } - position: 1 - shellQuote: false + } baseCommand: [] diff --git a/tests/envvar.cwl b/tests/envvar.cwl index e4785b7..0cf14f9 100644 --- a/tests/envvar.cwl +++ b/tests/envvar.cwl @@ -2,10 +2,8 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 inputs: [] outputs: [] -requirements: - ShellCommandRequirement: {} -arguments: [ - echo, {valueFrom: '"HOME=$HOME"', shellQuote: false}, {valueFrom: '"TMPDIR=$TMPDIR"', shellQuote: false}, - {valueFrom: '&&', shellQuote: false}, - test, {valueFrom: '"$HOME"', shellQuote: false}, "=", $(runtime.outdir), - "-a", {valueFrom: '"$TMPDIR"', shellQuote: false}, "=", $(runtime.tmpdir)] +arguments: + - sh + - -c + - | + echo "HOME=$HOME" "TMPDIR=$TMPDIR" && test "$HOME"=$(runtime.outdir) -a "$TMPDIR"=$(runtime.tmpdir) diff --git a/tests/envvar2.cwl b/tests/envvar2.cwl index f06f5c0..8b81c79 100644 --- a/tests/envvar2.cwl +++ b/tests/envvar2.cwl @@ -2,13 +2,11 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 inputs: [] outputs: [] -requirements: - ShellCommandRequirement: {} hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim -arguments: [ - echo, {valueFrom: '"HOME=$HOME"', shellQuote: false}, {valueFrom: '"TMPDIR=$TMPDIR"', shellQuote: false}, - {valueFrom: '&&', shellQuote: false}, - test, {valueFrom: '"$HOME"', shellQuote: false}, "=", $(runtime.outdir), - "-a", {valueFrom: '"$TMPDIR"', shellQuote: false}, "=", $(runtime.tmpdir)] +arguments: + - sh + - -c + - | + echo "HOME=$HOME" "TMPDIR=$TMPDIR" && test "$HOME"=$(runtime.outdir) -a "$TMPDIR"=$(runtime.tmpdir) diff --git a/tests/envvar3.cwl b/tests/envvar3.cwl index 5863f34..926246a 100644 --- a/tests/envvar3.cwl +++ b/tests/envvar3.cwl @@ -6,18 +6,17 @@ outputs: results: type: File outputBinding: { glob: results } -requirements: - ShellCommandRequirement: {} hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim arguments: - - shellQuote: false - valueFrom: | - echo HOME=$HOME TMPDIR=$TMPDIR > log - if [ "$HOME" = "$(runtime.outdir)" ] && [ "$TMPDIR" = "$(runtime.tmpdir)" ] - then - echo success > results - else - echo failure > results - fi + - sh + - -c + - | + echo HOME=$HOME TMPDIR=$TMPDIR > log ; + if [ "$HOME" = "$(runtime.outdir)" ] && [ "$TMPDIR" = "$(runtime.tmpdir)" ] ; + then + echo success > results ; + else + echo failure > results ; + fi ; diff --git a/tests/exitcode.cwl b/tests/exitcode.cwl index bf4563b..981ad39 100644 --- a/tests/exitcode.cwl +++ b/tests/exitcode.cwl @@ -1,7 +1,5 @@ cwlVersion: v1.3.0-dev1 class: CommandLineTool -requirements: - ShellCommandRequirement: {} inputs: [] outputs: code: @@ -9,4 +7,8 @@ outputs: outputBinding: outputEval: $(runtime.exitCode) successCodes: [7] -arguments: ["exit", "7"] +arguments: + - sh + - -c + - | + exit 7 diff --git a/tests/initialwork-path.cwl b/tests/initialwork-path.cwl index 0f3113b..54ce894 100644 --- a/tests/initialwork-path.cwl +++ b/tests/initialwork-path.cwl @@ -5,11 +5,11 @@ requirements: listing: - entry: $(inputs.file1) entryname: bob.txt - ShellCommandRequirement: {} inputs: file1: File outputs: [] arguments: - - shellQuote: false - valueFrom: | - test "$(inputs.file1.path)" = "$(runtime.outdir)/bob.txt" + - sh + - -c + - | + test "$(inputs.file1.path)" = "$(runtime.outdir)/bob.txt" diff --git a/tests/iwd/iwd-container-entryname1.cwl b/tests/iwd/iwd-container-entryname1.cwl index a012d91..d2215e6 100644 --- a/tests/iwd/iwd-container-entryname1.cwl +++ b/tests/iwd/iwd-container-entryname1.cwl @@ -18,6 +18,8 @@ requirements: listing: - entryname: /tmp2j3y7rpb/input/stuff.txt # Give it a weird prefix to minimize chance of conflict with a real file entry: $(inputs.filelist) - ShellCommandRequirement: {} arguments: - - {shellQuote: false, valueFrom: "head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt"} + - sh + - -c + - | + head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt diff --git a/tests/iwd/iwd-container-entryname2.cwl b/tests/iwd/iwd-container-entryname2.cwl index dbbc716..db5f6e2 100644 --- a/tests/iwd/iwd-container-entryname2.cwl +++ b/tests/iwd/iwd-container-entryname2.cwl @@ -15,6 +15,8 @@ requirements: listing: - entryname: /tmp2j3y7rpb/input/stuff.txt # Give it a weird prefix to minimize chance of conflict with a real file entry: $(inputs.filelist) - ShellCommandRequirement: {} arguments: - - {shellQuote: false, valueFrom: "head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt"} + - sh + - -c + - | + head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt diff --git a/tests/iwd/iwd-container-entryname3.cwl b/tests/iwd/iwd-container-entryname3.cwl index 5001fed..2e03170 100644 --- a/tests/iwd/iwd-container-entryname3.cwl +++ b/tests/iwd/iwd-container-entryname3.cwl @@ -19,6 +19,8 @@ requirements: listing: - entryname: /tmp2j3y7rpb/input/stuff.txt # Give it a weird prefix to minimize chance of conflict with a real file entry: $(inputs.filelist) - ShellCommandRequirement: {} arguments: - - {shellQuote: false, valueFrom: "head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt"} + - sh + - -c + - | + head -n10 /tmp2j3y7rpb/input/stuff.txt > /output/head.txt diff --git a/tests/iwd/iwd-container-entryname4.cwl b/tests/iwd/iwd-container-entryname4.cwl index f35c048..5e32c4d 100644 --- a/tests/iwd/iwd-container-entryname4.cwl +++ b/tests/iwd/iwd-container-entryname4.cwl @@ -14,6 +14,8 @@ requirements: listing: - entryname: ../input/stuff.txt # Illegal entry: $(inputs.filelist) - ShellCommandRequirement: {} arguments: - - {shellQuote: false, valueFrom: "head -n10 ../input/stuff.txt > head.txt"} + - sh + - -c + - | + head -n10 ../input/stuff.txt > head.txt diff --git a/tests/iwd/test-index.yaml b/tests/iwd/test-index.yaml index 68eface..116a5c8 100644 --- a/tests/iwd/test-index.yaml +++ b/tests/iwd/test-index.yaml @@ -391,4 +391,4 @@ } ] doc: "Test creation of literal files in the listing" - tags: [ initial_work_dir, command_line_tool ] \ No newline at end of file + tags: [ initial_work_dir, command_line_tool ] diff --git a/tests/recursive-input-directory.cwl b/tests/recursive-input-directory.cwl index 3d89f38..9cd30da 100644 --- a/tests/recursive-input-directory.cwl +++ b/tests/recursive-input-directory.cwl @@ -6,22 +6,22 @@ requirements: - entry: $(inputs.input_dir) entryname: work_dir writable: true - ShellCommandRequirement: {} stdout: output.txt arguments: - - shellQuote: false - valueFrom: | - touch work_dir/e; - if [ ! -w work_dir ]; then echo work_dir not writable; fi; - if [ -L work_dir ]; then echo work_dir is a symlink; fi; - if [ ! -w work_dir/a ]; then echo work_dir/a not writable; fi; - if [ -L work_dir/a ]; then echo work_dir/a is a symlink; fi; - if [ ! -w work_dir/c ]; then echo work_dir/c not writable; fi; - if [ -L work_dir/c ]; then echo work_dir/c is a symlink; fi; - if [ ! -w work_dir/c/d ]; then echo work_dir/c/d not writable; fi; - if [ -L work_dir/c/d ]; then echo work_dir/c/d is a symlink; fi; - if [ ! -w work_dir/e ]; then echo work_dir/e not writable; fi; - if [ -L work_dir/e ]; then echo work_dir/e is a symlink ; fi; + - sh + - -c + - | + touch work_dir/e; + if [ ! -w work_dir ]; then echo work_dir not writable; fi; + if [ -L work_dir ]; then echo work_dir is a symlink; fi; + if [ ! -w work_dir/a ]; then echo work_dir/a not writable; fi; + if [ -L work_dir/a ]; then echo work_dir/a is a symlink; fi; + if [ ! -w work_dir/c ]; then echo work_dir/c not writable; fi; + if [ -L work_dir/c ]; then echo work_dir/c is a symlink; fi; + if [ ! -w work_dir/c/d ]; then echo work_dir/c/d not writable; fi; + if [ -L work_dir/c/d ]; then echo work_dir/c/d is a symlink; fi; + if [ ! -w work_dir/e ]; then echo work_dir/e not writable; fi; + if [ -L work_dir/e ]; then echo work_dir/e is a symlink ; fi; inputs: input_dir: Directory outputs: diff --git a/tests/runtime-paths-distinct.cwl b/tests/runtime-paths-distinct.cwl index 215df76..1c775c8 100644 --- a/tests/runtime-paths-distinct.cwl +++ b/tests/runtime-paths-distinct.cwl @@ -1,13 +1,12 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - ShellCommandRequirement: {} inputs: {} outputs: foo: File arguments: - - shellQuote: false - valueFrom: | - echo "cow" > "$(runtime.outdir)/foo" && - echo "moo" > "$(runtime.tmpdir)/foo" && - echo '{"foo": {"path": "$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json + - sh + - -c + - | + echo "cow" > "$(runtime.outdir)/foo" && + echo "moo" > "$(runtime.tmpdir)/foo" && + echo '{"foo": {"path": "$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json diff --git a/tests/secondaryfiles/rename-inputs.cwl b/tests/secondaryfiles/rename-inputs.cwl index f45afe8..703c450 100644 --- a/tests/secondaryfiles/rename-inputs.cwl +++ b/tests/secondaryfiles/rename-inputs.cwl @@ -43,12 +43,10 @@ inputs: arguments: -- "ls" -- $(inputs.inputWithSecondary.dirname) -- valueFrom: "|" - shellQuote: false -- "grep" -- "secondary" + - sh + - -c + - | + ls $(inputs.inputWithSecondary.dirname) | grep secondary outputs: - id: output_file @@ -56,4 +54,3 @@ outputs: stdout: result requirements: InlineJavascriptRequirement: {} - ShellCommandRequirement: {} diff --git a/tests/secondaryfiles/test-index.yaml b/tests/secondaryfiles/test-index.yaml index 54fb40e..8dd220c 100644 --- a/tests/secondaryfiles/test-index.yaml +++ b/tests/secondaryfiles/test-index.yaml @@ -8,7 +8,7 @@ checksum: sha1$901c3d387a263c57eaed6f24a82517c1fb0e198d size: 54 location: result - tags: [ inline_javascript, secondary_files, command_line_tool, shell_command ] + tags: [ inline_javascript, secondary_files, command_line_tool ] - tool: rename-outputs.cwl doc: Confirm CommandOutputParameter expression can receive a File object diff --git a/tests/stage-array.cwl b/tests/stage-array.cwl index 745a34b..1c19ce4 100644 --- a/tests/stage-array.cwl +++ b/tests/stage-array.cwl @@ -4,7 +4,10 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 id: stage_array arguments: - - {shellQuote: false, valueFrom: "ls | grep -v lsout"} + - sh + - -c + - | + ls | grep -v lsout inputs: - id: input_file type: File @@ -30,4 +33,3 @@ requirements: - entry: $(null) - entryname: a entry: b - - class: ShellCommandRequirement diff --git a/tests/stderr-mediumcut.cwl b/tests/stderr-mediumcut.cwl index cd0421e..97af38c 100644 --- a/tests/stderr-mediumcut.cwl +++ b/tests/stderr-mediumcut.cwl @@ -1,13 +1,14 @@ #!/usr/bin/env cwl-runner class: CommandLineTool cwlVersion: v1.3.0-dev1 -doc: "Test of capturing stderr output in a docker container." -requirements: - ShellCommandRequirement: {} +doc: "Test of capturing stderr output" inputs: [] outputs: output_file: type: stderr arguments: - - { valueFrom: "echo foo 1>&2", shellQuote: False } + - sh + - -c + - | + echo foo 1>&2 stderr: std.err diff --git a/tests/stderr-shortcut.cwl b/tests/stderr-shortcut.cwl index d768331..a09684b 100644 --- a/tests/stderr-shortcut.cwl +++ b/tests/stderr-shortcut.cwl @@ -2,11 +2,12 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 doc: "Test of capturing stderr output." -requirements: - ShellCommandRequirement: {} inputs: [] outputs: output_file: type: stderr arguments: - - { valueFrom: "echo foo 1>&2", shellQuote: False } + - sh + - -c + - | + echo foo 1>&2 diff --git a/tests/stderr.cwl b/tests/stderr.cwl index 4d7546d..d2a82ea 100644 --- a/tests/stderr.cwl +++ b/tests/stderr.cwl @@ -2,13 +2,14 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 doc: "Test of capturing stderr output." -requirements: - ShellCommandRequirement: {} inputs: [] outputs: output_file: type: File outputBinding: {glob: error.txt} arguments: - - { valueFrom: "echo foo 1>&2", shellQuote: False } + - sh + - -c + - | + echo foo 1>&2 stderr: error.txt diff --git a/tests/symlink-illegal.cwl b/tests/symlink-illegal.cwl index e02cea5..ec2737b 100644 --- a/tests/symlink-illegal.cwl +++ b/tests/symlink-illegal.cwl @@ -11,15 +11,8 @@ outputs: type: File outputBinding: {glob: symlink.txt} -requirements: - - class: ShellCommandRequirement - arguments: - - echo - - "Who's gonna drive you home" - - {valueFrom: "> /tmp/original.txt", shellQuote: false} - - {valueFrom: " && ", shellQuote: false} - - ln - - -s - - /tmp/original.txt - - symlink.txt + - sh + - -c + - | + echo "Who's gonna drive you home" > /tmp/original.txt && ln -s /tmp/original.txt symlink.txt diff --git a/tests/symlink-legal.cwl b/tests/symlink-legal.cwl index eceacfb..aa25cf3 100644 --- a/tests/symlink-legal.cwl +++ b/tests/symlink-legal.cwl @@ -11,18 +11,8 @@ outputs: type: File outputBinding: {glob: symlink.txt} -requirements: - - class: ShellCommandRequirement - arguments: - - mkdir - - adir - - {valueFrom: " && ", shellQuote: false} - - echo - - "Who's gonna drive you home" - - {valueFrom: "> adir/original.txt", shellQuote: false} - - {valueFrom: " && ", shellQuote: false} - - ln - - -s - - adir/original.txt - - symlink.txt + - sh + - -c + - | + mkdir adir && echo "Who's gonna drive you home" > adir/original.txt && ln -s adir/original.txt symlink.txt diff --git a/tests/test-cwl-out.cwl b/tests/test-cwl-out.cwl index 0ee3bb2..ace607e 100644 --- a/tests/test-cwl-out.cwl +++ b/tests/test-cwl-out.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim @@ -13,6 +11,7 @@ outputs: type: File arguments: - - valueFrom: > - echo foo > foo && echo '{"foo": {"path": "$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json - shellQuote: false + - sh + - -c + - | + echo foo > foo && echo '{"foo": {"path": "$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json diff --git a/tests/test-cwl-out2.cwl b/tests/test-cwl-out2.cwl index 71b6d71..e518866 100644 --- a/tests/test-cwl-out2.cwl +++ b/tests/test-cwl-out2.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim @@ -13,6 +11,7 @@ outputs: type: File arguments: - - valueFrom: > - echo foo > foo && echo '{"foo": {"location": "file://$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json - shellQuote: false + - sh + - -c + - | + echo foo > foo && echo '{"foo": {"location": "file://$(runtime.outdir)/foo", "class": "File"} }' > cwl.output.json diff --git a/tests/test-cwl-out3.cwl b/tests/test-cwl-out3.cwl index 4ff5ea1..0ae1979 100644 --- a/tests/test-cwl-out3.cwl +++ b/tests/test-cwl-out3.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim diff --git a/tests/test-cwl-out4.cwl b/tests/test-cwl-out4.cwl index 756baaa..658d508 100644 --- a/tests/test-cwl-out4.cwl +++ b/tests/test-cwl-out4.cwl @@ -1,7 +1,5 @@ class: CommandLineTool cwlVersion: v1.3.0-dev1 -requirements: - - class: ShellCommandRequirement hints: DockerRequirement: dockerPull: docker.io/debian:stable-slim diff --git a/tests/test-cwl-out5.cwl b/tests/test-cwl-out5.cwl new file mode 100644 index 0000000..aee2d06 --- /dev/null +++ b/tests/test-cwl-out5.cwl @@ -0,0 +1,18 @@ +class: CommandLineTool +cwlVersion: v1.3.0-dev1 +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim + +inputs: [] + +baseCommand: sh + +arguments: + - -c + - | + echo foo > foo && echo '{"foo": {"location": "foo", "class": "File"} }' + +stdout: cwl.output.json + +outputs: {} diff --git a/tests/test-cwl-out6.cwl b/tests/test-cwl-out6.cwl new file mode 100644 index 0000000..17fedbd --- /dev/null +++ b/tests/test-cwl-out6.cwl @@ -0,0 +1,20 @@ +class: CommandLineTool +cwlVersion: v1.3.0-dev1 +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim + +inputs: [] + +baseCommand: sh + +arguments: + - -c + - | + echo foo > foo && echo '{"foo": {"location": "foo", "class": "File"} }' + +stdout: cwl.output.json + +outputs: + - id: foo + type: int diff --git a/tests/test-cwl-out7.cwl b/tests/test-cwl-out7.cwl new file mode 100644 index 0000000..d45a9ae --- /dev/null +++ b/tests/test-cwl-out7.cwl @@ -0,0 +1,22 @@ +class: CommandLineTool +cwlVersion: v1.3.0-dev1 +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim + +inputs: [] + +baseCommand: sh + +arguments: + - -c + - | + echo foo > foo && echo '{"foo": {"location": "foo", "class": "File"} }' + +stdout: cwl.output.json + +outputs: + - id: foo + type: File + - id: bar + type: int