summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto López Martín <alberto.lopez@sidisel.com>2019-07-26 14:33:55 +0200
committerAlberto López Martín <alberto.lopez@sidisel.com>2019-07-26 14:33:55 +0200
commitf7f24bd324eaf33aa3d1d5dd12719237e5bf9816 (patch)
treec5e71793617867a6aebf3d6ea1b84e26c7774ca2
parenta3d0d7c1e7b259a25d9dc84c0b1de5362c80abb8 (diff)
downloadgitlab-f7f24bd324eaf33aa3d1d5dd12719237e5bf9816.tar.gz
test: add group label cli tests
-rwxr-xr-xtools/cli_test_v4.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/tools/cli_test_v4.sh b/tools/cli_test_v4.sh
index dea0509..dc6e0b2 100755
--- a/tools/cli_test_v4.sh
+++ b/tools/cli_test_v4.sh
@@ -25,6 +25,17 @@ testcase "project update" '
GITLAB project update --id "$PROJECT_ID" --description "My New Description"
'
+testcase "group creation" '
+ OUTPUT=$(try GITLAB group create --name test-group1 --path group1) || exit 1
+ GROUP_ID=$(pecho "${OUTPUT}" | grep ^id: | cut -d" " -f2)
+ OUTPUT=$(try GITLAB group list) || exit 1
+ pecho "${OUTPUT}" | grep -q test-group1
+'
+
+testcase "group update" '
+ GITLAB group update --id "$GROUP_ID" --description "My New Description"
+'
+
testcase "user creation" '
OUTPUT=$(GITLAB user create --email fake@email.com --username user1 \
--name "User One" --password fakepassword)
@@ -89,6 +100,46 @@ testcase "merge request validation" '
--iid "$MR_ID" >/dev/null 2>&1
'
+# Test project labels
+testcase "create project label" '
+ OUTPUT=$(GITLAB -v project-label create --project-id $PROJECT_ID \
+ --name prjlabel1 --description "prjlabel1 description" --color "#112233")
+'
+
+testcase "list project label" '
+ OUTPUT=$(GITLAB -v project-label list --project-id $PROJECT_ID)
+'
+
+testcase "update project label" '
+ OUTPUT=$(GITLAB -v project-label update --project-id $PROJECT_ID \
+ --name prjlabel1 --new-name prjlabel2 --description "prjlabel2 description" --color "#332211")
+'
+
+testcase "delete project label" '
+ OUTPUT=$(GITLAB -v project-label delete --project-id $PROJECT_ID \
+ --name prjlabel2)
+'
+
+# Test group labels
+testcase "create group label" '
+ OUTPUT=$(GITLAB -v group-label create --group-id $GROUP_ID \
+ --name grplabel1 --description "grplabel1 description" --color "#112233")
+'
+
+testcase "list group label" '
+ OUTPUT=$(GITLAB -v group-label list --group-id $GROUP_ID)
+'
+
+testcase "update group label" '
+ OUTPUT=$(GITLAB -v group-label update --group-id $GROUP_ID \
+ --name grplabel1 --new-name grplabel2 --description "grplabel2 description" --color "#332211")
+'
+
+testcase "delete group label" '
+ OUTPUT=$(GITLAB -v group-label delete --group-id $GROUP_ID \
+ --name grplabel2)
+'
+
# Test project variables
testcase "create project variable" '
OUTPUT=$(GITLAB -v project-variable create --project-id $PROJECT_ID \
@@ -128,6 +179,10 @@ testcase "project deletion" '
GITLAB project delete --id "$PROJECT_ID"
'
+testcase "group deletion" '
+ OUTPUT=$(try GITLAB group delete --id $GROUP_ID)
+'
+
testcase "application settings get" '
GITLAB application-settings get >/dev/null 2>&1
'
@@ -146,3 +201,4 @@ testcase "values from files" '
--description @/tmp/gitlab-project-description)
echo $OUTPUT | grep -q "Multi line"
'
+