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

Non list `listing` in `InitialWorkDirRequirement` passes validation

Open
#1,209 0 comments 0 reactions 1 assignee Claimed by @tetron View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

## Expected Behavior
```
class: CommandLineTool
cwlVersion: v1.0
inputs:
in1: File
baseCommand: echo
arguments:
- "Hi there"
outputs:
out1:
type: File
outputBinding:
glob: "*.txt"

requirements:
InitialWorkDirRequirement:
listing: $(inputs.in1)
```

should fail validation, because `listing` is not a list.

## Actual Behavior
This passes behavior. Then it causes `cwltool` to crash when actually running.

## Workflow Code
```
Paste the template code (ideally a minimal example) that causes the issue

```

## Full Traceback
```pytb
ERROR Unexpected exception
Traceback (most recent call last):
File "/Users/kghose/.venvs/benten/lib/python3.7/site-packages/cwltool/workflow.py", line 807, in job
runtimeContext):
File "/Users/kghose/.venvs/benten/lib/python3.7/site-packages/cwltool/command_line_tool.py", line 506, in job
self.updatePathmap(builder.outdir, builder.pathmapper, l)
File "/Users/kghose/.venvs/benten/lib/python3.7/site-packages/cwltool/command_line_tool.py", line 291, in updatePathmap
if "location" in fn and fn["location"] in pathmap:
TypeError: string indices must be integers
ERROR [step st2] Cannot make job: string indices must be integers
```

## Your Environment
* cwltool version: 1.0.20190915164430

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.