From 1a393ffa651edebd3b16d6eddd24dc73e4d08885 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Fri, 20 Sep 2024 15:13:09 -0400 Subject: [PATCH 01/18] chore(NODE-5845): migrate node download script to drivers-tools --- .evergreen/install-dependencies.sh | 104 +---------------------------- .evergreen/prepare-shell.sh | 7 +- .gitignore | 2 + 3 files changed, 9 insertions(+), 104 deletions(-) diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 515722b22b..32943f29b6 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -5,110 +5,12 @@ set -o errexit # Exit the script with error if any of the commands fail ## a nodejs major version (i.e., 16) ## 'latest' ## a full nodejs version, in the format v..patch -NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} +export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} # npm version can be defined in the environment for cases where we need to install # a version lower than latest to support EOL Node versions. -NPM_VERSION=${NPM_VERSION:-latest} +export NPM_VERSION=${NPM_VERSION:-latest} -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" - -if [[ -z "${npm_global_prefix}" ]]; then echo "npm_global_prefix is unset" && exit 1; fi -if [[ -z "${NODE_ARTIFACTS_PATH}" ]]; then echo "NODE_ARTIFACTS_PATH is unset" && exit 1; fi - -CURL_FLAGS=( - --fail # Exit code 1 if request fails - --compressed # Request a compressed response should keep fetching fast - --location # Follow a redirect - --retry 8 # Retry HTTP 408, 429, 500, 502, 503 or 504, 8 times - --silent # Do not print a progress bar - --show-error # Despite the silent flag still print out errors - --max-time 900 # 900 seconds is 15 minutes, evergreen times out at 20 - --continue-at - # If a download is interrupted it can figure out where to resume -) - -mkdir -p "$NODE_ARTIFACTS_PATH/npm_global" - -# Comparisons are all case insensitive -shopt -s nocasematch - -# index.tab is a sorted tab separated values file with the following headers -# 0 1 2 3 4 5 6 7 8 9 10 -# version date files npm v8 uv zlib openssl modules lts security -curl "${CURL_FLAGS[@]}" "https://nodejs.org/dist/index.tab" --output node_index.tab - -while IFS=$'\t' read -r -a row; do - node_index_version="${row[0]}" - node_index_major_version=$(echo $node_index_version | sed -E 's/^v([0-9]+).*$/\1/') - node_index_date="${row[1]}" - node_index_lts="${row[9]}" - [[ "$node_index_version" = "version" ]] && continue # skip tsv header - [[ "$NODE_LTS_VERSION" = "latest" ]] && break # first line is latest - [[ "$NODE_LTS_VERSION" = "$node_index_version" ]] && break # match full version if specified - [[ "$NODE_LTS_VERSION" = "$node_index_major_version" ]] && break # case insensitive compare -done < node_index.tab - -if [[ "$OS" = "Windows_NT" ]]; then - operating_system="win" -elif [[ $(uname) = "darwin" ]]; then - operating_system="darwin" -elif [[ $(uname) = "linux" ]]; then - operating_system="linux" -else - echo "Unable to determine operating system: $operating_system" - exit 1 -fi - -architecture=$(uname -m) -if [[ $architecture = "x86_64" ]]; then - architecture="x64" -elif [[ $architecture = "arm64" ]]; then - architecture="arm64" -elif [[ $architecture = "aarch64" ]]; then - architecture="arm64" -elif [[ $architecture == s390* ]]; then - architecture="s390x" -elif [[ $architecture == ppc* ]]; then - architecture="ppc64le" -else - echo "Unable to determine operating system: $architecture" - exit 1 -fi - -file_extension="tar.gz" -if [[ "$OS" = "Windows_NT" ]]; then file_extension="zip"; fi - -node_directory="node-${node_index_version}-${operating_system}-${architecture}" -node_archive="${node_directory}.${file_extension}" -node_archive_path="$NODE_ARTIFACTS_PATH/${node_archive}" -node_download_url="https://nodejs.org/dist/${node_index_version}/${node_archive}" - -echo "Node.js ${node_index_version} for ${operating_system}-${architecture} released on ${node_index_date}" - -set -o xtrace - -curl "${CURL_FLAGS[@]}" "${node_download_url}" --output "$node_archive_path" - -if [[ "$file_extension" = "zip" ]]; then - unzip -q "$node_archive_path" -d "${NODE_ARTIFACTS_PATH}" - mkdir -p "${NODE_ARTIFACTS_PATH}/nodejs" - # Windows "bins" are at the top level - mv "${NODE_ARTIFACTS_PATH}/${node_directory}" "${NODE_ARTIFACTS_PATH}/nodejs/bin" - # Need to add executable flag ourselves - chmod +x "${NODE_ARTIFACTS_PATH}/nodejs/bin/node.exe" - chmod +x "${NODE_ARTIFACTS_PATH}/nodejs/bin/npm" -else - tar -xf "$node_archive_path" -C "${NODE_ARTIFACTS_PATH}" - mv "${NODE_ARTIFACTS_PATH}/${node_directory}" "${NODE_ARTIFACTS_PATH}/nodejs" -fi - -if [[ $operating_system != "win" ]]; then - # Update npm to latest when we can - npm install --global npm@$NPM_VERSION - hash -r -fi - -echo "npm location: $(which npm)" -echo "npm version: $(npm -v)" +source ./.drivers-tools/.evergreen/install-node.sh npm install "${NPM_OPTIONS}" diff --git a/.evergreen/prepare-shell.sh b/.evergreen/prepare-shell.sh index 7a097d2e6d..8e5513f42c 100644 --- a/.evergreen/prepare-shell.sh +++ b/.evergreen/prepare-shell.sh @@ -1,14 +1,15 @@ #! /usr/bin/env bash -set -o xtrace -set -o errexit +# Only set errexit and xtrace if shell is NOT interactive +[[ $- == *i* ]] || set -o xtrace +[[ $- == *i* ]] || set -o errexit # This script prepares a shell to run the remaining scripts in this folder # It MUST be kept idempotent! It will overwrite the orchestration config and expansion.yml file upon every run # and it will only clone drivers-tools if they do not exist one directory above our driver src PROJECT_DIRECTORY="$(pwd)" -DRIVERS_TOOLS=$(cd .. && echo "$(pwd)/drivers-tools") +DRIVERS_TOOLS="$PROJECT_DIRECTORY/.drivers-tools" MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" UPLOAD_BUCKET="${project}" diff --git a/.gitignore b/.gitignore index cb5e9e4ec8..687f037b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ secrets-export.sh mo-expansion.sh mo-expansion.yml expansions.sh + +.drivers-tools/ From b0cd081e54d66c1e08d645f3828338c7fb9a0742 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Fri, 20 Sep 2024 15:31:27 -0400 Subject: [PATCH 02/18] chore: use drivers-tools init-env script --- .evergreen/config.in.yml | 2 +- .evergreen/config.yml | 2 +- .evergreen/copy-driver-to-azure-and-run.sh | 4 ++-- .evergreen/init-node-and-npm-env.sh | 21 ------------------- .evergreen/install-dependencies.sh | 3 +++ .../install-mongodb-client-encryption.sh | 2 +- .evergreen/run-atlas-tests.sh | 2 +- .evergreen/run-azure-kms-tests.sh | 2 +- .evergreen/run-benchmarks.sh | 2 +- .evergreen/run-custom-csfle-tests.sh | 2 +- .evergreen/run-data-lake-tests.sh | 2 +- .evergreen/run-gcp-kms-tests.sh | 2 +- .evergreen/run-kerberos-tests.sh | 2 +- .evergreen/run-lambda-aws-tests.sh | 2 +- .evergreen/run-lambda-tests.sh | 2 +- .evergreen/run-ldap-tests.sh | 2 +- .evergreen/run-lint-checks.sh | 2 +- .evergreen/run-mongodb-aws-ecs-test.sh | 2 +- .evergreen/run-mongodb-aws-test.sh | 2 +- .evergreen/run-mongosh-integration-tests.sh | 2 +- .evergreen/run-mongosh-scope-test.sh | 2 +- .evergreen/run-ocsp-tests.sh | 2 +- .evergreen/run-oidc-prose-tests.sh | 2 +- .evergreen/run-oidc-unified-tests.sh | 4 ++-- ...resource-management-feature-integration.sh | 2 +- .evergreen/run-resource-management.sh | 2 +- .../run-search-index-management-tests.sh | 2 +- .evergreen/run-serverless-tests.sh | 2 +- .evergreen/run-socks5-tests.sh | 2 +- .evergreen/run-tests.sh | 2 +- .evergreen/run-tls-tests.sh | 2 +- .evergreen/run-typescript.sh | 2 +- .evergreen/run-unit-tests.sh | 2 +- .evergreen/run-x509-tests.sh | 2 +- .evergreen/setup-gcp-testing.sh | 2 +- 35 files changed, 38 insertions(+), 56 deletions(-) delete mode 100644 .evergreen/init-node-and-npm-env.sh diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 85c963ad7a..4691b34ea9 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -464,7 +464,7 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" + source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh rm -rf ./node_modules/@aws-sdk/credential-providers "run atlas tests": diff --git a/.evergreen/config.yml b/.evergreen/config.yml index b912ff0ff7..5064122fb4 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -418,7 +418,7 @@ functions: working_dir: src script: | ${PREPARE_SHELL} - source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" + source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh rm -rf ./node_modules/@aws-sdk/credential-providers run atlas tests: - command: subprocess.exec diff --git a/.evergreen/copy-driver-to-azure-and-run.sh b/.evergreen/copy-driver-to-azure-and-run.sh index 7adbdf08fc..2fb0b96485 100644 --- a/.evergreen/copy-driver-to-azure-and-run.sh +++ b/.evergreen/copy-driver-to-azure-and-run.sh @@ -6,7 +6,7 @@ source "${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/secrets-export.sh" if [ -z ${AZUREKMS_RESOURCEGROUP+omitted} ]; then echo "AZUREKMS_RESOURCEGROUP is unset" && exit 1; fi if [ -z ${AZUREKMS_VMNAME+omitted} ]; then echo "AZUREKMS_VMNAME is unset" && exit 1; fi -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey @@ -29,4 +29,4 @@ echo "decompressing node driver tar on azure ... end" echo "Running test ... begin" export AZUREKMS_CMD="env EXPECTED_AZUREKMS_OUTCOME=success bash src/.evergreen/run-azure-kms-tests.sh" ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh -echo "Running test ... end" \ No newline at end of file +echo "Running test ... end" diff --git a/.evergreen/init-node-and-npm-env.sh b/.evergreen/init-node-and-npm-env.sh deleted file mode 100644 index b3cecf54e3..0000000000 --- a/.evergreen/init-node-and-npm-env.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/env bash -## -## This script add the location of `npm` and `node` to the path. -## This is necessary because evergreen uses separate bash scripts for -## different functions in a given CI run but doesn't persist the environment -## across them. So we manually invoke this script everywhere we need -## access to `npm`, `node`, or need to install something globally from -## npm. - -NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" -if [[ "$OS" == "Windows_NT" ]]; then - NODE_ARTIFACTS_PATH=$(cygpath --unix "$NODE_ARTIFACTS_PATH") -fi - -export NODE_ARTIFACTS_PATH -# npm uses this environment variable to determine where to install global packages -export npm_global_prefix=$NODE_ARTIFACTS_PATH/npm_global -export PATH="$npm_global_prefix/bin:$NODE_ARTIFACTS_PATH/nodejs/bin:$PATH" -hash -r - -export NODE_OPTIONS="--trace-deprecation --trace-warnings" diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 32943f29b6..cac69c4045 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -15,3 +15,6 @@ source ./.drivers-tools/.evergreen/install-node.sh npm install "${NPM_OPTIONS}" npm ls + + +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh diff --git a/.evergreen/install-mongodb-client-encryption.sh b/.evergreen/install-mongodb-client-encryption.sh index 80432960f3..3dc4db43c3 100644 --- a/.evergreen/install-mongodb-client-encryption.sh +++ b/.evergreen/install-mongodb-client-encryption.sh @@ -4,7 +4,7 @@ set +o xtrace # Initial checks for running these tests if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail diff --git a/.evergreen/run-atlas-tests.sh b/.evergreen/run-atlas-tests.sh index 694cefaf43..373f3e54d5 100644 --- a/.evergreen/run-atlas-tests.sh +++ b/.evergreen/run-atlas-tests.sh @@ -7,7 +7,7 @@ if test -f secrets-export.sh; then fi PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh node -v diff --git a/.evergreen/run-azure-kms-tests.sh b/.evergreen/run-azure-kms-tests.sh index 87292d49d6..e0f53dc5c4 100644 --- a/.evergreen/run-azure-kms-tests.sh +++ b/.evergreen/run-azure-kms-tests.sh @@ -5,7 +5,7 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY -source ".evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-benchmarks.sh b/.evergreen/run-benchmarks.sh index 8e1bf31899..9d7ffc3872 100644 --- a/.evergreen/run-benchmarks.sh +++ b/.evergreen/run-benchmarks.sh @@ -1,6 +1,6 @@ #! /bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh export MONGODB_URI=$MONGODB_URI diff --git a/.evergreen/run-custom-csfle-tests.sh b/.evergreen/run-custom-csfle-tests.sh index e0cd68d782..7ce156b498 100644 --- a/.evergreen/run-custom-csfle-tests.sh +++ b/.evergreen/run-custom-csfle-tests.sh @@ -12,7 +12,7 @@ export CSFLE_KMS_PROVIDERS=${CSFLE_KMS_PROVIDERS} export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} echo "csfle CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail diff --git a/.evergreen/run-data-lake-tests.sh b/.evergreen/run-data-lake-tests.sh index 8f62a1f16a..59fb8a46e0 100644 --- a/.evergreen/run-data-lake-tests.sh +++ b/.evergreen/run-data-lake-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh echo "$MONGODB_URI" npm run check:adl diff --git a/.evergreen/run-gcp-kms-tests.sh b/.evergreen/run-gcp-kms-tests.sh index 510894f320..8b771985a2 100644 --- a/.evergreen/run-gcp-kms-tests.sh +++ b/.evergreen/run-gcp-kms-tests.sh @@ -5,7 +5,7 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY -source ".evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-kerberos-tests.sh b/.evergreen/run-kerberos-tests.sh index 12338bd92b..5d551feaf3 100644 --- a/.evergreen/run-kerberos-tests.sh +++ b/.evergreen/run-kerberos-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # set up keytab mkdir -p "$(pwd)/.evergreen" diff --git a/.evergreen/run-lambda-aws-tests.sh b/.evergreen/run-lambda-aws-tests.sh index 685d178182..01ab966d9d 100644 --- a/.evergreen/run-lambda-aws-tests.sh +++ b/.evergreen/run-lambda-aws-tests.sh @@ -8,7 +8,7 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # the default connection string, may be overridden by the environment script export MONGODB_URI="mongodb://localhost:27017/aws" diff --git a/.evergreen/run-lambda-tests.sh b/.evergreen/run-lambda-tests.sh index be7101a188..23937265f5 100644 --- a/.evergreen/run-lambda-tests.sh +++ b/.evergreen/run-lambda-tests.sh @@ -8,6 +8,6 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh npm run check:lambda diff --git a/.evergreen/run-ldap-tests.sh b/.evergreen/run-ldap-tests.sh index 3354aab303..499091e45d 100644 --- a/.evergreen/run-ldap-tests.sh +++ b/.evergreen/run-ldap-tests.sh @@ -2,6 +2,6 @@ set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh npm run check:ldap diff --git a/.evergreen/run-lint-checks.sh b/.evergreen/run-lint-checks.sh index 1c57972c31..672e4f96f1 100644 --- a/.evergreen/run-lint-checks.sh +++ b/.evergreen/run-lint-checks.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # Attempt to update our EVG config # if it changes, crash so that any gen script changes are forced to be run before pushing diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 54e95e8da8..30f96c79c0 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -10,7 +10,7 @@ cd $PROJECT_DIRECTORY tar -xzf src.tgz . # load node.js -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # run the tests npm install aws4 diff --git a/.evergreen/run-mongodb-aws-test.sh b/.evergreen/run-mongodb-aws-test.sh index fac9495584..61eef5ea6d 100755 --- a/.evergreen/run-mongodb-aws-test.sh +++ b/.evergreen/run-mongodb-aws-test.sh @@ -8,7 +8,7 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # the default connection string, may be overridden by the environment script export MONGODB_URI="mongodb://localhost:27017/aws?authMechanism=MONGODB-AWS" diff --git a/.evergreen/run-mongosh-integration-tests.sh b/.evergreen/run-mongosh-integration-tests.sh index a12f3db678..5f754b64ea 100644 --- a/.evergreen/run-mongosh-integration-tests.sh +++ b/.evergreen/run-mongosh-integration-tests.sh @@ -16,7 +16,7 @@ if [ -z ${TASK_ID+omitted} ]; then echo "TASK_ID is unset" && exit 1; fi MONGOSH_RUN_ONLY_IN_PACKAGE=${MONGOSH_RUN_ONLY_IN_PACKAGE:-""} -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh npm cache clear --force || true npm install --global npm@8.x || true diff --git a/.evergreen/run-mongosh-scope-test.sh b/.evergreen/run-mongosh-scope-test.sh index 99345bc0ac..13a4a4e29a 100644 --- a/.evergreen/run-mongosh-scope-test.sh +++ b/.evergreen/run-mongosh-scope-test.sh @@ -2,7 +2,7 @@ if [ -z ${TASK_ID+omitted} ]; then echo "TASK_ID is unset" && exit 1; fi -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh MONGOSH_DIRECTORY="/tmp/$TASK_ID" git clone --depth=10 https://github.com/mongodb-js/mongosh.git $MONGOSH_DIRECTORY diff --git a/.evergreen/run-ocsp-tests.sh b/.evergreen/run-ocsp-tests.sh index a9006714e3..f0edd04463 100644 --- a/.evergreen/run-ocsp-tests.sh +++ b/.evergreen/run-ocsp-tests.sh @@ -3,7 +3,7 @@ set -o xtrace set -o errexit # load node.js environment -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh # $PYTHON_BINARY -m virtualenv --never-download --no-wheel ocsptest # . ocsptest/bin/activate diff --git a/.evergreen/run-oidc-prose-tests.sh b/.evergreen/run-oidc-prose-tests.sh index ae9de15d36..143b98abbb 100755 --- a/.evergreen/run-oidc-prose-tests.sh +++ b/.evergreen/run-oidc-prose-tests.sh @@ -4,7 +4,7 @@ set -o xtrace # Write all commands first to stderr ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh if [ -z "${MONGODB_URI_SINGLE}" ]; then echo "Must specify MONGODB_URI_SINGLE" diff --git a/.evergreen/run-oidc-unified-tests.sh b/.evergreen/run-oidc-unified-tests.sh index 051256a64f..560e98c529 100755 --- a/.evergreen/run-oidc-unified-tests.sh +++ b/.evergreen/run-oidc-unified-tests.sh @@ -4,7 +4,7 @@ set -o xtrace # Write all commands first to stderr ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh if [ "$ENVIRONMENT" = "test" ]; then export OIDC_TOKEN_DIR=${OIDC_TOKEN_DIR} @@ -13,4 +13,4 @@ fi export UTIL_CLIENT_USER=$OIDC_ADMIN_USER export UTIL_CLIENT_PASSWORD=$OIDC_ADMIN_PWD -npm run check:oidc-auth \ No newline at end of file +npm run check:oidc-auth diff --git a/.evergreen/run-resource-management-feature-integration.sh b/.evergreen/run-resource-management-feature-integration.sh index 70854dae1d..c77ddd1df5 100644 --- a/.evergreen/run-resource-management-feature-integration.sh +++ b/.evergreen/run-resource-management-feature-integration.sh @@ -1,6 +1,6 @@ #! /bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh echo "Building driver..." npm pack diff --git a/.evergreen/run-resource-management.sh b/.evergreen/run-resource-management.sh index ff7737b1c5..4782345bd0 100644 --- a/.evergreen/run-resource-management.sh +++ b/.evergreen/run-resource-management.sh @@ -1,5 +1,5 @@ #! /bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh npm run check:resource-management diff --git a/.evergreen/run-search-index-management-tests.sh b/.evergreen/run-search-index-management-tests.sh index 2dc1f34e5c..9cde48b3ab 100644 --- a/.evergreen/run-search-index-management-tests.sh +++ b/.evergreen/run-search-index-management-tests.sh @@ -1,5 +1,5 @@ #! /bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh npm run check:search-indexes diff --git a/.evergreen/run-serverless-tests.sh b/.evergreen/run-serverless-tests.sh index bc4c83ed67..003341f355 100755 --- a/.evergreen/run-serverless-tests.sh +++ b/.evergreen/run-serverless-tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh if [ -z ${SERVERLESS+omitted} ]; then echo "SERVERLESS is unset" && exit 1; fi if [ -z ${SERVERLESS_URI+omitted} ]; then echo "SERVERLESS_URI is unset" && exit 1; fi diff --git a/.evergreen/run-socks5-tests.sh b/.evergreen/run-socks5-tests.sh index 7dab6a9a06..99294bd4de 100644 --- a/.evergreen/run-socks5-tests.sh +++ b/.evergreen/run-socks5-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # For debuggability, no external credentials are used here diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 080857cd38..88c4d4f180 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -29,7 +29,7 @@ echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI" if [[ -z "${SKIP_DEPS}" ]]; then source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh" else - source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" + source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh fi if [ "$COMPRESSOR" != "" ]; then diff --git a/.evergreen/run-tls-tests.sh b/.evergreen/run-tls-tests.sh index 88b21a82e4..09ef2bf3c5 100644 --- a/.evergreen/run-tls-tests.sh +++ b/.evergreen/run-tls-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh export TLS_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem" export TLS_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem" diff --git a/.evergreen/run-typescript.sh b/.evergreen/run-typescript.sh index 9bd212eb70..22c26adeea 100755 --- a/.evergreen/run-typescript.sh +++ b/.evergreen/run-typescript.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh case $TS_CHECK in COMPILE_DRIVER|CHECK_TYPES) # Ok diff --git a/.evergreen/run-unit-tests.sh b/.evergreen/run-unit-tests.sh index a1ab8e3a1a..35a193d424 100644 --- a/.evergreen/run-unit-tests.sh +++ b/.evergreen/run-unit-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o xtrace npx nyc npm run check:unit diff --git a/.evergreen/run-x509-tests.sh b/.evergreen/run-x509-tests.sh index 0e65800cb1..f3bccc5dc1 100644 --- a/.evergreen/run-x509-tests.sh +++ b/.evergreen/run-x509-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh set -o errexit diff --git a/.evergreen/setup-gcp-testing.sh b/.evergreen/setup-gcp-testing.sh index eb99674067..4a1bc05698 100644 --- a/.evergreen/setup-gcp-testing.sh +++ b/.evergreen/setup-gcp-testing.sh @@ -10,7 +10,7 @@ if [ -z ${GCPKMS_INSTANCENAME+omitted} ]; then echo "GCPKMS_INSTANCENAME is unse set -o errexit -source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" +source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh export GCPKMS_SRC=node-driver-source.tgz export GCPKMS_DST=$GCPKMS_INSTANCENAME: From 80f55b56889239037a901ae44793cc74ff87c180 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 26 Sep 2024 17:48:17 -0400 Subject: [PATCH 03/18] chore: put DRIVERS_TOOLS back above repo --- .evergreen/config.in.yml | 2 +- .evergreen/config.yml | 2 +- .evergreen/copy-driver-to-azure-and-run.sh | 2 +- .evergreen/install-dependencies.sh | 4 ++-- .evergreen/install-mongodb-client-encryption.sh | 2 +- .evergreen/prepare-shell.sh | 2 +- .evergreen/run-atlas-tests.sh | 2 +- .evergreen/run-azure-kms-tests.sh | 2 +- .evergreen/run-benchmarks.sh | 2 +- .evergreen/run-custom-csfle-tests.sh | 2 +- .evergreen/run-data-lake-tests.sh | 2 +- .evergreen/run-gcp-kms-tests.sh | 2 +- .evergreen/run-kerberos-tests.sh | 2 +- .evergreen/run-lambda-aws-tests.sh | 2 +- .evergreen/run-lambda-tests.sh | 2 +- .evergreen/run-ldap-tests.sh | 2 +- .evergreen/run-lint-checks.sh | 2 +- .evergreen/run-mongodb-aws-ecs-test.sh | 2 +- .evergreen/run-mongodb-aws-test.sh | 2 +- .evergreen/run-mongosh-integration-tests.sh | 2 +- .evergreen/run-mongosh-scope-test.sh | 2 +- .evergreen/run-ocsp-tests.sh | 2 +- .evergreen/run-oidc-prose-tests.sh | 2 +- .evergreen/run-oidc-unified-tests.sh | 2 +- .evergreen/run-resource-management-feature-integration.sh | 2 +- .evergreen/run-resource-management.sh | 2 +- .evergreen/run-search-index-management-tests.sh | 2 +- .evergreen/run-serverless-tests.sh | 2 +- .evergreen/run-socks5-tests.sh | 2 +- .evergreen/run-tests.sh | 2 +- .evergreen/run-tls-tests.sh | 2 +- .evergreen/run-typescript.sh | 2 +- .evergreen/run-unit-tests.sh | 2 +- .evergreen/run-x509-tests.sh | 2 +- .evergreen/setup-gcp-testing.sh | 2 +- 35 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 4691b34ea9..bc20b7f859 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -464,7 +464,7 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh rm -rf ./node_modules/@aws-sdk/credential-providers "run atlas tests": diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 5064122fb4..aa2d16fb0b 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -418,7 +418,7 @@ functions: working_dir: src script: | ${PREPARE_SHELL} - source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh rm -rf ./node_modules/@aws-sdk/credential-providers run atlas tests: - command: subprocess.exec diff --git a/.evergreen/copy-driver-to-azure-and-run.sh b/.evergreen/copy-driver-to-azure-and-run.sh index 2fb0b96485..3d176e53f3 100644 --- a/.evergreen/copy-driver-to-azure-and-run.sh +++ b/.evergreen/copy-driver-to-azure-and-run.sh @@ -6,7 +6,7 @@ source "${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/secrets-export.sh" if [ -z ${AZUREKMS_RESOURCEGROUP+omitted} ]; then echo "AZUREKMS_RESOURCEGROUP is unset" && exit 1; fi if [ -z ${AZUREKMS_VMNAME+omitted} ]; then echo "AZUREKMS_VMNAME is unset" && exit 1; fi -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index cac69c4045..97e7a938ad 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -10,11 +10,11 @@ export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} # a version lower than latest to support EOL Node versions. export NPM_VERSION=${NPM_VERSION:-latest} -source ./.drivers-tools/.evergreen/install-node.sh +source $DRIVERS_TOOLS/.evergreen/install-node.sh npm install "${NPM_OPTIONS}" npm ls -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh diff --git a/.evergreen/install-mongodb-client-encryption.sh b/.evergreen/install-mongodb-client-encryption.sh index 3dc4db43c3..1236d3338c 100644 --- a/.evergreen/install-mongodb-client-encryption.sh +++ b/.evergreen/install-mongodb-client-encryption.sh @@ -4,7 +4,7 @@ set +o xtrace # Initial checks for running these tests if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail diff --git a/.evergreen/prepare-shell.sh b/.evergreen/prepare-shell.sh index 8e5513f42c..af8cd4a00e 100644 --- a/.evergreen/prepare-shell.sh +++ b/.evergreen/prepare-shell.sh @@ -9,7 +9,7 @@ # and it will only clone drivers-tools if they do not exist one directory above our driver src PROJECT_DIRECTORY="$(pwd)" -DRIVERS_TOOLS="$PROJECT_DIRECTORY/.drivers-tools" +DRIVERS_TOOLS=$(cd .. && echo "$(pwd)/drivers-tools") MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" UPLOAD_BUCKET="${project}" diff --git a/.evergreen/run-atlas-tests.sh b/.evergreen/run-atlas-tests.sh index 373f3e54d5..fa1715872c 100644 --- a/.evergreen/run-atlas-tests.sh +++ b/.evergreen/run-atlas-tests.sh @@ -7,7 +7,7 @@ if test -f secrets-export.sh; then fi PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh node -v diff --git a/.evergreen/run-azure-kms-tests.sh b/.evergreen/run-azure-kms-tests.sh index e0f53dc5c4..40ad4b0ecc 100644 --- a/.evergreen/run-azure-kms-tests.sh +++ b/.evergreen/run-azure-kms-tests.sh @@ -5,7 +5,7 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-benchmarks.sh b/.evergreen/run-benchmarks.sh index 9d7ffc3872..b26c2afa21 100644 --- a/.evergreen/run-benchmarks.sh +++ b/.evergreen/run-benchmarks.sh @@ -1,6 +1,6 @@ #! /bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export MONGODB_URI=$MONGODB_URI diff --git a/.evergreen/run-custom-csfle-tests.sh b/.evergreen/run-custom-csfle-tests.sh index 7ce156b498..5b0a3c9685 100644 --- a/.evergreen/run-custom-csfle-tests.sh +++ b/.evergreen/run-custom-csfle-tests.sh @@ -12,7 +12,7 @@ export CSFLE_KMS_PROVIDERS=${CSFLE_KMS_PROVIDERS} export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} echo "csfle CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail diff --git a/.evergreen/run-data-lake-tests.sh b/.evergreen/run-data-lake-tests.sh index 59fb8a46e0..6f2d9608b4 100644 --- a/.evergreen/run-data-lake-tests.sh +++ b/.evergreen/run-data-lake-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh echo "$MONGODB_URI" npm run check:adl diff --git a/.evergreen/run-gcp-kms-tests.sh b/.evergreen/run-gcp-kms-tests.sh index 8b771985a2..a576828e6c 100644 --- a/.evergreen/run-gcp-kms-tests.sh +++ b/.evergreen/run-gcp-kms-tests.sh @@ -5,7 +5,7 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-kerberos-tests.sh b/.evergreen/run-kerberos-tests.sh index 5d551feaf3..0a398956b9 100644 --- a/.evergreen/run-kerberos-tests.sh +++ b/.evergreen/run-kerberos-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # set up keytab mkdir -p "$(pwd)/.evergreen" diff --git a/.evergreen/run-lambda-aws-tests.sh b/.evergreen/run-lambda-aws-tests.sh index 01ab966d9d..bf9ec2cdfb 100644 --- a/.evergreen/run-lambda-aws-tests.sh +++ b/.evergreen/run-lambda-aws-tests.sh @@ -8,7 +8,7 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # the default connection string, may be overridden by the environment script export MONGODB_URI="mongodb://localhost:27017/aws" diff --git a/.evergreen/run-lambda-tests.sh b/.evergreen/run-lambda-tests.sh index 23937265f5..279766965f 100644 --- a/.evergreen/run-lambda-tests.sh +++ b/.evergreen/run-lambda-tests.sh @@ -8,6 +8,6 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh npm run check:lambda diff --git a/.evergreen/run-ldap-tests.sh b/.evergreen/run-ldap-tests.sh index 499091e45d..574359fe8b 100644 --- a/.evergreen/run-ldap-tests.sh +++ b/.evergreen/run-ldap-tests.sh @@ -2,6 +2,6 @@ set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh npm run check:ldap diff --git a/.evergreen/run-lint-checks.sh b/.evergreen/run-lint-checks.sh index 672e4f96f1..dbb5690ee9 100644 --- a/.evergreen/run-lint-checks.sh +++ b/.evergreen/run-lint-checks.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # Attempt to update our EVG config # if it changes, crash so that any gen script changes are forced to be run before pushing diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 30f96c79c0..800d455f60 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -10,7 +10,7 @@ cd $PROJECT_DIRECTORY tar -xzf src.tgz . # load node.js -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # run the tests npm install aws4 diff --git a/.evergreen/run-mongodb-aws-test.sh b/.evergreen/run-mongodb-aws-test.sh index 61eef5ea6d..65614a9d35 100755 --- a/.evergreen/run-mongodb-aws-test.sh +++ b/.evergreen/run-mongodb-aws-test.sh @@ -8,7 +8,7 @@ MONGODB_URI=${MONGODB_URI:-} set +x # load node.js environment -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # the default connection string, may be overridden by the environment script export MONGODB_URI="mongodb://localhost:27017/aws?authMechanism=MONGODB-AWS" diff --git a/.evergreen/run-mongosh-integration-tests.sh b/.evergreen/run-mongosh-integration-tests.sh index 5f754b64ea..eccf6617bb 100644 --- a/.evergreen/run-mongosh-integration-tests.sh +++ b/.evergreen/run-mongosh-integration-tests.sh @@ -16,7 +16,7 @@ if [ -z ${TASK_ID+omitted} ]; then echo "TASK_ID is unset" && exit 1; fi MONGOSH_RUN_ONLY_IN_PACKAGE=${MONGOSH_RUN_ONLY_IN_PACKAGE:-""} -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh npm cache clear --force || true npm install --global npm@8.x || true diff --git a/.evergreen/run-mongosh-scope-test.sh b/.evergreen/run-mongosh-scope-test.sh index 13a4a4e29a..e2477dda4c 100644 --- a/.evergreen/run-mongosh-scope-test.sh +++ b/.evergreen/run-mongosh-scope-test.sh @@ -2,7 +2,7 @@ if [ -z ${TASK_ID+omitted} ]; then echo "TASK_ID is unset" && exit 1; fi -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh MONGOSH_DIRECTORY="/tmp/$TASK_ID" git clone --depth=10 https://github.com/mongodb-js/mongosh.git $MONGOSH_DIRECTORY diff --git a/.evergreen/run-ocsp-tests.sh b/.evergreen/run-ocsp-tests.sh index f0edd04463..824d5ea430 100644 --- a/.evergreen/run-ocsp-tests.sh +++ b/.evergreen/run-ocsp-tests.sh @@ -3,7 +3,7 @@ set -o xtrace set -o errexit # load node.js environment -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh # $PYTHON_BINARY -m virtualenv --never-download --no-wheel ocsptest # . ocsptest/bin/activate diff --git a/.evergreen/run-oidc-prose-tests.sh b/.evergreen/run-oidc-prose-tests.sh index 143b98abbb..beb4281e9e 100755 --- a/.evergreen/run-oidc-prose-tests.sh +++ b/.evergreen/run-oidc-prose-tests.sh @@ -4,7 +4,7 @@ set -o xtrace # Write all commands first to stderr ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh if [ -z "${MONGODB_URI_SINGLE}" ]; then echo "Must specify MONGODB_URI_SINGLE" diff --git a/.evergreen/run-oidc-unified-tests.sh b/.evergreen/run-oidc-unified-tests.sh index 560e98c529..22be9eb371 100755 --- a/.evergreen/run-oidc-unified-tests.sh +++ b/.evergreen/run-oidc-unified-tests.sh @@ -4,7 +4,7 @@ set -o xtrace # Write all commands first to stderr ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh if [ "$ENVIRONMENT" = "test" ]; then export OIDC_TOKEN_DIR=${OIDC_TOKEN_DIR} diff --git a/.evergreen/run-resource-management-feature-integration.sh b/.evergreen/run-resource-management-feature-integration.sh index c77ddd1df5..093a4749d7 100644 --- a/.evergreen/run-resource-management-feature-integration.sh +++ b/.evergreen/run-resource-management-feature-integration.sh @@ -1,6 +1,6 @@ #! /bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh echo "Building driver..." npm pack diff --git a/.evergreen/run-resource-management.sh b/.evergreen/run-resource-management.sh index 4782345bd0..f656bec493 100644 --- a/.evergreen/run-resource-management.sh +++ b/.evergreen/run-resource-management.sh @@ -1,5 +1,5 @@ #! /bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh npm run check:resource-management diff --git a/.evergreen/run-search-index-management-tests.sh b/.evergreen/run-search-index-management-tests.sh index 9cde48b3ab..652540c69f 100644 --- a/.evergreen/run-search-index-management-tests.sh +++ b/.evergreen/run-search-index-management-tests.sh @@ -1,5 +1,5 @@ #! /bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh npm run check:search-indexes diff --git a/.evergreen/run-serverless-tests.sh b/.evergreen/run-serverless-tests.sh index 003341f355..32322e56b1 100755 --- a/.evergreen/run-serverless-tests.sh +++ b/.evergreen/run-serverless-tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh if [ -z ${SERVERLESS+omitted} ]; then echo "SERVERLESS is unset" && exit 1; fi if [ -z ${SERVERLESS_URI+omitted} ]; then echo "SERVERLESS_URI is unset" && exit 1; fi diff --git a/.evergreen/run-socks5-tests.sh b/.evergreen/run-socks5-tests.sh index 99294bd4de..f0e146e7c6 100644 --- a/.evergreen/run-socks5-tests.sh +++ b/.evergreen/run-socks5-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # For debuggability, no external credentials are used here diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 88c4d4f180..755732b9de 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -29,7 +29,7 @@ echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI" if [[ -z "${SKIP_DEPS}" ]]; then source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh" else - source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh fi if [ "$COMPRESSOR" != "" ]; then diff --git a/.evergreen/run-tls-tests.sh b/.evergreen/run-tls-tests.sh index 09ef2bf3c5..eee6efbadb 100644 --- a/.evergreen/run-tls-tests.sh +++ b/.evergreen/run-tls-tests.sh @@ -2,7 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export TLS_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem" export TLS_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem" diff --git a/.evergreen/run-typescript.sh b/.evergreen/run-typescript.sh index 22c26adeea..dd37a8717e 100755 --- a/.evergreen/run-typescript.sh +++ b/.evergreen/run-typescript.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh case $TS_CHECK in COMPILE_DRIVER|CHECK_TYPES) # Ok diff --git a/.evergreen/run-unit-tests.sh b/.evergreen/run-unit-tests.sh index 35a193d424..bd08017dfa 100644 --- a/.evergreen/run-unit-tests.sh +++ b/.evergreen/run-unit-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o errexit # Exit the script with error if any of the commands fail -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace npx nyc npm run check:unit diff --git a/.evergreen/run-x509-tests.sh b/.evergreen/run-x509-tests.sh index f3bccc5dc1..29c481142e 100644 --- a/.evergreen/run-x509-tests.sh +++ b/.evergreen/run-x509-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o errexit diff --git a/.evergreen/setup-gcp-testing.sh b/.evergreen/setup-gcp-testing.sh index 4a1bc05698..f7c26b08a2 100644 --- a/.evergreen/setup-gcp-testing.sh +++ b/.evergreen/setup-gcp-testing.sh @@ -10,7 +10,7 @@ if [ -z ${GCPKMS_INSTANCENAME+omitted} ]; then echo "GCPKMS_INSTANCENAME is unse set -o errexit -source ./.drivers-tools/.evergreen/init-node-and-npm-env.sh +source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export GCPKMS_SRC=node-driver-source.tgz export GCPKMS_DST=$GCPKMS_INSTANCENAME: From 0596001636c3a637dc5b05ef756e7677bdf875d0 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 26 Sep 2024 17:57:31 -0400 Subject: [PATCH 04/18] chore: add driver tools --- .evergreen/copy-driver-to-azure-and-run.sh | 2 +- .evergreen/setup-gcp-testing.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/copy-driver-to-azure-and-run.sh b/.evergreen/copy-driver-to-azure-and-run.sh index 3d176e53f3..f3a4b805aa 100644 --- a/.evergreen/copy-driver-to-azure-and-run.sh +++ b/.evergreen/copy-driver-to-azure-and-run.sh @@ -12,7 +12,7 @@ export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey echo "compressing node driver source ... begin" -tar -czf node-driver-source.tgz src +tar -czf node-driver-source.tgz src $DRIVERS_TOOLS echo "compressing node driver source ... end" export AZUREKMS_SRC=node-driver-source.tgz diff --git a/.evergreen/setup-gcp-testing.sh b/.evergreen/setup-gcp-testing.sh index f7c26b08a2..b74191bd86 100644 --- a/.evergreen/setup-gcp-testing.sh +++ b/.evergreen/setup-gcp-testing.sh @@ -17,7 +17,7 @@ export GCPKMS_DST=$GCPKMS_INSTANCENAME: # Box up the entire driver and it's node_modules echo "compressing node driver source ... begin" -tar -czf $GCPKMS_SRC src +tar -czf $GCPKMS_SRC src $DRIVERS_TOOLS echo "compressing node driver source ... end" echo "copying node driver tar ... begin" From 7ca36971ccf6dee2106bc6a8fda5bfaadd0773b4 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Fri, 27 Sep 2024 15:08:03 -0400 Subject: [PATCH 05/18] chore: add tools to tasks --- .evergreen/config.in.yml | 67 ++++++++++++++++++++++++---------------- .evergreen/config.yml | 65 +++++++++++++++++++++++--------------- 2 files changed, 81 insertions(+), 51 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index bc20b7f859..58883868c6 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -322,6 +322,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - "${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh" @@ -334,6 +335,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - "${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh" @@ -346,6 +348,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} TS_VERSION: ${TS_VERSION} TS_CHECK: CHECK_TYPES TYPES_VERSION: ${TYPES_VERSION} @@ -361,6 +364,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - "${PROJECT_DIRECTORY}/.evergreen/run-resource-management.sh" @@ -373,6 +377,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} MONGODB_URI: ${MONGODB_URI} binary: bash args: @@ -386,6 +391,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} TS_VERSION: ${TS_VERSION} TS_CHECK: COMPILE_DRIVER TYPES_VERSION: ${TYPES_VERSION} @@ -473,6 +479,8 @@ functions: params: working_dir: "src" binary: bash + env: + DRIVERS_TOOLS: ${DRIVERS_TOOLS} args: - -c - ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect @@ -482,6 +490,7 @@ functions: working_dir: "src" binary: bash env: + DRIVERS_TOOLS: ${DRIVERS_TOOLS} NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - .evergreen/run-atlas-tests.sh @@ -527,43 +536,49 @@ functions: bash ${PROJECT_DIRECTORY}/.evergreen/run-socks5-tests.sh "run kerberos tests": - - command: shell.exec + - command: subprocess.exec type: test params: + binary: bash working_dir: src - script: | - export PROJECT_DIRECTORY="$(pwd)" - export KRB5_KEYTAB='${gssapi_auth_keytab_base64}' - export KRB5_NEW_KEYTAB='${gssapi_auth_new_keytab_base64}' - export KRB5_PRINCIPAL='${gssapi_auth_principal}' - export MONGODB_URI='${gssapi_auth_mongodb_uri}' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + KRB5_KEYTAB: ${gssapi_auth_keytab_base64} + KRB5_NEW_KEYTAB: ${gssapi_auth_new_keytab_base64} + KRB5_PRINCIPAL: ${gssapi_auth_principal} + MONGODB_URI: ${gssapi_auth_mongodb_uri} + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-kerberos-tests.sh "run ldap tests": - - command: shell.exec + - command: subprocess.exec type: test params: - working_dir: "src" - script: | - export PROJECT_DIRECTORY="$(pwd)" - export MONGODB_URI='${plain_auth_mongodb_uri}' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh + working_dir: src + binary: bash + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_URI: ${plain_auth_mongodb_uri} + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-ldap-tests.sh "run data lake tests": - - command: shell.exec + - command: subprocess.exec type: test params: working_dir: src - script: | - export PROJECT_DIRECTORY="$(pwd)" - export MONGODB_URI='mongodb://mhuser:pencil@localhost' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh + binary: bash + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_URI: "mongodb://mhuser:pencil@localhost" + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-data-lake-tests.sh "run tls tests": - command: shell.exec @@ -856,7 +871,7 @@ functions: echo "npm run check:aws" >> $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen - tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . + tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . $DRIVERS_TOOLS cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh diff --git a/.evergreen/config.yml b/.evergreen/config.yml index aa2d16fb0b..f77bbb1953 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -288,6 +288,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh @@ -299,6 +300,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh @@ -310,6 +312,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} TS_VERSION: ${TS_VERSION} TS_CHECK: CHECK_TYPES TYPES_VERSION: ${TYPES_VERSION} @@ -324,6 +327,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-resource-management.sh @@ -335,6 +339,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} MONGODB_URI: ${MONGODB_URI} binary: bash args: @@ -347,6 +352,7 @@ functions: timeout_secs: 60 env: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} TS_VERSION: ${TS_VERSION} TS_CHECK: COMPILE_DRIVER TYPES_VERSION: ${TYPES_VERSION} @@ -425,6 +431,8 @@ functions: params: working_dir: src binary: bash + env: + DRIVERS_TOOLS: ${DRIVERS_TOOLS} args: - '-c' - ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect @@ -434,6 +442,7 @@ functions: working_dir: src binary: bash env: + DRIVERS_TOOLS: ${DRIVERS_TOOLS} NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - .evergreen/run-atlas-tests.sh @@ -490,41 +499,47 @@ functions: bash ${PROJECT_DIRECTORY}/.evergreen/run-socks5-tests.sh run kerberos tests: - - command: shell.exec + - command: subprocess.exec type: test params: + binary: bash working_dir: src - script: | - export PROJECT_DIRECTORY="$(pwd)" - export KRB5_KEYTAB='${gssapi_auth_keytab_base64}' - export KRB5_NEW_KEYTAB='${gssapi_auth_new_keytab_base64}' - export KRB5_PRINCIPAL='${gssapi_auth_principal}' - export MONGODB_URI='${gssapi_auth_mongodb_uri}' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + KRB5_KEYTAB: ${gssapi_auth_keytab_base64} + KRB5_NEW_KEYTAB: ${gssapi_auth_new_keytab_base64} + KRB5_PRINCIPAL: ${gssapi_auth_principal} + MONGODB_URI: ${gssapi_auth_mongodb_uri} + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-kerberos-tests.sh run ldap tests: - - command: shell.exec + - command: subprocess.exec type: test params: working_dir: src - script: | - export PROJECT_DIRECTORY="$(pwd)" - export MONGODB_URI='${plain_auth_mongodb_uri}' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh + binary: bash + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_URI: ${plain_auth_mongodb_uri} + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-ldap-tests.sh run data lake tests: - - command: shell.exec + - command: subprocess.exec type: test params: working_dir: src - script: | - export PROJECT_DIRECTORY="$(pwd)" - export MONGODB_URI='mongodb://mhuser:pencil@localhost' - export NODE_LTS_VERSION='${NODE_LTS_VERSION}' - - bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh + binary: bash + env: + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_URI: mongodb://mhuser:pencil@localhost + NODE_LTS_VERSION: ${NODE_LTS_VERSION} + args: + - .evergreen/run-data-lake-tests.sh run tls tests: - command: shell.exec type: test @@ -817,7 +832,7 @@ functions: cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen - tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . + tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . $DRIVERS_TOOLS cd ${DRIVERS_TOOLS}/.evergreen/auth_aws From e54f060f5f5391e0bdc0242e9d549ecad8f7d200 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Tue, 8 Oct 2024 09:18:02 -0400 Subject: [PATCH 06/18] chore: fix ecs --- .evergreen/config.in.yml | 7 ++++++- .evergreen/config.yml | 9 ++++++++- .evergreen/run-azure-kms-tests.sh | 2 ++ .evergreen/run-gcp-kms-tests.sh | 2 ++ .evergreen/run-mongodb-aws-ecs-test.sh | 10 ++++++---- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 58883868c6..905ef6989a 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -871,7 +871,11 @@ functions: echo "npm run check:aws" >> $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen - tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . $DRIVERS_TOOLS + + cd .. + tar -czf src.tgz src drivers-tools + mv src.tgz $ECS_SRC_DIR/src.tgz + cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh @@ -988,6 +992,7 @@ functions: env: MONGODB_URI: ${MONGODB_URI} PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - "${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh" diff --git a/.evergreen/config.yml b/.evergreen/config.yml index f77bbb1953..e2bd494c39 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -832,7 +832,13 @@ functions: cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen - tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . $DRIVERS_TOOLS + + cd .. + + tar -czf src.tgz src drivers-tools + + mv src.tgz $ECS_SRC_DIR/src.tgz + cd ${DRIVERS_TOOLS}/.evergreen/auth_aws @@ -957,6 +963,7 @@ functions: env: MONGODB_URI: ${MONGODB_URI} PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh diff --git a/.evergreen/run-azure-kms-tests.sh b/.evergreen/run-azure-kms-tests.sh index 40ad4b0ecc..17d8123ba0 100644 --- a/.evergreen/run-azure-kms-tests.sh +++ b/.evergreen/run-azure-kms-tests.sh @@ -5,6 +5,8 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY +source "$PROJECT_DIRECTORY/.evergreen/prepare-shell.sh" + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-gcp-kms-tests.sh b/.evergreen/run-gcp-kms-tests.sh index a576828e6c..5a82650759 100644 --- a/.evergreen/run-gcp-kms-tests.sh +++ b/.evergreen/run-gcp-kms-tests.sh @@ -5,6 +5,8 @@ set -o errexit pushd "src" PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY +source "$PROJECT_DIRECTORY/.evergreen/prepare-shell.sh" + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 800d455f60..bcbfff4a08 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -3,11 +3,13 @@ set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail export MONGODB_URI="$1" -PROJECT_DIRECTORY="$(pwd)/src" -# untar packed archive -cd $PROJECT_DIRECTORY -tar -xzf src.tgz . +tar -xzf src/src.tgz +# produces src/ and drivers-tools/ + +cd src + +source ./.evergreen/prepare-shell.sh # should not run git clone # load node.js source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh From e2b526b85731272be13a3bf2974c4a19f60c1f42 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 11:49:28 -0400 Subject: [PATCH 07/18] chore: fix oidc --- .evergreen/run-oidc-prose-tests.sh | 3 +++ .evergreen/run-oidc-tests-azure.sh | 6 ++++-- .evergreen/run-oidc-tests-gcp.sh | 6 ++++-- .evergreen/run-oidc-tests-test.sh | 4 +++- .evergreen/run-oidc-unified-tests.sh | 3 +++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.evergreen/run-oidc-prose-tests.sh b/.evergreen/run-oidc-prose-tests.sh index beb4281e9e..b84db54b18 100755 --- a/.evergreen/run-oidc-prose-tests.sh +++ b/.evergreen/run-oidc-prose-tests.sh @@ -2,6 +2,9 @@ set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # Write all commands first to stderr +cd src +source ./.evergreen/prepare-shell.sh + ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh diff --git a/.evergreen/run-oidc-tests-azure.sh b/.evergreen/run-oidc-tests-azure.sh index 4fa7c5bd55..55c085605f 100644 --- a/.evergreen/run-oidc-tests-azure.sh +++ b/.evergreen/run-oidc-tests-azure.sh @@ -3,8 +3,10 @@ set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail export AZUREOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz -tar czf $AZUREOIDC_DRIVERS_TAR_FILE . +cd .. +tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools +cd - export AZUREOIDC_TEST_CMD="source ./env.sh && ENVIRONMENT=azure ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT -bash $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/run-driver-test.sh \ No newline at end of file +bash $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/run-driver-test.sh diff --git a/.evergreen/run-oidc-tests-gcp.sh b/.evergreen/run-oidc-tests-gcp.sh index f2fc1de2dc..d16e39b992 100644 --- a/.evergreen/run-oidc-tests-gcp.sh +++ b/.evergreen/run-oidc-tests-gcp.sh @@ -3,8 +3,10 @@ set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail export GCPOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz -tar czf $GCPOIDC_DRIVERS_TAR_FILE . +cd .. +tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools +cd - export GCPOIDC_TEST_CMD="source ./secrets-export.sh drivers/gcpoidc && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT -bash $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/run-driver-test.sh \ No newline at end of file +bash $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/run-driver-test.sh diff --git a/.evergreen/run-oidc-tests-test.sh b/.evergreen/run-oidc-tests-test.sh index 59389bc0ca..552b75edc3 100644 --- a/.evergreen/run-oidc-tests-test.sh +++ b/.evergreen/run-oidc-tests-test.sh @@ -2,10 +2,12 @@ set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail +cd src + source $DRIVERS_TOOLS/.evergreen/auth_oidc/secrets-export.sh export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT printenv export AWS_WEB_IDENTITY_TOKEN_FILE=$OIDC_TOKEN_FILE ls -la $OIDC_TOKEN_DIR -bash ./.evergreen/${SCRIPT} \ No newline at end of file +bash ./.evergreen/${SCRIPT} diff --git a/.evergreen/run-oidc-unified-tests.sh b/.evergreen/run-oidc-unified-tests.sh index 22be9eb371..1c78a8f64d 100755 --- a/.evergreen/run-oidc-unified-tests.sh +++ b/.evergreen/run-oidc-unified-tests.sh @@ -2,6 +2,9 @@ set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # Write all commands first to stderr +cd src +source ./.evergreen/prepare-shell.sh + ENVIRONMENT=${ENVIRONMENT:-"test"} PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh From 434f1e63efe38be64b7e038d1b1f3c8deaf0f189 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 11:55:28 -0400 Subject: [PATCH 08/18] chore: azure kms --- .evergreen/copy-driver-to-azure-and-run.sh | 2 +- .evergreen/run-azure-kms-tests.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.evergreen/copy-driver-to-azure-and-run.sh b/.evergreen/copy-driver-to-azure-and-run.sh index f3a4b805aa..3a680bc630 100644 --- a/.evergreen/copy-driver-to-azure-and-run.sh +++ b/.evergreen/copy-driver-to-azure-and-run.sh @@ -12,7 +12,7 @@ export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey echo "compressing node driver source ... begin" -tar -czf node-driver-source.tgz src $DRIVERS_TOOLS +tar -czf node-driver-source.tgz src drivers-tools echo "compressing node driver source ... end" export AZUREKMS_SRC=node-driver-source.tgz diff --git a/.evergreen/run-azure-kms-tests.sh b/.evergreen/run-azure-kms-tests.sh index 17d8123ba0..dfdcd03223 100644 --- a/.evergreen/run-azure-kms-tests.sh +++ b/.evergreen/run-azure-kms-tests.sh @@ -7,6 +7,8 @@ PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY source "$PROJECT_DIRECTORY/.evergreen/prepare-shell.sh" +bash "$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace From 9f2ee81033e6283d32a84ea903eb6f2805a2e6cc Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 11:57:02 -0400 Subject: [PATCH 09/18] chore: debug fle --- .evergreen/install-mongodb-client-encryption.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.evergreen/install-mongodb-client-encryption.sh b/.evergreen/install-mongodb-client-encryption.sh index 1236d3338c..cc4ea97e0a 100644 --- a/.evergreen/install-mongodb-client-encryption.sh +++ b/.evergreen/install-mongodb-client-encryption.sh @@ -13,6 +13,9 @@ rm -rf mongodb-client-encryption git clone https://github.com/mongodb-js/mongodb-client-encryption.git pushd mongodb-client-encryption +node --version +npm --version + if [ -n "${LIBMONGOCRYPT_VERSION}" ]; then # nightly tests test with `latest` to test against the laster FLE build. npm run install:libmongocrypt -- --build --libVersion $LIBMONGOCRYPT_VERSION From 0ccffd628f8d0455a63200369a0cc86a02465fcd Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 11:58:31 -0400 Subject: [PATCH 10/18] chore: gcp kms --- .evergreen/run-gcp-kms-tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/run-gcp-kms-tests.sh b/.evergreen/run-gcp-kms-tests.sh index 5a82650759..4ce06b0301 100644 --- a/.evergreen/run-gcp-kms-tests.sh +++ b/.evergreen/run-gcp-kms-tests.sh @@ -7,6 +7,8 @@ PROJECT_DIRECTORY="$(pwd)" export PROJECT_DIRECTORY source "$PROJECT_DIRECTORY/.evergreen/prepare-shell.sh" +bash "$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh" + source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh set -o xtrace From 2f979a067720986756b53ca6c90b6a58b21d4b4a Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 12:09:50 -0400 Subject: [PATCH 11/18] fix npm version --- .evergreen/install-dependencies.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 97e7a938ad..aea32d1980 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -8,7 +8,13 @@ set -o errexit # Exit the script with error if any of the commands fail export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} # npm version can be defined in the environment for cases where we need to install # a version lower than latest to support EOL Node versions. -export NPM_VERSION=${NPM_VERSION:-latest} + +# If NODE_LTS_VERSION is numeric and less than 18, default to 9. Do not override if it is already set. +if [[ "$NODE_LTS_VERSION" =~ ^[0-9]+$ && "$NODE_LTS_VERSION" -lt 18 ]]; then + export NPM_VERSION=${NPM_VERSION:-9} +else + export NPM_VERSION=${NPM_VERSION:-latest} +fi source $DRIVERS_TOOLS/.evergreen/install-node.sh From bca5747da489866621b708f6dccc3ec02e571331 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 12:21:31 -0400 Subject: [PATCH 12/18] chore: fix install fle --- .evergreen/config.in.yml | 1 + .evergreen/install-dependencies.sh | 3 --- .evergreen/install-mongodb-client-encryption.sh | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 905ef6989a..ccbc4e18c7 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -1126,6 +1126,7 @@ functions: env: INSTALL_DIR: mongodb-client-encryption PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index aea32d1980..ef56c295fb 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -20,7 +20,4 @@ source $DRIVERS_TOOLS/.evergreen/install-node.sh npm install "${NPM_OPTIONS}" -npm ls - - source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh diff --git a/.evergreen/install-mongodb-client-encryption.sh b/.evergreen/install-mongodb-client-encryption.sh index cc4ea97e0a..ae7ace3589 100644 --- a/.evergreen/install-mongodb-client-encryption.sh +++ b/.evergreen/install-mongodb-client-encryption.sh @@ -1,5 +1,6 @@ #! /usr/bin/env bash set +o xtrace +set +o errexit # Initial checks for running these tests if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi From c0bfabfe793ffb7fbd23a7fa46c14af9504e0acd Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 14:05:48 -0400 Subject: [PATCH 13/18] gen config --- .evergreen/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index e2bd494c39..8c3ba94ed4 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1087,6 +1087,7 @@ functions: env: INSTALL_DIR: mongodb-client-encryption PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh From f4dfbbe0ec3bb63c42fc586748c8fbac1cc0308c Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 14:51:48 -0400 Subject: [PATCH 14/18] copy pasta --- .evergreen/install-mongodb-client-encryption.sh | 8 +++----- .evergreen/run-oidc-tests-azure.sh | 2 +- .evergreen/run-oidc-tests-gcp.sh | 4 ++-- .evergreen/run-oidc-tests-test.sh | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.evergreen/install-mongodb-client-encryption.sh b/.evergreen/install-mongodb-client-encryption.sh index ae7ace3589..1bea94950b 100644 --- a/.evergreen/install-mongodb-client-encryption.sh +++ b/.evergreen/install-mongodb-client-encryption.sh @@ -1,15 +1,13 @@ #! /usr/bin/env bash -set +o xtrace -set +o errexit + +set -o xtrace # Write all commands first to stderr +set -o errexit # Exit the script with error if any of the commands fail # Initial checks for running these tests if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh -set -o xtrace # Write all commands first to stderr -set -o errexit # Exit the script with error if any of the commands fail - rm -rf mongodb-client-encryption git clone https://github.com/mongodb-js/mongodb-client-encryption.git pushd mongodb-client-encryption diff --git a/.evergreen/run-oidc-tests-azure.sh b/.evergreen/run-oidc-tests-azure.sh index 55c085605f..cfbeafe4e7 100644 --- a/.evergreen/run-oidc-tests-azure.sh +++ b/.evergreen/run-oidc-tests-azure.sh @@ -6,7 +6,7 @@ export AZUREOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz cd .. tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools cd - -export AZUREOIDC_TEST_CMD="source ./env.sh && ENVIRONMENT=azure ./.evergreen/${SCRIPT}" +export AZUREOIDC_TEST_CMD="cd src && source ./env.sh && ENVIRONMENT=azure ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT bash $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/run-driver-test.sh diff --git a/.evergreen/run-oidc-tests-gcp.sh b/.evergreen/run-oidc-tests-gcp.sh index d16e39b992..f8316690b8 100644 --- a/.evergreen/run-oidc-tests-gcp.sh +++ b/.evergreen/run-oidc-tests-gcp.sh @@ -4,9 +4,9 @@ set -o errexit # Exit the script with error if any of the commands fail export GCPOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz cd .. -tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools +tar -czf $GCPOIDC_DRIVERS_TAR_FILE src drivers-tools cd - -export GCPOIDC_TEST_CMD="source ./secrets-export.sh drivers/gcpoidc && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}" +export GCPOIDC_TEST_CMD="cd src && source ./secrets-export.sh drivers/gcpoidc && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT bash $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/run-driver-test.sh diff --git a/.evergreen/run-oidc-tests-test.sh b/.evergreen/run-oidc-tests-test.sh index 552b75edc3..5e3d22e6df 100644 --- a/.evergreen/run-oidc-tests-test.sh +++ b/.evergreen/run-oidc-tests-test.sh @@ -10,4 +10,5 @@ export ENVIRONMENT=$ENVIRONMENT printenv export AWS_WEB_IDENTITY_TOKEN_FILE=$OIDC_TOKEN_FILE ls -la $OIDC_TOKEN_DIR +ls . bash ./.evergreen/${SCRIPT} From 552d84863063af566fe04651665f029915a0000e Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 14:56:16 -0400 Subject: [PATCH 15/18] chore: typo --- .evergreen/run-oidc-tests-test.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.evergreen/run-oidc-tests-test.sh b/.evergreen/run-oidc-tests-test.sh index 5e3d22e6df..e4f1c3bfb6 100644 --- a/.evergreen/run-oidc-tests-test.sh +++ b/.evergreen/run-oidc-tests-test.sh @@ -2,13 +2,10 @@ set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail -cd src - source $DRIVERS_TOOLS/.evergreen/auth_oidc/secrets-export.sh export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT printenv export AWS_WEB_IDENTITY_TOKEN_FILE=$OIDC_TOKEN_FILE ls -la $OIDC_TOKEN_DIR -ls . bash ./.evergreen/${SCRIPT} From f35b9bd40121e694af10324619544a737f0f5148 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 15:05:54 -0400 Subject: [PATCH 16/18] chore: fix local OIDC tests --- .evergreen/run-oidc-prose-tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.evergreen/run-oidc-prose-tests.sh b/.evergreen/run-oidc-prose-tests.sh index b84db54b18..f5339c9366 100755 --- a/.evergreen/run-oidc-prose-tests.sh +++ b/.evergreen/run-oidc-prose-tests.sh @@ -2,7 +2,10 @@ set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # Write all commands first to stderr -cd src +if [[ -d "src/.evergreen" ]]; then + cd src # when on azure or gcp we're above the src directory +fi + source ./.evergreen/prepare-shell.sh ENVIRONMENT=${ENVIRONMENT:-"test"} From e5e6c2326d2b8e8c16fe0f89d8759b9271f4c2a4 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 15:56:13 -0400 Subject: [PATCH 17/18] chore: fix azure --- .evergreen/run-oidc-prose-tests.sh | 4 +--- .evergreen/run-oidc-tests-azure.sh | 2 +- .evergreen/run-oidc-tests-gcp.sh | 2 +- .evergreen/run-oidc-unified-tests.sh | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.evergreen/run-oidc-prose-tests.sh b/.evergreen/run-oidc-prose-tests.sh index f5339c9366..1f19612979 100755 --- a/.evergreen/run-oidc-prose-tests.sh +++ b/.evergreen/run-oidc-prose-tests.sh @@ -2,9 +2,7 @@ set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # Write all commands first to stderr -if [[ -d "src/.evergreen" ]]; then - cd src # when on azure or gcp we're above the src directory -fi +[[ -d "src/.evergreen" ]] && cd src # when on azure or gcp we are above the src directory source ./.evergreen/prepare-shell.sh diff --git a/.evergreen/run-oidc-tests-azure.sh b/.evergreen/run-oidc-tests-azure.sh index cfbeafe4e7..5ce21d65d9 100644 --- a/.evergreen/run-oidc-tests-azure.sh +++ b/.evergreen/run-oidc-tests-azure.sh @@ -6,7 +6,7 @@ export AZUREOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz cd .. tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools cd - -export AZUREOIDC_TEST_CMD="cd src && source ./env.sh && ENVIRONMENT=azure ./.evergreen/${SCRIPT}" +export AZUREOIDC_TEST_CMD="source ./env.sh && cd src && ENVIRONMENT=azure ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT bash $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/run-driver-test.sh diff --git a/.evergreen/run-oidc-tests-gcp.sh b/.evergreen/run-oidc-tests-gcp.sh index f8316690b8..3ec71bfc4a 100644 --- a/.evergreen/run-oidc-tests-gcp.sh +++ b/.evergreen/run-oidc-tests-gcp.sh @@ -6,7 +6,7 @@ export GCPOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz cd .. tar -czf $GCPOIDC_DRIVERS_TAR_FILE src drivers-tools cd - -export GCPOIDC_TEST_CMD="cd src && source ./secrets-export.sh drivers/gcpoidc && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}" +export GCPOIDC_TEST_CMD="source ./secrets-export.sh drivers/gcpoidc && cd src && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}" export PROJECT_DIRECTORY=$PROJECT_DIRECTORY export ENVIRONMENT=$ENVIRONMENT bash $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/run-driver-test.sh diff --git a/.evergreen/run-oidc-unified-tests.sh b/.evergreen/run-oidc-unified-tests.sh index 1c78a8f64d..15a5e0d08f 100755 --- a/.evergreen/run-oidc-unified-tests.sh +++ b/.evergreen/run-oidc-unified-tests.sh @@ -2,7 +2,8 @@ set -o errexit # Exit the script with error if any of the commands fail set -o xtrace # Write all commands first to stderr -cd src +[[ -d "src/.evergreen" ]] && cd src # when on azure or gcp we are above the src directory + source ./.evergreen/prepare-shell.sh ENVIRONMENT=${ENVIRONMENT:-"test"} From c4db7e7089e4de762a903862791076c398c4faf5 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Oct 2024 17:50:57 -0400 Subject: [PATCH 18/18] chore: echos --- .evergreen/copy-driver-to-azure-and-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/copy-driver-to-azure-and-run.sh b/.evergreen/copy-driver-to-azure-and-run.sh index 3a680bc630..46fc4aa2e3 100644 --- a/.evergreen/copy-driver-to-azure-and-run.sh +++ b/.evergreen/copy-driver-to-azure-and-run.sh @@ -11,9 +11,9 @@ source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey -echo "compressing node driver source ... begin" +echo "compressing node driver source and tools ... begin" tar -czf node-driver-source.tgz src drivers-tools -echo "compressing node driver source ... end" +echo "compressing node driver source and tools ... end" export AZUREKMS_SRC=node-driver-source.tgz export AZUREKMS_DST="./"