Skip to content

Commit 26e00ec

Browse files
committed
PYTHON-2431 Fix MONGODB-AWS auth tests on macOS
1 parent 4928b90 commit 26e00ec

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ functions:
492492
script: |
493493
${PREPARE_SHELL}
494494
# The aws_e2e_assume_role script requires python3 with boto3.
495-
virtualenv -p ${python3_binary} mongovenv
495+
${python3_binary} -m venv mongovenv
496496
if [ "Windows_NT" = "$OS" ]; then
497497
. mongovenv/Scripts/activate
498498
else

.evergreen/run-mongodb-aws-test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
set -o xtrace
44
set -o errexit # Exit the script with error if any of the commands fail
55

6+
# Get access to createvirtualenv.
7+
. .evergreen/utils.sh
8+
69
############################################
710
# Main Program #
811
############################################
@@ -39,8 +42,6 @@ fi
3942
# show test output
4043
set -x
4144

42-
VIRTUALENV=$(command -v virtualenv)
43-
4445
authtest () {
4546
if [ "Windows_NT" = "$OS" ]; then
4647
PYTHON=$(cygpath -m $PYTHON)
@@ -49,7 +50,7 @@ authtest () {
4950
echo "Running MONGODB-AWS authentication tests with $PYTHON"
5051
$PYTHON --version
5152

52-
$VIRTUALENV -p $PYTHON --system-site-packages --never-download venvaws
53+
createvirtualenv $PYTHON venvaws
5354
if [ "Windows_NT" = "$OS" ]; then
5455
. venvaws/Scripts/activate
5556
else

.evergreen/utils.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ createvirtualenv () {
88
PYTHON=$1
99
VENVPATH=$2
1010
if $PYTHON -m virtualenv --version; then
11-
VIRTUALENV="$PYTHON -m virtualenv"
11+
VIRTUALENV="$PYTHON -m virtualenv --never-download"
12+
elif $PYTHON -m venv -h >/dev/null; then
13+
VIRTUALENV="$PYTHON -m venv"
1214
elif command -v virtualenv; then
13-
VIRTUALENV="$(command -v virtualenv) -p $PYTHON"
15+
VIRTUALENV="$(command -v virtualenv) -p $PYTHON --never-download"
1416
else
1517
echo "Cannot test without virtualenv"
1618
exit 1
1719
fi
18-
$VIRTUALENV --system-site-packages --never-download $VENVPATH
20+
$VIRTUALENV --system-site-packages $VENVPATH
1921
if [ "Windows_NT" = "$OS" ]; then
2022
. $VENVPATH/Scripts/activate
2123
else

0 commit comments

Comments
 (0)