@@ -28,7 +28,7 @@ func TestAccGitlabGroupLdapLink_basic(t *testing.T) {
28
28
29
29
// Create a group LDAP link as a developer (uses testAccGitlabGroupLdapLinkCreateConfig for Config)
30
30
{
31
- SkipFunc : testAccGitlabGroupLdapLinkSkipFunc ( testLdapLink . CN , testLdapLink . Provider ) ,
31
+ SkipFunc : isRunningInCE ,
32
32
Config : testAccGitlabGroupLdapLinkCreateConfig (rInt , & testLdapLink ),
33
33
Check : resource .ComposeTestCheckFunc (
34
34
testAccCheckGitlabGroupLdapLinkExists ("gitlab_group_ldap_link.foo" , & ldapLink ),
@@ -39,39 +39,18 @@ func TestAccGitlabGroupLdapLink_basic(t *testing.T) {
39
39
40
40
// Update the group LDAP link to change the access level (uses testAccGitlabGroupLdapLinkUpdateConfig for Config)
41
41
{
42
- SkipFunc : testAccGitlabGroupLdapLinkSkipFunc ( testLdapLink . CN , testLdapLink . Provider ) ,
42
+ SkipFunc : isRunningInCE ,
43
43
Config : testAccGitlabGroupLdapLinkUpdateConfig (rInt , & testLdapLink ),
44
44
Check : resource .ComposeTestCheckFunc (
45
45
testAccCheckGitlabGroupLdapLinkExists ("gitlab_group_ldap_link.foo" , & ldapLink ),
46
46
testAccCheckGitlabGroupLdapLinkAttributes (& ldapLink , & testAccGitlabGroupLdapLinkExpectedAttributes {
47
47
accessLevel : fmt .Sprintf ("maintainer" ), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
48
48
})),
49
49
},
50
-
51
- // Force create the same group LDAP link in a different resource (uses testAccGitlabGroupLdapLinkForceCreateConfig for Config)
52
- {
53
- SkipFunc : testAccGitlabGroupLdapLinkSkipFunc (testLdapLink .CN , testLdapLink .Provider ),
54
- Config : testAccGitlabGroupLdapLinkForceCreateConfig (rInt , & testLdapLink ),
55
- Check : resource .ComposeTestCheckFunc (
56
- testAccCheckGitlabGroupLdapLinkExists ("gitlab_group_ldap_link.bar" , & ldapLink ),
57
- testAccCheckGitlabGroupLdapLinkAttributes (& ldapLink , & testAccGitlabGroupLdapLinkExpectedAttributes {
58
- accessLevel : fmt .Sprintf ("developer" ), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
59
- })),
60
- },
61
50
},
62
51
})
63
52
}
64
53
65
- func testAccGitlabGroupLdapLinkSkipFunc (testCN string , testProvider string ) func () (bool , error ) {
66
- return func () (bool , error ) {
67
- if testCN == "default" || testProvider == "default" {
68
- return true , nil
69
- }
70
-
71
- return isRunningInCE ()
72
- }
73
- }
74
-
75
54
func testAccCheckGitlabGroupLdapLinkExists (resourceName string , ldapLink * gitlab.LDAPGroupLink ) resource.TestCheckFunc {
76
55
return func (s * terraform.State ) error {
77
56
// Clear the "found" LDAP link before checking for existence
@@ -219,27 +198,3 @@ resource "gitlab_group_ldap_link" "foo" {
219
198
ldap_provider = "%s"
220
199
}` , rInt , rInt , testLdapLink .CN , testLdapLink .Provider )
221
200
}
222
-
223
- func testAccGitlabGroupLdapLinkForceCreateConfig (rInt int , testLdapLink * gitlab.LDAPGroupLink ) string {
224
- return fmt .Sprintf (`
225
- resource "gitlab_group" "foo" {
226
- name = "foo%d"
227
- path = "foo%d"
228
- description = "Terraform acceptance test - Group LDAP Links 3"
229
- }
230
-
231
- resource "gitlab_group_ldap_link" "foo" {
232
- group_id = "${gitlab_group.foo.id}"
233
- cn = "%s"
234
- group_access = "maintainer"
235
- ldap_provider = "%s"
236
- }
237
-
238
- resource "gitlab_group_ldap_link" "bar" {
239
- group_id = "${gitlab_group.foo.id}"
240
- cn = "%s"
241
- group_access = "developer"
242
- ldap_provider = "%s"
243
- force = true
244
- }` , rInt , rInt , testLdapLink .CN , testLdapLink .Provider , testLdapLink .CN , testLdapLink .Provider )
245
- }
0 commit comments