Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codecov:
notify:
wait_for_ci: yes
1 change: 0 additions & 1 deletion cwltool/workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ def valueFromFunc(
None,
None,
{},
context=cast(Optional[CWLObjectType], v),
debug=runtimeContext.debug,
js_console=runtimeContext.js_console,
timeout=runtimeContext.eval_timeout,
Expand Down
19 changes: 19 additions & 0 deletions tests/test_conditionals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Tests related to CWL v1.2+ "when" expressions and conditional handling."""

import json
import re

from .util import get_data, get_main_output


def test_conditional_step_no_inputs() -> None:
"""Confirm fix for bug that populated `self` object for `when` expressions."""
err_code, stdout, stderr = get_main_output(
[
get_data("tests/wf/conditional_step_no_inputs.cwl"),
]
)
result = json.loads(stdout)["required"]
stderr = re.sub(r"\s\s+", " ", stderr)
assert err_code == 0, stderr
assert result is None
28 changes: 28 additions & 0 deletions tests/wf/conditional_step_no_inputs.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: Workflow

requirements:
InlineJavascriptRequirement: {}

inputs: []

steps:
step1:
in: {}
when: $(self !== null)
run:
class: ExpressionTool
inputs: []
requirements:
InlineJavascriptRequirement: {}
expression: |
$({"result": "huzzah!"})
outputs:
result: string
out: [ result ]

outputs:
required:
type: string
outputSource: step1/result