diff --git a/acceptance/auth/bundle_default_profile/databricks.yml b/acceptance/auth/bundle_default_profile/databricks.yml.no-host.tmpl similarity index 100% rename from acceptance/auth/bundle_default_profile/databricks.yml rename to acceptance/auth/bundle_default_profile/databricks.yml.no-host.tmpl diff --git a/acceptance/auth/bundle_default_profile/databricks.yml.with-host.tmpl b/acceptance/auth/bundle_default_profile/databricks.yml.with-host.tmpl new file mode 100644 index 00000000000..4c2f0748389 --- /dev/null +++ b/acceptance/auth/bundle_default_profile/databricks.yml.with-host.tmpl @@ -0,0 +1,5 @@ +bundle: + name: bundle-with-host + +workspace: + host: $DATABRICKS_HOST diff --git a/acceptance/auth/bundle_default_profile/databricks.yml.with-profile.tmpl b/acceptance/auth/bundle_default_profile/databricks.yml.with-profile.tmpl new file mode 100644 index 00000000000..18e719f0ea8 --- /dev/null +++ b/acceptance/auth/bundle_default_profile/databricks.yml.with-profile.tmpl @@ -0,0 +1,5 @@ +bundle: + name: bundle-with-profile + +workspace: + profile: other diff --git a/acceptance/auth/bundle_default_profile/script b/acceptance/auth/bundle_default_profile/script index 6c54b13c78f..793176c4b52 100644 --- a/acceptance/auth/bundle_default_profile/script +++ b/acceptance/auth/bundle_default_profile/script @@ -20,9 +20,11 @@ unset DATABRICKS_HOST unset DATABRICKS_TOKEN unset DATABRICKS_CONFIG_PROFILE +cp databricks.yml.no-host.tmpl databricks.yml title "Bundle without workspace.host: default_profile is honored\n" trace $CLI bundle validate -o json | jq '{host: .workspace.host, profile: .workspace.profile}' +cp databricks.yml.no-host.tmpl databricks.yml title "--profile overrides default_profile (negative case)\n" trace errcode $CLI bundle validate -p other -o json | jq '{host: .workspace.host, profile: .workspace.profile}' @@ -30,29 +32,13 @@ trace errcode $CLI bundle validate -p other -o json | jq '{host: .workspace.host # configureProfile must NOT apply default_profile here, because that would # silently route the user to a profile pointing at a different host than the # bundle declares. -mkdir -p ./bundle-with-host -cat > ./bundle-with-host/databricks.yml < databricks.yml title "Bundle with workspace.host: default_profile is NOT applied\n" -(cd ./bundle-with-host && trace errcode $CLI bundle validate -o json | jq '{host: .workspace.host, profile: .workspace.profile}') +trace errcode $CLI bundle validate -o json | jq '{host: .workspace.host, profile: .workspace.profile}' # Switch to a bundle that pins workspace.profile but no host. The pinned # profile must win over default_profile — configureProfile's guard skips # default_profile when workspace.profile is already set. -mkdir -p ./bundle-with-profile -cat > ./bundle-with-profile/databricks.yml <