8000 functional_test.sh: use a venv · python-gitlab/python-gitlab@e12abf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e12abf1

Browse files
author
Gauvain Pocentek
committed
functional_test.sh: use a venv
1 parent 73c68db commit e12abf1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/functional_tests.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ cleanup() {
1818
rm -f /tmp/python-gitlab.cfg
1919
docker kill gitlab-test >/dev/null 2>&1
2020
docker rm gitlab-test >/dev/null 2>&1
21+
deactivate || true
22+
rm -rf $VENV
2123
}
2224
trap cleanup EXIT
2325

@@ -27,6 +29,12 @@ LOGIN='root'
2729
PASSWORD='5iveL!fe'
2830
CONFIG=/tmp/python-gitlab.cfg
2931
GITLAB="gitlab --config-file $CONFIG"
32+
VENV=$(pwd)/.venv
33+
34+
virtualenv $VENV
35+
. $VENV/bin/activate
36+
pip install -rrequirements.txt
37+
pip install -e .
3038

3139
GREEN='\033[0;32m'
3240
NC='\033[0m'
@@ -77,11 +85,11 @@ USER_ID=$($GITLAB user create --email fake@email.com --username user1 --name "Us
7785
$OK
7886

7987
echo -n "Testing verbose output... "
80-
$GITLAB user list | grep -q avatar-url
88+
$GITLAB -v user list | grep -q avatar-url
8189
$OK
8290

8391
echo -n "Testing CLI args not in output... "
84-
$GITLAB user list | grep -v config-file
92+
$GITLAB -v user list | grep -qv config-file
8593
$OK
8694

8795
echo -n "Testing adding member to a project... "

0 commit comments

Comments
 (0)
0