Skip to content

Commit 3c9a291

Browse files
committed
CDRIVER-4160 more robust Python selection for integration tests
This specifically addresses the situation on Ubuntu 16.04 Evergreen hosts, which have the virtualenv module installed only for Python 3.
1 parent 851aa64 commit 3c9a291

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.evergreen/integration-tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ case "$OS" in
124124
PYTHON=python
125125
fi
126126

127+
PIP=pip
128+
if ! $PYTHON -c "import virtualenv" ; then
129+
PYTHON=python3
130+
PIP=pip3
131+
fi
132+
127133
$PYTHON -m virtualenv venv
128134
cd venv
129135
. bin/activate
@@ -136,7 +142,7 @@ case "$OS" in
136142
echo "Disabling pip cache"
137143
PIP_PARAM="--no-cache-dir"
138144
fi
139-
pip $PIP_PARAM install .
145+
$PIP $PIP_PARAM install .
140146
cd ../..
141147
mongo-orchestration -f orchestration.config -e default --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern start > $MONGO_ORCHESTRATION_HOME/out.log 2> $MONGO_ORCHESTRATION_HOME/err.log < /dev/null &
142148
;;

0 commit comments

Comments
 (0)