From cae21b36de7451f7a78ede1b44711ebdd55cd7f4 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 13 Jan 2025 13:31:09 +0100 Subject: [PATCH] Add a test re using variable in host (#2117) Related issue: https://github.com/databricks/cli/issues/2095 --- .../bundle/variables/host/databricks.yml | 10 +++++ acceptance/bundle/variables/host/output.txt | 38 +++++++++++++++++++ acceptance/bundle/variables/host/script | 2 + 3 files changed, 50 insertions(+) create mode 100644 acceptance/bundle/variables/host/databricks.yml create mode 100644 acceptance/bundle/variables/host/output.txt create mode 100644 acceptance/bundle/variables/host/script diff --git a/acceptance/bundle/variables/host/databricks.yml b/acceptance/bundle/variables/host/databricks.yml new file mode 100644 index 000000000..b25020a1f --- /dev/null +++ b/acceptance/bundle/variables/host/databricks.yml @@ -0,0 +1,10 @@ +bundle: + name: host + +variables: + host: + default: https://nonexistent123.staging.cloud.databricks.com + +workspace: + # This is currently not supported + host: ${var.host} diff --git a/acceptance/bundle/variables/host/output.txt b/acceptance/bundle/variables/host/output.txt new file mode 100644 index 000000000..89342908c --- /dev/null +++ b/acceptance/bundle/variables/host/output.txt @@ -0,0 +1,38 @@ + +>>> errcode $CLI bundle validate -o json +Error: failed during request visitor: parse "https://${var.host}": invalid character "{" in host name + +{ + "bundle": { + "environment": "default", + "name": "host", + "target": "default" + }, + "sync": { + "paths": [ + "." + ] + }, + "targets": null, + "variables": { + "host": { + "default": "https://nonexistent123.staging.cloud.databricks.com" + } + }, + "workspace": { + "host": "${var.host}" + } +} +Exit code: 1 + +>>> errcode $CLI bundle validate +Error: failed during request visitor: parse "https://${var.host}": invalid character "{" in host name + +Name: host +Target: default +Workspace: + Host: ${var.host} + +Found 1 error + +Exit code: 1 diff --git a/acceptance/bundle/variables/host/script b/acceptance/bundle/variables/host/script new file mode 100644 index 000000000..90e083627 --- /dev/null +++ b/acceptance/bundle/variables/host/script @@ -0,0 +1,2 @@ +trace errcode $CLI bundle validate -o json +trace errcode $CLI bundle validate