From fa3036573f134592f4147648fc4741de58e59c19 Mon Sep 17 00:00:00 2001 From: Manabu ISHII Date: Wed, 6 Apr 2022 16:24:31 +0900 Subject: [PATCH] Add test case for fail uncconected ExpressionTool Original PullRequest common-workflow-language/cwltool#1566 Original Issue common-workflow-language/cwltool#1330 --- conformance_tests.yaml | 10 ++++++++++ tests/fail-unconnected-expressiontool.cwl | 20 +++++++++++++++++++ .../fail-unspecified-input-expressiontool.cwl | 18 +++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 tests/fail-unconnected-expressiontool.cwl create mode 100644 tests/fail-unspecified-input-expressiontool.cwl diff --git a/conformance_tests.yaml b/conformance_tests.yaml index b4948178..c1d05d85 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3150,6 +3150,16 @@ } tags: [ required, command_line_tool ] +- job: tests/empty.json + tool: tests/fail-unconnected-expressiontool.cwl + label: wf_step_access_undeclared_param_expressiontool + id: 258 + doc: >- + Test that parameters that don't appear in the `run` process + inputs are not present in the input object used to run the expressiontool. + should_fail: true + tags: [ required, workflow ] + - $import: tests/string-interpolation/test-index.yaml - $import: tests/conditionals/test-index.yaml diff --git a/tests/fail-unconnected-expressiontool.cwl b/tests/fail-unconnected-expressiontool.cwl new file mode 100644 index 00000000..05fbf906 --- /dev/null +++ b/tests/fail-unconnected-expressiontool.cwl @@ -0,0 +1,20 @@ +class: Workflow +cwlVersion: v1.1 +inputs: + inp1: + type: string + default: hello inp1 + inp2: + type: string + default: hello inp2 +outputs: + out: + type: string + outputSource: step1/out +steps: + step1: + in: + in: inp1 + in2: inp2 + out: [out] + run: fail-unspecified-input-expressiontool.cwl diff --git a/tests/fail-unspecified-input-expressiontool.cwl b/tests/fail-unspecified-input-expressiontool.cwl new file mode 100644 index 00000000..e9cf15aa --- /dev/null +++ b/tests/fail-unspecified-input-expressiontool.cwl @@ -0,0 +1,18 @@ +cwlVersion: v1.0 +class: ExpressionTool + +requirements: + InlineJavascriptRequirement: {} + +inputs: + in: + type: string + +outputs: + out: + type: string + +expression: | + ${ + return {"out": inputs.in +" "+inputs.in2}; + }