Skip to content

Commit

Permalink
Fix acceptance/bundle/variables/env_overrides when running on cloud
Browse files Browse the repository at this point in the history
It uses workspace.profile, which is used before variables are interpolated,
which breaks when this test is run against cloud.

Needed for #2242
  • Loading branch information
denik committed Jan 28, 2025
1 parent 6b9be38 commit 6392550
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions acceptance/bundle/variables/env_overrides/databricks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ variables:
description: variable with lookup
lookup:
cluster_policy: wrong-cluster-policy

result:
default: ${var.a} ${var.b}

bundle:
name: test bundle

workspace:
profile: ${var.a} ${var.b}

targets:
env-with-single-variable-override:
variables:
Expand Down
3 changes: 2 additions & 1 deletion acceptance/bundle/variables/env_overrides/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Exit code: 1
"b": "prod-b",
"d": "4321",
"e": "1234",
"f": "9876"
"f": "9876",
"result": "default-a prod-b"
}
6 changes: 3 additions & 3 deletions acceptance/bundle/variables/env_overrides/script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
trace $CLI bundle validate -t env-with-single-variable-override -o json | jq .workspace.profile
trace $CLI bundle validate -t env-with-two-variable-overrides -o json | jq .workspace.profile
trace BUNDLE_VAR_b=env-var-b $CLI bundle validate -t env-with-two-variable-overrides -o json | jq .workspace.profile
trace $CLI bundle validate -t env-with-single-variable-override -o json | jq .variables.result.value
trace $CLI bundle validate -t env-with-two-variable-overrides -o json | jq .variables.result.value
trace BUNDLE_VAR_b=env-var-b $CLI bundle validate -t env-with-two-variable-overrides -o json | jq .variables.result.value
trace errcode $CLI bundle validate -t env-missing-a-required-variable-assignment
trace errcode $CLI bundle validate -t env-using-an-undefined-variable
trace $CLI bundle validate -t env-overrides-lookup -o json | jq '.variables | map_values(.value)'

0 comments on commit 6392550

Please sign in to comment.