@@ -55,10 +55,15 @@ CONFIG=/tmp/python-gitlab.cfg
55
55
56
56
cleanup () {
57
57
rm -f " ${CONFIG} "
58
+ log " Killing gitlab-test docker container..."
58
59
docker kill gitlab-test > /dev/null 2>&1
60
+ log " Removing gitlab-test docker container..."
59
61
docker rm gitlab-test > /dev/null 2>&1
62
+ log " Deactivating Python virtualenv..."
60
63
command -v deactivate > /dev/null 2>&1 && deactivate || true
64
+ log " Deleting python virtualenv..."
61
65
rm -rf " $VENV "
66
+ log " Done."
62
67
}
63
68
[ -z " ${BUILD_TEST_ENV_AUTO_CLEANUP+set} " ] || {
64
69
trap cleanup EXIT
@@ -91,11 +96,12 @@ while :; do
91
96
curl -s http://localhost:8080/users/sign_in 2> /dev/null \
92
97
| grep -q " GitLab Community Edition" && break
93
98
I=$(( I+ 5 ))
94
- [ " $I " -eq 120 ] && exit 1
99
+ [ " $I " -lt 120 ] || fatal " timed out "
95
100
done
96
101
sleep 5
97
102
98
103
# Get the token
104
+ log " Getting GitLab token..."
99
105
TOKEN_JSON=$(
100
106
try curl -s http://localhost:8080/api/v3/session \
101
107
-X POST \
120
126
log " Config file content ($CONFIG ):"
121
127
log < $CONFIG
122
128
129
+ log " Creating Python virtualenv..."
123
130
try " $VENV_CMD " " $VENV "
124
131
. " $VENV " /bin/activate || fatal " failed to activate Python virtual environment"
132
+
133
+ log " Installing dependencies into virtualenv..."
125
134
try pip install -rrequirements.txt
135
+
136
+ log " Installing into virtualenv..."
126
137
try pip install -e .
127
138
139
+ log " Pausing to give GitLab some time to finish starting up..."
128
140
sleep 20
141
+
142
+ log " Test environment initialized."
0 commit comments