common-workflow-language / common-workflow-language/cwltool
Difference in optional arguments handling using .yml config and manually provided paramters
- Vorherrschende Sprache
- Python
- Sterne
- 376
- Forks
- 255
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 12
Beschreibung
## Expected Behavior
Either should throw error in both cases or not throw at all.(Latter variant seems more logic to me)
## Actual Behavior
Throws error with manually provided parameters, but runs without error with equal yml config
## Workflow Code
```
cwlVersion: v1.0
class: CommandLineTool
label: Trimmomatic wrapper for paired end data
baseCommand: [echo]
requirements:
- class: InlineJavascriptRequirement
inputs:
some_optional_parameter:
type: string?
inputBinding:
position: 1
valueFrom: $(self.split("a"))
required:
type: int
outputs:
out: stdout
```
## Full Traceback with manually provided parameters
**Coommand `cwltool test.cwl --required 5`**
```pytb
Traceback (most recent call last):
File "/home/aslepchenkov/cwltool-latest/local/lib/python2.7/site-packages/cwltool/main.py", line 786, in main
**vars(args))
File "/home/aslepchenkov/cwltool-latest/local/lib/python2.7/site-packages/cwltool/main.py", line 247, in single_job_executor
for r in jobiter:
File "/home/aslepchenkov/cwltool-latest/local/lib/python2.7/site-packages/cwltool/draft2tool.py", line 432, in job
j.command_line = flatten(map(builder.generate_arg, builder.bindings))
File "/home/aslepchenkov/cwltool-latest/local/lib/python2.7/site-packages/cwltool/builder.py", line 179, in generate_arg
value = self.do_eval(binding["valueFrom"], context=value)
File "/home/aslepchenkov/cwltool-latest/local/lib/python2.7/site-packages/schema_salad/sourceline.py", line 150, in __exit__
raise self.makeError(unicode(exc_value))
WorkflowException: :1:1: Expression evaluation error:
:1:1: returncode was: 1
:1:1: script was:
:1:1: 01 "use strict";
:1:1: 02 var inputs = {
:1:1: 03 "some_optional_parameter": null,
:1:1: 04 "required": 5
:1:1: 05 };
:1:1: 06 var self = null;
:1:1: 07 var runtime = {
:1:1: 08 "outdirSize": 1024,
:1:1: 09 "ram": 1024,
:1:1: 10 "tmpdirSize": 1024,
:1:1: 11 "cores": 1,
:1:1: 12 "tmpdir": "/tmp/tmp2R3j8p",
:1:1: 13 "outdir": "/tmp/tmpD2wGC2"
:1:1: 14 };
:1:1: 15 (function(){return ((self.split("a")));})()
:1:1: stdout was:
:1:1: stderr was:
:1:1: evalmachine.:15
:1:1: (function(){return ((self.split("a")));})()
:1:1: ^
:1:1:
:1:1: TypeError: Cannot read property 'split' of null
:1:1: at evalmachine.:15:26
:1:1: at evalmachine.:15:42
:1:1: at ContextifyScript.Script.runInContext (vm.js:37:29)
:1:1: at ContextifyScript.Script.runInNewContext (vm.js:43:15)
:1:1: at Object.exports.runInNewContext (vm.js:74:17)
:1:1: at Socket. ([eval]:10:55)
:1:1: at emitOne (events.js:96:13)
:1:1: at Socket.emit (events.js:188:7)
:1:1: at readableAddChunk (_stream_readable.js:176:18)
:1:1: at Socket.Readable.push (_stream_readable.js:134:10)
```
## Yml config
```
required: 5
```
## Your Environment
* cwltool version:
1.0.20170622090721
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.