common-workflow-language / cwltool

Common Workflow Language reference implementation
https://cwltool.readthedocs.io/
Apache License 2.0
324 stars 225 forks source link

--tool-help silently fails if parser can't be autogenerated #152

Open mr-c opened 7 years ago

mr-c commented 7 years ago

Example: https://raw.githubusercontent.com/common-workflow-language/workflows/master/tools/GATK-IndelRealigner.cwl

mr-c commented 7 years ago

Will output a useful error if --debug is specified, but initially given error is incorrect

(env) michael@dan:~/cwl-upgrader$ cwltool  --tool-help GATK-IndelRealigner.cwl 
/home/michael/cwl-upgrader/env/bin/cwltool 1.0.20160809155826
Got workflow error
Traceback (most recent call last):
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/main.py", line 211, in single_job_executor
    for r in jobiter:
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/draft2tool.py", line 233, in job
    builder = self._init_job(joborder, **kwargs)
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/process.py", line 400, in _init_job
    fillInDefaults(self.tool[u"inputs"], builder.job)
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/process.py", line 288, in fillInDefaults
    raise validate.ValidationException("Missing input parameter `%s`" % shortname(inp["id"]))
ValidationException: Missing input parameter `reference`
Workflow error, try again with --debug for more information:
  Missing input parameter `reference`

vs

(env) michael@dan:~/cwl-upgrader$ cwltool --debug --tool-help GATK-IndelRealigner.cwl 
/home/michael/cwl-upgrader/env/bin/cwltool 1.0.20160809155826
Can't make command line argument from double
Got workflow error
Traceback (most recent call last):
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/main.py", line 211, in single_job_executor
    for r in jobiter:
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/draft2tool.py", line 233, in job
    builder = self._init_job(joborder, **kwargs)
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/process.py", line 400, in _init_job
    fillInDefaults(self.tool[u"inputs"], builder.job)
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/process.py", line 288, in fillInDefaults
    raise validate.ValidationException("Missing input parameter `%s`" % shortname(inp["id"]))
ValidationException: Missing input parameter `reference`
Workflow error, try again with --debug for more information:
  Missing input parameter `reference`
Traceback (most recent call last):
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/main.py", line 715, in main
    **vars(args))
  File "/home/michael/cwl-upgrader/env/local/lib/python2.7/site-packages/cwltool/main.py", line 223, in single_job_executor
    raise WorkflowException(unicode(e))
WorkflowException: Missing input parameter `reference`