Skip to content

Commit 07b00b2

Browse files
authored
Provided application_id when creating SP in databricks_access_control_rule_set resource integration test (and temporarily disabled this test outside of AWS) (#2542)
* Provide application_id when creating SP in Azure * Also skip outside aws for now
1 parent c8f3202 commit 07b00b2

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

internal/acceptance/account_rule_set_test.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package acceptance
22

33
import (
44
"context"
5+
"os"
56
"testing"
67

78
"github.com/databricks/databricks-sdk-go/service/iam"
@@ -10,12 +11,33 @@ import (
1011
"github.com/databricks/terraform-provider-databricks/common"
1112
)
1213

13-
func TestMwsAccAccountRuleSetsFullLifeCycle(t *testing.T) {
14-
accountLevel(t, step{
15-
Template: `
14+
// Application ID is mandatory in Azure today.
15+
func getServicePrincipalResource(cloudEnv string) string {
16+
if cloudEnv == "azure" {
17+
return `
1618
resource "databricks_service_principal" "this" {
19+
application_id = "{var.RANDOM_UUID}"
1720
display_name = "SPN {var.RANDOM}"
1821
}
22+
`
23+
}
24+
return `
25+
resource "databricks_service_principal" "this" {
26+
display_name = "SPN {var.RANDOM}"
27+
}
28+
`
29+
}
30+
31+
func TestMwsAccAccountRuleSetsFullLifeCycle(t *testing.T) {
32+
// This endpoint is restricted to basic auth today, used only by AWS account-level tests.
33+
// Remove this skip when this restriction is lifted in Azure & GCP.
34+
cloudEnv := os.Getenv("CLOUD_ENV")
35+
if cloudEnv != "aws" {
36+
t.Skip("Skipping test in Azure")
37+
}
38+
spResource := getServicePrincipalResource(cloudEnv)
39+
accountLevel(t, step{
40+
Template: spResource + `
1941
resource "databricks_group" "this" {
2042
display_name = "Group {var.RANDOM}"
2143
}

0 commit comments

Comments
 (0)