Skip to content

Commit bea6f12

Browse files
committed
PYTHON-5050 Fix installation of just
1 parent 85877a0 commit bea6f12

File tree

6 files changed

+37
-28
lines changed

6 files changed

+37
-28
lines changed

.evergreen/install-dependencies.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
#!/bin/bash
22
set -eu
33

4-
# Copy PyMongo's test certificates over driver-evergreen-tools'
5-
cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/
6-
7-
# Replace MongoOrchestration's client certificate.
8-
cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
9-
10-
if [ -w /etc/hosts ]; then
11-
SUDO=""
12-
else
13-
SUDO="sudo"
14-
fi
15-
164
# Install just.
175
# On Evergreen jobs, "CI" will be set, and we don't want to write to $HOME.
186
if [ "${CI:-}" == "true" ]; then

.evergreen/run-azurekms-test.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ export AZUREKMS_VMNAME=${AZUREKMS_VMNAME}
88
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey
99
export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz
1010
SKIP_SERVERS=1 bash $HERE/setup-encryption.sh
11-
tar czf /tmp/mongo-python-driver.tgz .
11+
# Set up the remote files to test.
12+
git add .
13+
git commit -m "add files" || true
14+
git archive -o /tmp/mongo-python-driver.tar HEAD
15+
tar -rf /tmp/mongo-python-driver.tar libmongocrypt
16+
gzip -f /tmp/mongo-python-driver.tar
1217
# shellcheck disable=SC2088
13-
AZUREKMS_SRC="/tmp/mongo-python-driver.tgz" AZUREKMS_DST="~/" \
18+
AZUREKMS_SRC="/tmp/mongo-python-driver.tar.gz" AZUREKMS_DST="~/" \
1419
$DRIVERS_TOOLS/.evergreen/csfle/azurekms/copy-file.sh
1520
echo "Copying files ... end"
1621
echo "Untarring file ... begin"
17-
AZUREKMS_CMD="tar xf mongo-python-driver.tgz" \
22+
AZUREKMS_CMD="tar xf mongo-python-driver.tar.gz" \
1823
$DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
1924
echo "Untarring file ... end"
2025
echo "Running test ... begin"
21-
AZUREKMS_CMD="KEY_NAME=\"$AZUREKMS_KEYNAME\" KEY_VAULT_ENDPOINT=\"$AZUREKMS_KEYVAULTENDPOINT\" SUCCESS=true TEST_FLE_AZURE_AUTO=1 ./.evergreen/just.sh test-eg" \
26+
AZUREKMS_CMD="KEY_NAME=\"$AZUREKMS_KEYNAME\" KEY_VAULT_ENDPOINT=\"$AZUREKMS_KEYVAULTENDPOINT\" SUCCESS=true TEST_FLE_AZURE_AUTO=1 bash ./.evergreen/just.sh test-eg" \
2227
$DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
2328
echo "Running test ... end"
2429
bash $HERE/teardown-encryption.sh

.evergreen/run-gcpkms-test.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ export GCPKMS_ZONE=${GCPKMS_ZONE}
1010
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
1111
export LIBMONGOCRYPT_URL=https://s3.amazonaws.com/mciuploads/libmongocrypt/debian11/master/latest/libmongocrypt.tar.gz
1212
SKIP_SERVERS=1 bash $HERE/setup-encryption.sh
13-
tar czf /tmp/mongo-python-driver.tgz .
14-
GCPKMS_SRC=/tmp/mongo-python-driver.tgz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh
13+
# Set up the remote files to test.
14+
git add .
15+
git commit -m "add files" || true
16+
git archive -o /tmp/mongo-python-driver.tar HEAD
17+
tar -rf /tmp/mongo-python-driver.tar libmongocrypt
18+
gzip -f /tmp/mongo-python-driver.tar
19+
GCPKMS_SRC=/tmp/mongo-python-driver.tar.gz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh
1520
echo "Copying files ... end"
1621
echo "Untarring file ... begin"
17-
GCPKMS_CMD="tar xf mongo-python-driver.tgz" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
22+
GCPKMS_CMD="tar xf mongo-python-driver.tar.gz" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
1823
echo "Untarring file ... end"
1924
echo "Running test ... begin"
2025
GCPKMS_CMD="SUCCESS=true TEST_FLE_GCP_AUTO=1 ./.evergreen/just.sh test-eg" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/bash
22

33
set -eu
4-
file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh"
5-
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
6-
[ -f "$file" ] && bash "$file" || echo "$file not available, skipping"
4+
bash "$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh"

.evergreen/scripts/prepare-resources.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ pushd $HERE
66
. env.sh
77

88
rm -rf $DRIVERS_TOOLS
9-
if [ "$PROJECT" = "drivers-tools" ]; then
10-
# If this was a patch build, doing a fresh clone would not actually test the patch
11-
cp -R $PROJECT_DIRECTORY/ $DRIVERS_TOOLS
12-
else
13-
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
14-
fi
9+
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
1510
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" >$MONGO_ORCHESTRATION_HOME/orchestration.config
1611

1712
popd
13+
14+
# Copy PyMongo's test certificates over driver-evergreen-tools'
15+
cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/
16+
17+
# Replace MongoOrchestration's client certificate.
18+
cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
19+
20+
if [ -w /etc/hosts ]; then
21+
SUDO=""
22+
else
23+
SUDO="sudo"
24+
fi
25+
26+
# Add 'server' and 'hostname_not_in_cert' as a hostnames
27+
echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts
28+
echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts

.evergreen/scripts/setup-dev-env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ else
1717
BIN_DIR=.venv/bin
1818
fi
1919

20+
. $HERE/install-dependencies.sh
21+
2022
# Ensure there is a python venv.
2123
if [ ! -d $BIN_DIR ]; then
2224
. .evergreen/utils.sh

0 commit comments

Comments
 (0)