Skip to content

Commit

Permalink
Add a conformance test for InlineJavascriptRequirement with an input …
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Oct 20, 2022
1 parent 73e3bf9 commit 2d4d6d1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
13 changes: 12 additions & 1 deletion conformance_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3570,6 +3570,17 @@
and capture the output correctly.
tags: [ shell_command, command_line_tool ]

- label: js-input-record
# The output does not have the last \n due to the -n passed to echo
output: {
"out": "JS\nwith\nrecord"
}
tool: tests/js-input-record.cwl
job: tests/js-input-record.json
doc: |
A test case for JS with an input record.
tags: [ inline_javascript, command_line_tool ]

- tool: tests/schemadef_types_with_import-wf.cwl
job: tests/schemadef_types_with_import-job.json
output: {
Expand All @@ -3579,4 +3590,4 @@
doc: >-
Test SchemaDefRequirement with a workflow, with the `$import` under types.
It is similar to schemadef-wf, but the `$import` is different.
tags: [ workflow, schema_def ]
tags: [ workflow, schema_def ]
33 changes: 33 additions & 0 deletions tests/js-input-record.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cwlVersion: v1.0

class: CommandLineTool

requirements:
- class: InlineJavascriptRequirement

baseCommand: ['echo']

inputs:
message:
type:
type: record
name: message_object
fields:
text:
type: string
inputBinding:
position: 1
newlines:
type: boolean?
inputBinding:
position: 0
prefix: -n

outputs:
out:
type: string
outputBinding:
glob: output.txt
loadContents: true
outputEval: $(self[0].contents)
stdout: output.txt
7 changes: 7 additions & 0 deletions tests/js-input-record.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"message": {
"text": "JS\nwith\nrecord",
"newlines": true
}
}

0 comments on commit 2d4d6d1

Please sign in to comment.