From 59dc2a4b571f22353754df294a18f712581b35b0 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 29 Nov 2024 16:20:50 +0100 Subject: [PATCH] Add test for default value with optional input --- .../default_values_optional.gxwf-tests.yml | 34 +++++++++++++++++++ .../workflow/default_values_optional.gxwf.yml | 18 ++++++++++ 2 files changed, 52 insertions(+) create mode 100644 lib/galaxy_test/workflow/default_values_optional.gxwf-tests.yml create mode 100644 lib/galaxy_test/workflow/default_values_optional.gxwf.yml diff --git a/lib/galaxy_test/workflow/default_values_optional.gxwf-tests.yml b/lib/galaxy_test/workflow/default_values_optional.gxwf-tests.yml new file mode 100644 index 00000000000..7af1432006c --- /dev/null +++ b/lib/galaxy_test/workflow/default_values_optional.gxwf-tests.yml @@ -0,0 +1,34 @@ +- doc: | + Test that default value doesn't need to be supplied + job: {} + outputs: + out: + class: File + asserts: + - that: has_text + text: "1" +- doc: | + Test that null is replaced with default value (follows https://www.commonwl.org/v1.2/Workflow.html#WorkflowInputParameter) + job: + optional_int_with_default: + type: raw + value: null + outputs: + out: + class: File + asserts: + - that: has_text + text: "1" +- doc: | + Test that empty string is not replaced and fails + expect_failure: true + job: + optional_int_with_default: + type: raw + value: "" + outputs: + out: + class: File + asserts: + - that: has_text + text: "1" diff --git a/lib/galaxy_test/workflow/default_values_optional.gxwf.yml b/lib/galaxy_test/workflow/default_values_optional.gxwf.yml new file mode 100644 index 00000000000..4df2e2528cc --- /dev/null +++ b/lib/galaxy_test/workflow/default_values_optional.gxwf.yml @@ -0,0 +1,18 @@ +class: GalaxyWorkflow +inputs: + optional_int_with_default: + type: int + default: 1 + optional: true +outputs: + out: + outputSource: integer_default/out_file1 +steps: + integer_default: + tool_id: integer_default + tool_state: + input1: 0 + input2: 0 + in: + input3: + source: optional_int_with_default