Skip to content

Commit 5d47049

Browse files
author
Peter Amstutz
committed
Add runtime.exitCode to outputEval
1 parent b5e4788 commit 5d47049

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

CommandLineTool.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ $graph:
5656
* When defining record types with `CommandInputRecordSchema`, fields of
5757
type `File` may now include `format`, `loadContents`,
5858
`secondaryFiles` and `streamable`.
59-
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
60-
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
59+
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
60+
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
6161
`doc` field.
6262
* `inputBinding` has been added as an optional field for
6363
`CommandInputRecordSchema` (was previously in CWL `draft-3` but
@@ -102,6 +102,8 @@ $graph:
102102
`Directory` listings should be loaded for use in expressions.
103103
* The position field of the [CommandLineBinding](#CommandLineBinding) can
104104
now be calculated from a CWL Expression.
105+
* The exit code of a CommandLineTool invocation is now
106+
available to expressions in `outputEval` as `runtime.exitCode`
105107
106108
See also the [CWL Workflow Description, v1.1.0-dev1 changelog](Workflow.html#Changelog).
107109
@@ -324,13 +326,15 @@ $graph:
324326
- string
325327
- Expression
326328
doc: |
327-
Evaluate an expression to generate the output value. If `glob` was
328-
specified, the value of `self` must be an array containing file objects
329-
that were matched. If no files were matched, `self` must be a zero
330-
length array; if a single file was matched, the value of `self` is an
331-
array of a single element. Additionally, if `loadContents` is `true`,
332-
the File objects must include up to the first 64 KiB of file contents
333-
in the `contents` field.
329+
Evaluate an expression to generate the output value. If
330+
`glob` was specified, the value of `self` must be an array
331+
containing file objects that were matched. If no files were
332+
matched, `self` must be a zero length array; if a single file
333+
was matched, the value of `self` is an array of a single
334+
element. Additionally, if `loadContents` is `true`, the File
335+
objects must include up to the first 64 KiB of file contents
336+
in the `contents` field. The exit code of the process is
337+
available in the expression as `runtime.exitCode`.
334338
335339
- name: CommandLineBindable
336340
type: record

conformance_tests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,3 +3192,11 @@
31923192
out: "🕺 1 singular sensation!\n"
31933193
doc: TBD
31943194
tags: [ command_line_tool, required ]
3195+
3196+
- job: tests/empty.json
3197+
tool: tests/exitcode.cwl
3198+
label: outputEval_exitCode
3199+
output:
3200+
code: 7
3201+
doc: Can access exit code in outputEval
3202+
tags: [ command_line_tool, required ]

invocation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ providing the fields `successCodes`, `temporaryFailCodes`, and
146146
`permanentFailCodes`. An implementation may choose to default unspecified
147147
non-zero exit codes to either `temporaryFailure` or `permanentFailure`.
148148

149+
The exit code of the process is available to expressions in
150+
`outputEval` as `runtime.exitCode`.
151+
149152
## Output binding
150153

151154
If the output directory contains a file named "cwl.output.json", that file

tests/exitcode.cwl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cwlVersion: v1.1.0-dev1
2+
class: CommandLineTool
3+
requirements:
4+
ShellCommandRequirement: {}
5+
inputs: []
6+
outputs:
7+
code:
8+
type: int
9+
outputBinding:
10+
outputEval: $(runtime.exitCode)
11+
successCodes: [7]
12+
arguments: ["exit", "7"]

0 commit comments

Comments
 (0)