From ccb2599b422c7c208d13ae32be0748bc48f67e49 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 14 Jan 2025 16:38:20 +0100 Subject: [PATCH] Add complex-transitive-deeper acceptance test (#2140) Extension of complex-transitive test that shows an error instead of simply failing to interpolate. --- .../complex-transitive-deeper/databricks.yml | 22 +++++++++++++++++++ .../complex-transitive-deeper/output.txt | 7 ++++++ .../complex-transitive-deeper/script | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 acceptance/bundle/variables/complex-transitive-deeper/databricks.yml create mode 100644 acceptance/bundle/variables/complex-transitive-deeper/output.txt create mode 100644 acceptance/bundle/variables/complex-transitive-deeper/script diff --git a/acceptance/bundle/variables/complex-transitive-deeper/databricks.yml b/acceptance/bundle/variables/complex-transitive-deeper/databricks.yml new file mode 100644 index 000000000..3f9bea464 --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deeper/databricks.yml @@ -0,0 +1,22 @@ +bundle: + name: complex-transitive-deeper + +variables: + catalog_1: + default: + name: hive_metastore + catalog: + default: ${var.catalog_1} + spark_conf: + default: + "spark.databricks.sql.initial.catalog.name": ${var.catalog.name} + etl_cluster_config: + type: complex + default: + spark_version: 14.3.x-scala2.12 + runtime_engine: PHOTON + spark_conf: ${var.spark_conf} + +resources: + clusters: + my_cluster: ${var.etl_cluster_config} diff --git a/acceptance/bundle/variables/complex-transitive-deeper/output.txt b/acceptance/bundle/variables/complex-transitive-deeper/output.txt new file mode 100644 index 000000000..3bedbfb9a --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deeper/output.txt @@ -0,0 +1,7 @@ +Error: expected a map to index "variables.catalog.value.name", found string + +{ + "my_cluster": "${var.etl_cluster_config}" +} + +Exit code: 1 diff --git a/acceptance/bundle/variables/complex-transitive-deeper/script b/acceptance/bundle/variables/complex-transitive-deeper/script new file mode 100644 index 000000000..d4fb404b1 --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deeper/script @@ -0,0 +1,2 @@ +# Currently, this errors instead of interpolating variables +$CLI bundle validate -o json | jq '.resources.clusters'