From 990a41340ca073cf3ad6db15159f6f075f2b356e Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sat, 4 Mar 2023 21:05:31 +0100 Subject: [PATCH] Test for ExpressionTool outputs validation Test that the output objects returned by an ExpressionTool process are validated against the `outputs` schema. This is not true for CWL <= v1.2, and has been fixed for CWL >= v1.3 --- conformance_tests.yaml | 6 ++++++ tests/null-expression3-tool.cwl | 2 +- tests/null-expression4-tool.cwl | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/null-expression4-tool.cwl diff --git a/conformance_tests.yaml b/conformance_tests.yaml index f6bfd92..9a3f1f3 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3392,3 +3392,9 @@ } } tags: [ required, command_line_tool ] + +- id: invalid_expression_tool_output + tool: tests/null-expression4-tool.cwl + doc: Test that the output objects returned by an ExpressionTool process are validated against the outputs schema. + should_fail: true + tags: [ inline_javascript, expression_tool ] diff --git a/tests/null-expression3-tool.cwl b/tests/null-expression3-tool.cwl index 9d8da1a..14dc88b 100644 --- a/tests/null-expression3-tool.cwl +++ b/tests/null-expression3-tool.cwl @@ -7,6 +7,6 @@ cwlVersion: v1.3.0-dev1 inputs: [] outputs: - output: Any + output: Any? expression: "$({'output': null })" diff --git a/tests/null-expression4-tool.cwl b/tests/null-expression4-tool.cwl new file mode 100644 index 0000000..9d8da1a --- /dev/null +++ b/tests/null-expression4-tool.cwl @@ -0,0 +1,12 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: { InlineJavascriptRequirement: {} } +cwlVersion: v1.3.0-dev1 + +inputs: [] + +outputs: + output: Any + +expression: "$({'output': null })"