@@ -52,6 +52,34 @@ func TestAccGitlabGroupLabel_basic(t *testing.T) {
5252 }),
5353 ),
5454 },
55+ {
56+ Config : testAccGitlabGroupLabelLargeConfig (rInt ),
57+ Check : resource .ComposeTestCheckFunc (
58+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.20" , & label ),
59+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.30" , & label ),
60+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.40" , & label ),
61+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.10" , & label ),
62+ testAccCheckGitlabGroupLabelAttributes (& label , & testAccGitlabGroupLabelExpectedAttributes {
63+ Name : "FIXME11" ,
64+ Color : "#ffcc00" ,
65+ Description : "fix this test" ,
66+ }),
67+ ),
68+ },
69+ {
70+ Config : testAccGitlabGroupLabelUpdateLargeConfig (rInt ),
71+ Check : resource .ComposeTestCheckFunc (
72+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.20" , & label ),
73+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.30" , & label ),
74+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.40" , & label ),
75+ testAccCheckGitlabGroupLabelExists ("gitlab_group_label.fixme.10" , & label ),
76+ testAccCheckGitlabGroupLabelAttributes (& label , & testAccGitlabGroupLabelExpectedAttributes {
77+ Name : "FIXME11" ,
78+ Color : "#ff0000" ,
79+ Description : "red label" ,
80+ }),
81+ ),
82+ },
5583 },
5684 })
5785}
@@ -70,7 +98,7 @@ func testAccCheckGitlabGroupLabelExists(n string, label *gitlab.GroupLabel) reso
7098 }
7199 conn := testAccProvider .Meta ().(* gitlab.Client )
72100
73- labels , _ , err := conn .GroupLabels .ListGroupLabels (groupName , nil )
101+ labels , _ , err := conn .GroupLabels .ListGroupLabels (groupName , & gitlab. ListGroupLabelsOptions { PerPage : 1000 } )
74102 if err != nil {
75103 return err
76104 }
@@ -167,3 +195,41 @@ resource "gitlab_group_label" "fixme" {
167195}
168196 ` , rInt , rInt , rInt )
169197}
198+
199+ func testAccGitlabGroupLabelLargeConfig (rInt int ) string {
200+ return fmt .Sprintf (`
201+ resource "gitlab_group" "foo" {
202+ name = "foo-%d"
203+ path = "foo-%d"
204+ description = "Terraform acceptance tests"
205+ visibility_level = "public"
206+ }
207+
208+ resource "gitlab_group_label" "fixme" {
209+ group = "${gitlab_group.foo.id}"
210+ name = format("FIXME%%02d", count.index+1)
211+ count = 100
212+ color = "#ffcc00"
213+ description = "fix this test"
214+ }
215+ ` , rInt , rInt )
216+ }
217+
218+ func testAccGitlabGroupLabelUpdateLargeConfig (rInt int ) string {
219+ return fmt .Sprintf (`
220+ resource "gitlab_group" "foo" {
221+ name = "foo-%d"
222+ path = "foo-%d"
223+ description = "Terraform acceptance tests"
224+ visibility_level = "public"
225+ }
226+
227+ resource "gitlab_group_label" "fixme" {
228+ group = "${gitlab_group.foo.id}"
229+ name = format("FIXME%%02d", count.index+1)
230+ count = 99
231+ color = "#ff0000"
232+ description = "red label"
233+ }
234+ ` , rInt , rInt )
235+ }
0 commit comments