Skip to content

Commit db4eff5

Browse files
chore(NODE-6502) Use a python venv wherever we use Python in driver CI (mongodb#4322)
Co-authored-by: Bailey Pearson <[email protected]>
1 parent ed25d56 commit db4eff5

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

.evergreen/config.in.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ functions:
227227
# Get access to the AWS temporary credentials:
228228
echo "adding temporary AWS credentials to environment"
229229
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
230-
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
230+
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
231+
. ./activate-kmstlsvenv.sh
232+
. ./set-temp-creds.sh
233+
popd
231234
232235
MONGODB_URI="${MONGODB_URI}" \
233236
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \

.evergreen/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ functions:
199199
# Get access to the AWS temporary credentials:
200200
echo "adding temporary AWS credentials to environment"
201201
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
202-
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
202+
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
203+
. ./activate-kmstlsvenv.sh
204+
. ./set-temp-creds.sh
205+
popd
203206
204207
MONGODB_URI="${MONGODB_URI}" \
205208
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \

.evergreen/run-custom-csfle-tests.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ set -o errexit # Exit the script with error if any of the commands fail
2020
# Get access to the AWS temporary credentials:
2121
echo "adding temporary AWS credentials to environment"
2222
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
23-
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
23+
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
24+
. ./activate-kmstlsvenv.sh
25+
. ./set-temp-creds.sh
26+
popd
2427

2528
export MONGODB_URI=${MONGODB_URI}
2629
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"

.evergreen/run-socks5-tests.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function setup_fle() {
1818
# Get access to the AWS temporary credentials:
1919
echo "adding temporary AWS credentials to environment"
2020
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
21-
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
21+
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
22+
. ./activate-kmstlsvenv.sh
23+
. ./set-temp-creds.sh
24+
popd
2225

2326
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
2427
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"

.evergreen/run-tests.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ if [[ -z "${CLIENT_ENCRYPTION}" ]]; then
4545
unset AWS_ACCESS_KEY_ID;
4646
unset AWS_SECRET_ACCESS_KEY;
4747
else
48-
pip install --upgrade boto3
48+
pushd "$DRIVERS_TOOLS/.evergreen/csfle"
49+
. ./activate-kmstlsvenv.sh
4950
# Get access to the AWS temporary credentials:
5051
echo "adding temporary AWS credentials to environment"
5152
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
52-
source "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
53+
source set-temp-creds.sh
54+
popd
5355
fi
5456

5557
npm install @mongodb-js/zstd

test/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@ The following steps will walk you through how to run the tests for CSFLE.
496496
1. Set temporary AWS credentials
497497

498498
```
499-
pip3 install boto3
500-
PYTHON="python3" source /path/to/mongodb-labs/drivers-evergreen-tools/.evergreen/csfle/set-temp-creds.sh
499+
source /path/to/mongodb-labs/drivers-evergreen-tools/.evergreen/csfle/activate-kmstlsvenv.sh
500+
source /path/to/mongodb-labs/drivers-evergreen-tools/.evergreen/csfle/set-temp-creds.sh
501501
```
502502

503503
Alternatively, for fish users, the following script can be substituted for `set-temp-creds.sh`:

0 commit comments

Comments
 (0)