From 560c3d352e886aef6d3a2f1a38cb91e4f9da83f2 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 17 Jan 2025 14:40:19 +0100 Subject: [PATCH] Add test for passing --var twice for the same arg (#2176) This shows that passing two --var for the same arg is rejected currently. --- .../variables/arg-repeat/databricks.yml | 6 ++++++ .../bundle/variables/arg-repeat/output.txt | 20 +++++++++++++++++++ acceptance/bundle/variables/arg-repeat/script | 2 ++ 3 files changed, 28 insertions(+) create mode 100644 acceptance/bundle/variables/arg-repeat/databricks.yml create mode 100644 acceptance/bundle/variables/arg-repeat/output.txt create mode 100644 acceptance/bundle/variables/arg-repeat/script diff --git a/acceptance/bundle/variables/arg-repeat/databricks.yml b/acceptance/bundle/variables/arg-repeat/databricks.yml new file mode 100644 index 000000000..377c6cfab --- /dev/null +++ b/acceptance/bundle/variables/arg-repeat/databricks.yml @@ -0,0 +1,6 @@ +bundle: + name: arg-repeat + +variables: + a: + default: hello diff --git a/acceptance/bundle/variables/arg-repeat/output.txt b/acceptance/bundle/variables/arg-repeat/output.txt new file mode 100644 index 000000000..48bd2033f --- /dev/null +++ b/acceptance/bundle/variables/arg-repeat/output.txt @@ -0,0 +1,20 @@ + +>>> errcode $CLI bundle validate --var a=one -o json + +Exit code: 0 +{ + "a": { + "default": "hello", + "value": "one" + } +} + +>>> errcode $CLI bundle validate --var a=one --var a=two +Error: failed to assign two to a: variable has already been assigned value: one + +Name: arg-repeat +Target: default + +Found 1 error + +Exit code: 1 diff --git a/acceptance/bundle/variables/arg-repeat/script b/acceptance/bundle/variables/arg-repeat/script new file mode 100644 index 000000000..3e03dbcb1 --- /dev/null +++ b/acceptance/bundle/variables/arg-repeat/script @@ -0,0 +1,2 @@ +trace errcode $CLI bundle validate --var a=one -o json | jq .variables +trace errcode $CLI bundle validate --var a=one --var a=two