common-workflow-language / common-workflow-language/cwltool

cwltool gives spurious warnings about URIs when Javascript ternary operation is used in format

Open
#1,394 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

## Expected Behavior
no warning should be issued

## Actual Behavior
On execution this warning is issued (twice):

```
URI prefix '$(inputs.param1 == 'foo' ? 'bar' ' of '$(inputs.param1 == 'foo' ? 'bar' : null)' not recognized, are you missing a $namespaces section?
```

## Workflow Code
``` cwl
#!/usr/bin/env cwl-runner
class: CommandLineTool
cwlVersion: v1.0

requirements:
InlineJavascriptRequirement: {}

inputs:
param1:
type: string

stdout: test.txt

baseCommand: echo

outputs:
output:
type: stdout
format: "$(inputs.param1 == 'foo' ? 'bar' : null)"
```

## Full Traceback
```pytb
INFO /home/pvh/miniconda3/envs/cwltool/bin/cwltool 3.0.20200807132242
INFO Resolved 'util/warning.cwl' to 'file:///home/pvh/Documents/code/SANBI/pvh-forks/bio-cwl-tools/util/warning.cwl'
URI prefix '$(inputs.param1 == 'foo' ? 'bar' ' of '$(inputs.param1 == 'foo' ? 'bar' : null)' not recognized, are you missing a $namespaces section?
URI prefix '$(inputs.param1 == 'foo' ? 'bar' ' of '$(inputs.param1 == 'foo' ? 'bar' : null)' not recognized, are you missing a $namespaces section?
DEBUG Parsed job order from command line: {
"id": "util/warning.cwl",
"param1": "foo"
}
DEBUG [job warning.cwl] initializing from file:///home/pvh/Documents/code/SANBI/pvh-forks/bio-cwl-tools/util/warning.cwl
DEBUG [job warning.cwl] {
"param1": "foo"
}
DEBUG [job warning.cwl] path mappings is {}
DEBUG [job warning.cwl] command line bindings is [
{
"position": [
-1000000,
0
],
"datum": "echo"
}
]
DEBUG [job warning.cwl] initial work dir {}
INFO [job warning.cwl] /tmp/ncvrlrod$ echo > /tmp/ncvrlrod/test.txt
DEBUG Could not collect memory usage, job ended before monitoring began.
INFO [job warning.cwl] completed success
DEBUG [job warning.cwl] outputs {
"output": {
"location": "file:///tmp/ncvrlrod/test.txt",
"basename": "test.txt",
"nameroot": "test",
"nameext": ".txt",
"class": "File",
"checksum": "sha1$adc83b19e793491b1c6ea0fd8b46cd9f32e592fc",
"size": 1,
"format": "bar",
"http://commonwl.org/cwltool#generation": 0
}
}
DEBUG [job warning.cwl] Removing input staging directory /tmp/tmpzscun387
DEBUG [job warning.cwl] Removing temporary directory /tmp/tmpqza9qlg1
DEBUG Moving /tmp/ncvrlrod/test.txt to /home/pvh/Documents/code/SANBI/pvh-forks/bio-cwl-tools/test.txt
{
"output": {
"location": "file:///home/pvh/Documents/code/SANBI/pvh-forks/bio-cwl-tools/test.txt",
"basename": "test.txt",
"class": "File",
"checksum": "sha1$adc83b19e793491b1c6ea0fd8b46cd9f32e592fc",
"size": 1,
"format": "bar",
"path": "/home/pvh/Documents/code/SANBI/pvh-forks/bio-cwl-tools/test.txt"
}
}
INFO Final process status is success
```

## Your Environment
* cwltool version: 3.0.20200807132242

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.