diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..b02c17ce9 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,3 @@ +codecov: + notify: + wait_for_ci: yes diff --git a/cwltool/workflow_job.py b/cwltool/workflow_job.py index 24ca5cec8..bd195be9e 100644 --- a/cwltool/workflow_job.py +++ b/cwltool/workflow_job.py @@ -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, diff --git a/tests/test_conditionals.py b/tests/test_conditionals.py new file mode 100644 index 000000000..8665f1e3a --- /dev/null +++ b/tests/test_conditionals.py @@ -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 diff --git a/tests/wf/conditional_step_no_inputs.cwl b/tests/wf/conditional_step_no_inputs.cwl new file mode 100644 index 000000000..ed8240a10 --- /dev/null +++ b/tests/wf/conditional_step_no_inputs.cwl @@ -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