@@ -55,10 +55,15 @@ CONFIG=/tmp/python-gitlab.cfg
5555
5656cleanup () {
5757 rm -f " ${CONFIG} "
58+ log " Killing gitlab-test docker container..."
5859 docker kill gitlab-test > /dev/null 2>&1
60+ log " Removing gitlab-test docker container..."
5961 docker rm gitlab-test > /dev/null 2>&1
62+ log " Deactivating Python virtualenv..."
6063 command -v deactivate > /dev/null 2>&1 && deactivate || true
64+ log " Deleting python virtualenv..."
6165 rm -rf " $VENV "
66+ log " Done."
6267}
6368[ -z " ${BUILD_TEST_ENV_AUTO_CLEANUP+set} " ] || {
6469 trap cleanup EXIT
@@ -91,11 +96,12 @@ while :; do
9196 curl -s http://localhost:8080/users/sign_in 2> /dev/null \
9297 | grep -q " GitLab Community Edition" && break
9398 I=$(( I+ 5 ))
94- [ " $I " -eq 120 ] && exit 1
99+ [ " $I " -lt 120 ] || fatal " timed out "
95100done
96101sleep 5
97102
98103# Get the token
104+ log " Getting GitLab token..."
99105TOKEN_JSON=$(
100106 try curl -s http://localhost:8080/api/v3/session \
101107 -X POST \
120126log " Config file content ($CONFIG ):"
121127log < $CONFIG
122128
129+ log " Creating Python virtualenv..."
123130try " $VENV_CMD " " $VENV "
124131. " $VENV " /bin/activate || fatal " failed to activate Python virtual environment"
132+
133+ log " Installing dependencies into virtualenv..."
125134try pip install -rrequirements.txt
135+
136+ log " Installing into virtualenv..."
126137try pip install -e .
127138
139+ log " Pausing to give GitLab some time to finish starting up..."
128140sleep 20
141+
142+ log " Test environment initialized."
0 commit comments