Skip to content

Commit f7f24bd

Browse files
test: add group label cli tests
1 parent a3d0d7c commit f7f24bd

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

tools/cli_test_v4.sh

+56
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ testcase "project update" '
2525
GITLAB project update --id "$PROJECT_ID" --description "My New Description"
2626
'
2727

28+
testcase "group creation" '
29+
OUTPUT=$(try GITLAB group create --name test-group1 --path group1) || exit 1
30+
GROUP_ID=$(pecho "${OUTPUT}" | grep ^id: | cut -d" " -f2)
31+
OUTPUT=$(try GITLAB group list) || exit 1
32+
pecho "${OUTPUT}" | grep -q test-group1
33+
'
34+
35+
testcase "group update" '
36+
GITLAB group update --id "$GROUP_ID" --description "My New Description"
37+
'
38+
2839
testcase "user creation" '
2940
OUTPUT=$(GITLAB user create --email fake@email.com --username user1 \
3041
--name "User One" --password fakepassword)
@@ -89,6 +100,46 @@ testcase "merge request validation" '
89100
--iid "$MR_ID" >/dev/null 2>&1
90101
'
91102

103+
# Test project labels
104+
testcase "create project label" '
105+
OUTPUT=$(GITLAB -v project-label create --project-id $PROJECT_ID \
106+
--name prjlabel1 --description "prjlabel1 description" --color "#112233")
107+
'
108+
109+
testcase "list project label" '
110+
OUTPUT=$(GITLAB -v project-label list --project-id $PROJECT_ID)
111+
'
112+
113+
testcase "update project label" '
114+
OUTPUT=$(GITLAB -v project-label update --project-id $PROJECT_ID \
115+
--name prjlabel1 --new-name prjlabel2 --description "prjlabel2 description" --color "#332211")
116+
'
117+
118+
testcase "delete project label" '
119+
OUTPUT=$(GITLAB -v project-label delete --project-id $PROJECT_ID \
120+
--name prjlabel2)
121+
'
122+
123+
# Test group labels
124+
testcase "create group label" '
125+
OUTPUT=$(GITLAB -v group-label create --group-id $GROUP_ID \
126+
--name grplabel1 --description "grplabel1 description" --color "#112233")
127+
'
128+
129+
testcase "list group label" '
130+
OUTPUT=$(GITLAB -v group-label list --group-id $GROUP_ID)
131+
'
132+
133+
testcase "update group label" '
134+
OUTPUT=$(GITLAB -v group-label update --group-id $GROUP_ID \
135+
--name grplabel1 --new-name grplabel2 --description "grplabel2 description" --color "#332211")
136+
'
137+
138+
testcase "delete group label" '
139+
OUTPUT=$(GITLAB -v group-label delete --group-id $GROUP_ID \
140+
--name grplabel2)
141+
'
142+
92143
# Test project variables
93144
testcase "create project variable" '
94145
OUTPUT=$(GITLAB -v project-variable create --project-id $PROJECT_ID \
@@ -128,6 +179,10 @@ testcase "project deletion" '
128179
GITLAB project delete --id "$PROJECT_ID"
129180
'
130181

182+
testcase "group deletion" '
183+
OUTPUT=$(try GITLAB group delete --id $GROUP_ID)
184+
'
185+
131186
testcase "application settings get" '
132187
GITLAB application-settings get >/dev/null 2>&1
133188
'
@@ -146,3 +201,4 @@ testcase "values from files" '
146201
--description @/tmp/gitlab-project-description)
147202
echo $OUTPUT | grep -q "Multi line"
148203
'
204+

0 commit comments

Comments
 (0)