Skip to content

Commit d6b95e7

Browse files
Do not run TestAccKeycloakRole_import in parallel with others because it deals with common default resource: account openid client and default roles
Signed-off-by: Mikhail Putilov <[email protected]>
1 parent 069ea39 commit d6b95e7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

provider/resource_keycloak_role_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ func TestAccKeycloakRole_importWithAttributes(t *testing.T) {
342342
}
343343

344344
func TestAccKeycloakRole_import(t *testing.T) {
345-
t.Parallel()
346-
347345
resource.Test(t, resource.TestCase{
348346
ProviderFactories: testAccProviderFactories,
349347
PreCheck: func() { testAccPreCheck(t) },
@@ -911,22 +909,24 @@ resource "keycloak_role" "%s" {
911909

912910
importedRoles += fmt.Sprintf(`
913911
import {
914-
id = "${data.keycloak_realm.realm.id}/%s" # 1 ClientId
915-
to = keycloak_openid_client.%s # 2 importedClientIdRef
912+
id = "${data.keycloak_realm.realm.id}/%s"
913+
to = keycloak_openid_client.%s
916914
}
917-
resource "keycloak_openid_client" "%s" { # 3 importedClientIdRef
918-
realm_id = data.keycloak_realm.realm.id
919-
client_id = "%s" # 4 ClientId
915+
resource "keycloak_openid_client" "%s" {
916+
realm_id = data.keycloak_realm.realm.id
917+
client_id = "%s"
920918
access_type = "PUBLIC"
921-
}
919+
}`, *nestedRole.ClientId, importedClientIdRef, importedClientIdRef, *nestedRole.ClientId)
920+
921+
importedRoles += fmt.Sprintf(`
922922
923-
resource "keycloak_role" "%s" { # 5 importedRoleRef
923+
resource "keycloak_role" "%s" {
924924
realm_id = data.keycloak_realm.realm.id
925-
client_id = keycloak_openid_client.%s.id # 6 importedClientIdRef
926-
name = "%s" # 7 nestedRole.Name
925+
client_id = keycloak_openid_client.%s.id
926+
name = "%s"
927927
import = true
928928
}
929-
`, *nestedRole.ClientId, importedClientIdRef, importedClientIdRef, *nestedRole.ClientId, importedRoleRef, importedClientIdRef, nestedRole.Name)
929+
`, importedRoleRef, importedClientIdRef, nestedRole.Name)
930930
}
931931

932932
if i != 0 {

0 commit comments

Comments
 (0)