@@ -134,6 +134,16 @@ func TestAccGitlabGroup_nested(t *testing.T) {
134
134
var group gitlab.Group
135
135
var group2 gitlab.Group
136
136
var nestedGroup gitlab.Group
137
+ var lastGid int
138
+ testGidNotChanged := func (s * terraform.State ) error {
139
+ if lastGid == 0 {
140
+ lastGid = nestedGroup .ID
141
+ }
142
+ if lastGid != nestedGroup .ID {
143
+ return fmt .Errorf ("group id changed" )
144
+ }
145
+ return nil
146
+ }
137
147
rInt := acctest .RandInt ()
138
148
139
149
resource .Test (t , resource.TestCase {
@@ -157,8 +167,8 @@ func TestAccGitlabGroup_nested(t *testing.T) {
157
167
TwoFactorGracePeriod : 48 , // default value
158
168
DefaultBranchProtection : 2 , // default value
159
169
Parent : & group ,
160
- AutoDevopsEnabled : true ,
161
170
}),
171
+ testGidNotChanged ,
162
172
),
163
173
},
164
174
{
@@ -178,8 +188,8 @@ func TestAccGitlabGroup_nested(t *testing.T) {
178
188
TwoFactorGracePeriod : 48 , // default value
179
189
DefaultBranchProtection : 2 , // default value
180
190
Parent : & group2 ,
181
- AutoDevopsEnabled : true ,
182
191
}),
192
+ testGidNotChanged ,
183
193
),
184
194
},
185
195
{
@@ -199,6 +209,7 @@ func TestAccGitlabGroup_nested(t *testing.T) {
199
209
TwoFactorGracePeriod : 48 , // default value
200
210
DefaultBranchProtection : 2 , // default value
201
211
}),
212
+ testGidNotChanged ,
202
213
),
203
214
},
204
215
{
@@ -219,6 +230,7 @@ func TestAccGitlabGroup_nested(t *testing.T) {
219
230
DefaultBranchProtection : 2 , // default value
220
231
Parent : & group ,
221
232
}),
233
+ testGidNotChanged ,
222
234
),
223
235
},
224
236
},
@@ -503,12 +515,6 @@ resource "gitlab_group" "nested_foo" {
503
515
# So that acceptance tests can be run in a gitlab organization
504
516
# with no billing
505
517
visibility_level = "public"
506
-
507
- # We set this to a non-default value to check later whether the group was recreated or not
508
- auto_devops_enabled = true
509
- lifecycle {
510
- ignore_changes = [auto_devops_enabled]
511
- }
512
518
}
513
519
` , rInt , rInt , rInt , rInt , rInt , rInt )
514
520
}
@@ -574,11 +580,6 @@ resource "gitlab_group" "nested_foo" {
574
580
# So that acceptance tests can be run in a gitlab organization
575
581
# with no billing
576
582
visibility_level = "public"
577
-
578
- # We need to read this value to check if the group is recreated or not
579
- lifecycle {
580
- ignore_changes = [auto_devops_enabled]
581
- }
582
583
}
583
584
` , rInt , rInt , rInt , rInt , rInt , rInt )
584
585
}
0 commit comments