@@ -18,69 +18,65 @@ setenv_script=$(dirname "$0")/build_test_env.sh || exit 1
18
18
BUILD_TEST_ENV_AUTO_CLEANUP=true
19
19
. " $setenv_script " " $@ " || exit 1
20
20
21
- printf %s " Testing project creation... "
22
- OUTPUT=$( try GITLAB project create --name test-project1) || exit 1
23
- PROJECT_ID=$( pecho " ${OUTPUT} " | grep ^id: | cut -d' ' -f2)
24
- OUTPUT=$( try GITLAB project list) || exit 1
25
- pecho " ${OUTPUT} " | grep -q test-project1 || fatal " test failed "
26
- OK
21
+ testcase " project creation" '
22
+ OUTPUT=$(try GITLAB project create --name test-project1) || exit 1
23
+ PROJECT_ID=$(pecho "${OUTPUT}" | grep ^id: | cut -d" " -f2)
24
+ OUTPUT=$(try GITLAB project list) || exit 1
25
+ pecho "${OUTPUT}" | grep -q test-project1
26
+ '
27
27
28
- printf %s " Testing project update... "
29
- GITLAB project update --id " $PROJECT_ID " --description " My New Description" \
30
- || fatal " test failed"
31
- OK
28
+ testcase " project update" '
29
+ GITLAB project update --id "$PROJECT_ID" --description "My New Description"
30
+ '
32
31
33
- printf %s " Testing user creation... "
34
- OUTPUT=$( GITLAB user create --email fake@email.com --username user1 \
35
- --name " User One" --password fakepassword) || fatal " test failed "
36
- OK
32
+ testcase " user creation" '
33
+ OUTPUT=$(GITLAB user create --email fake@email.com --username user1 \
34
+ --name "User One" --password fakepassword)
35
+ '
37
36
USER_ID=$( pecho " ${OUTPUT} " | grep ^id: | cut -d' ' -f2)
38
37
39
- printf %s " Testing verbose output... "
40
- OUTPUT=$( try GITLAB -v user list) || exit 1
41
- pecho " ${OUTPUT} " | grep -q avatar-url || fatal " test failed "
42
- OK
38
+ testcase " verbose output" '
39
+ OUTPUT=$(try GITLAB -v user list) || exit 1
40
+ pecho "${OUTPUT}" | grep -q avatar-url
41
+ '
43
42
44
- printf %s " Testing CLI args not in output... "
45
- OUTPUT=$( try GITLAB -v user list) || exit 1
46
- pecho " ${OUTPUT} " | grep -qv config-file || fatal " test failed "
47
- OK
43
+ testcase " CLI args not in output" '
44
+ OUTPUT=$(try GITLAB -v user list) || exit 1
45
+ pecho "${OUTPUT}" | grep -qv config-file
46
+ '
48
47
49
- printf %s " Testing adding member to a project... "
50
- GITLAB project-member create --project-id " $PROJECT_ID " \
51
- --user-id " $USER_ID " --access-level 40 > /dev/null 2>&1 \
52
- || fatal " test failed"
53
- OK
48
+ testcase " adding member to a project" '
49
+ GITLAB project-member create --project-id "$PROJECT_ID" \
50
+ --user-id "$USER_ID" --access-level 40 >/dev/null 2>&1
51
+ '
54
52
55
- printf %s " Testing file creation... "
56
- GITLAB project-file create --project-id " $PROJECT_ID " \
57
- --file-path README --branch-name master --content " CONTENT" \
58
- --commit-message " Initial commit" > /dev/null 2>&1 || fatal " test failed "
59
- OK
53
+ testcase " file creation" '
54
+ GITLAB project-file create --project-id "$PROJECT_ID" \
55
+ --file-path README --branch-name master --content "CONTENT" \
56
+ --commit-message "Initial commit" >/dev/null 2>&1
57
+ '
60
58
61
- printf %s " Testing issue creation... "
62
- OUTPUT=$( GITLAB project-issue create --project-id " $PROJECT_ID " \
63
- --title " my issue" --description " my issue description" ) \
64
- || fatal " test failed"
65
- OK
59
+ testcase " issue creation" '
60
+ OUTPUT=$(GITLAB project-issue create --project-id "$PROJECT_ID" \
61
+ --title "my issue" --description "my issue description")
62
+ '
66
63
ISSUE_ID=$( pecho " ${OUTPUT} " | grep ^id: | cut -d' ' -f2)
67
64
68
- printf %s " Testing note creation... "
69
- GITLAB project-issue-note create --project-id " $PROJECT_ID " \
70
- --issue-id " $ISSUE_ID " --body " the body" > /dev/null 2>&1 \
71
- || fatal " test failed"
72
- OK
65
+ testcase " note creation" '
66
+ GITLAB project-issue-note create --project-id "$PROJECT_ID" \
67
+ --issue-id "$ISSUE_ID" --body "the body" >/dev/null 2>&1
68
+ '
73
69
74
- printf %s " Testing branch creation... "
75
- GITLAB project-branch create --project-id " $PROJECT_ID " \
76
- --branch-name branch1 --ref master > /dev/null 2>&1 || fatal " test failed "
77
- OK
70
+ testcase " branch creation" '
71
+ GITLAB project-branch create --project-id "$PROJECT_ID" \
72
+ --branch-name branch1 --ref master >/dev/null 2>&1
73
+ '
78
74
79
- printf %s " Testing branch deletion... "
80
- GITLAB project-branch delete --project-id " $PROJECT_ID " \
81
- --name branch1 > /dev/null 2>&1 || fatal " test failed "
82
- OK
75
+ testcase " branch deletion" '
76
+ GITLAB project-branch delete --project-id "$PROJECT_ID" \
77
+ --name branch1 >/dev/null 2>&1
78
+ '
83
79
84
- printf %s " Testing project deletion... "
85
- GITLAB project delete --id " $PROJECT_ID " || fatal " test failed "
86
- OK
80
+ testcase " project deletion" '
81
+ GITLAB project delete --id "$PROJECT_ID"
82
+ '
0 commit comments