From 99b3ad15d0b2a92640cea8b83537f6f7bfc6b96f Mon Sep 17 00:00:00 2001 From: Rada Kamysheva Date: Fri, 3 Jul 2026 10:58:02 +0000 Subject: [PATCH] acc: run jobs destroy_without_mgmtperms/without_permissions locally Convert the destroy_without_mgmtperms/without_permissions acceptance test to run against the local testserver in addition to cloud. The guest-SP, permission-aware testserver model this test needs already landed with the sibling with_permissions test (#5769), so this change only flips the test to local and mirrors the local DATABRICKS_CLIENT_ID fallback. - test.toml: set Local = true so the test runs against the local testserver. - script: fall back DATABRICKS_CLIENT_ID to the current identity locally so the owner principal matches cloud. --- .../without_permissions/out.test.toml | 2 +- .../jobs/destroy_without_mgmtperms/without_permissions/script | 4 +++- .../destroy_without_mgmtperms/without_permissions/test.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/out.test.toml b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/out.test.toml index 4037e35bf87..9b877617211 100644 --- a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/out.test.toml +++ b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/out.test.toml @@ -1,4 +1,4 @@ -Local = false +Local = true Cloud = true RunsOnDbr = false CloudEnvs.azure = false diff --git a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/script b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/script index 94eb3132dbb..87a0ae407c6 100644 --- a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/script +++ b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/script @@ -1,5 +1,7 @@ envsubst < databricks.yml.tmpl > databricks.yml -envsubst < take_ownership.json.tmpl > take_ownership.json +# Locally DATABRICKS_CLIENT_ID is unset; fall back to the current identity so the +# owner matches cloud. Scoped to this command so CLI auth is unaffected. +DATABRICKS_CLIENT_ID="${DATABRICKS_CLIENT_ID:-$CURRENT_USER_NAME}" envsubst < take_ownership.json.tmpl > take_ownership.json trace cat take_ownership.json trace as-test-sp $CLI current-user me | jq .displayName diff --git a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/test.toml b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/test.toml index b6d371ec608..be2ea7b5242 100644 --- a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/test.toml +++ b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/test.toml @@ -1,4 +1,4 @@ -Local = false +Local = true Cloud = true RecordRequests = false CloudEnvs.gcp = false