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

ExpressionTool doesn't check output types

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

Description

CWL Specification explicitly states that

> The `Any` type validates for any non-null value.

However, cwtool does not fail when a step produces a null output for a port of type `Any`. Instead, the behavior is correct for input ports. As a concrete example, the following `ExpressionTool` should clearly fail, but it doesn't.

```yaml
#!/usr/bin/env cwl-runner

class: ExpressionTool
requirements: { InlineJavascriptRequirement: {} }
cwlVersion: v1.0

inputs: []

outputs:
output: Any

expression: "$({'output': null })"
```

Note also that this file is involved in 2 CWL Conformance tests cases, `step_input_default_value_overriden_2nd_step_null` and `step_input_default_value_overriden_2nd_step_null_noexp`. Therefore, it is quite crucial to establish the correct behavior here.

Contributor guide

Open the contributing guide

Research direction

Run the supplied cwl-runner ExpressionTool example first, then trace ExpressionTool output validation and the conformance cases step_input_default_value_overriden_2nd_step_null and step_input_default_value_overriden_2nd_step_null_noexp. Done means a null output for Any fails while input-port behavior remains correct and the conformance cases reflect the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.