From 80bdc331da5352a7f86217f51f288111e7ea05ba Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 10 May 2023 20:18:45 +0200 Subject: [PATCH 01/13] test: use new evergreen scripts --- .evergreen/config.in.yml | 46 ++++---- .evergreen/config.yml | 204 +++++++++++++++++++----------------- .evergreen/prepare-shell.sh | 2 +- 3 files changed, 136 insertions(+), 116 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index df9142ffa80..da8b218891f 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -675,9 +675,10 @@ functions: shell: bash script: | ${PREPARE_SHELL} + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js + python aws_tester.py regular - command: shell.exec type: test params: @@ -706,9 +707,10 @@ functions: shell: bash script: | ${PREPARE_SHELL} + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js + python aws_tester.py assume-role - command: shell.exec type: test params: @@ -744,9 +746,10 @@ functions: # Write an empty prepare_mongodb_aws so no auth environment variables # are set. echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_ec2.js + python aws_tester.py ec2 - command: shell.exec type: test params: @@ -762,9 +765,12 @@ functions: params: working_dir: "src" silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_regular_aws.js + . ./activate-authawsvenv.sh + python aws_tester.py regular cd - cat < "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account} @@ -785,9 +791,12 @@ functions: params: working_dir: "src" silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_assume_role.js + . ./activate-authawsvenv.sh + python aws_tester.py assume-role cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json) @@ -809,10 +818,12 @@ functions: params: working_dir: "src" silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js + . ./activate-authawsvenv.sh + python aws_tester.py web-identity cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file} @@ -834,10 +845,12 @@ functions: params: working_dir: "src" silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js + . ./activate-authawsvenv.sh + python aws_tester.py web-identity cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file} @@ -864,22 +877,19 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . - cd $AUTH_AWS_DIR - cat < setup.js - const mongo_binaries = "$MONGODB_BINARIES"; - const project_dir = "$ECS_SRC_DIR"; - EOF - - cat setup.js + set -ex + cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js + export MONGODB_BINARIES="${MONGODB_BINARIES}"; + export PROJECT_DIRECTORY=$ECS_SRC_DIR; + python aws_tester.py ecs "run-ocsp-test": - command: shell.exec diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 925f5a40e8a..0900a99d7fb 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -18,8 +18,8 @@ functions: working_dir: src binary: bash env: - is_patch: ${is_patch} - project: ${project} + is_patch: '${is_patch}' + project: '${project}' args: - .evergreen/prepare-shell.sh - command: expansions.update @@ -31,16 +31,16 @@ functions: binary: bash add_expansions_to_env: true env: - MONGODB_VERSION: ${VERSION} - TOPOLOGY: ${TOPOLOGY} - AUTH: ${AUTH} - SSL: ${SSL} - ORCHESTRATION_FILE: ${ORCHESTRATION_FILE} - REQUIRE_API_VERSION: ${REQUIRE_API_VERSION} - LOAD_BALANCER: ${LOAD_BALANCER} - COMPRESSOR: ${COMPRESSOR} - DRIVERS_TOOLS: ${DRIVERS_TOOLS} - MONGODB_BINARIES: ${MONGODB_BINARIES} + MONGODB_VERSION: '${VERSION}' + TOPOLOGY: '${TOPOLOGY}' + AUTH: '${AUTH}' + SSL: '${SSL}' + ORCHESTRATION_FILE: '${ORCHESTRATION_FILE}' + REQUIRE_API_VERSION: '${REQUIRE_API_VERSION}' + LOAD_BALANCER: '${LOAD_BALANCER}' + COMPRESSOR: '${COMPRESSOR}' + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + MONGODB_BINARIES: '${MONGODB_BINARIES}' args: - src/.evergreen/run-orchestration.sh - command: expansions.update @@ -67,7 +67,7 @@ functions: args: - .evergreen/run-kms-servers.sh env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' - command: subprocess.exec params: background: true @@ -76,11 +76,11 @@ functions: args: - .evergreen/run-azure-kms-mock-server.sh env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' bootstrap oidc: - command: ec2.assume_role params: - role_arn: ${OIDC_AWS_ROLE_ARN} + role_arn: '${OIDC_AWS_ROLE_ARN}' - command: shell.exec type: test params: @@ -111,7 +111,7 @@ functions: args: - .evergreen/setup-oidc-roles.sh env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' run oidc tests aws: - command: shell.exec type: test @@ -129,7 +129,7 @@ functions: run deployed aws lambda tests: - command: ec2.assume_role params: - role_arn: ${LAMBDA_AWS_ROLE_ARN} + role_arn: '${LAMBDA_AWS_ROLE_ARN}' duration_seconds: 3600 - command: subprocess.exec params: @@ -138,18 +138,18 @@ functions: args: - .evergreen/run-deployed-lambda-aws-tests.sh env: - TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda - DRIVERS_TOOLS: ${DRIVERS_TOOLS} - DRIVERS_ATLAS_PUBLIC_API_KEY: ${DRIVERS_ATLAS_PUBLIC_API_KEY} - DRIVERS_ATLAS_PRIVATE_API_KEY: ${DRIVERS_ATLAS_PRIVATE_API_KEY} - DRIVERS_ATLAS_LAMBDA_USER: ${DRIVERS_ATLAS_LAMBDA_USER} - DRIVERS_ATLAS_LAMBDA_PASSWORD: ${DRIVERS_ATLAS_LAMBDA_PASSWORD} - DRIVERS_ATLAS_GROUP_ID: ${DRIVERS_ATLAS_GROUP_ID} + TEST_LAMBDA_DIRECTORY: '${PROJECT_DIRECTORY}/test/lambda' + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + DRIVERS_ATLAS_PUBLIC_API_KEY: '${DRIVERS_ATLAS_PUBLIC_API_KEY}' + DRIVERS_ATLAS_PRIVATE_API_KEY: '${DRIVERS_ATLAS_PRIVATE_API_KEY}' + DRIVERS_ATLAS_LAMBDA_USER: '${DRIVERS_ATLAS_LAMBDA_USER}' + DRIVERS_ATLAS_LAMBDA_PASSWORD: '${DRIVERS_ATLAS_LAMBDA_PASSWORD}' + DRIVERS_ATLAS_GROUP_ID: '${DRIVERS_ATLAS_GROUP_ID}' LAMBDA_STACK_NAME: dbx-node-lambda AWS_REGION: us-east-1 - AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} - AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN} + AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}' + AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}' + AWS_SESSION_TOKEN: '${AWS_SESSION_TOKEN}' run tests: - command: shell.exec type: test @@ -326,10 +326,10 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh' run unit tests: - command: subprocess.exec type: test @@ -337,10 +337,10 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh' check types: - command: subprocess.exec type: test @@ -348,12 +348,12 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - TS_VERSION: ${TS_VERSION} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + TS_VERSION: '${TS_VERSION}' TS_CHECK: CHECK_TYPES binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh' compile driver: - command: subprocess.exec type: test @@ -361,43 +361,43 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - TS_VERSION: ${TS_VERSION} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + TS_VERSION: '${TS_VERSION}' TS_CHECK: COMPILE_DRIVER binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh' compile mongosh: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - TASK_ID: ${task_id} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + TASK_ID: '${task_id}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh' run mongosh tests for package: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - TASK_ID: ${task_id} - MONGOSH_RUN_ONLY_IN_PACKAGE: ${mongosh_package} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + TASK_ID: '${task_id}' + MONGOSH_RUN_ONLY_IN_PACKAGE: '${mongosh_package}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh' run mongosh package scope test: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - TASK_ID: ${task_id} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + TASK_ID: '${task_id}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh' cleanup: - command: shell.exec params: @@ -627,9 +627,10 @@ functions: shell: bash script: | ${PREPARE_SHELL} + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js + python aws_tester.py regular - command: shell.exec type: test params: @@ -657,9 +658,10 @@ functions: shell: bash script: | ${PREPARE_SHELL} + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js + python aws_tester.py assume-role - command: shell.exec type: test params: @@ -694,9 +696,10 @@ functions: # Write an empty prepare_mongodb_aws so no auth environment variables # are set. echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo aws_e2e_ec2.js + python aws_tester.py ec2 - command: shell.exec type: test params: @@ -711,9 +714,12 @@ functions: params: working_dir: src silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_regular_aws.js + . ./activate-authawsvenv.sh + python aws_tester.py regular cd - cat < "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account} @@ -733,9 +739,12 @@ functions: params: working_dir: src silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_assume_role.js + . ./activate-authawsvenv.sh + python aws_tester.py assume-role cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json) @@ -756,10 +765,12 @@ functions: params: working_dir: src silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js + . ./activate-authawsvenv.sh + python aws_tester.py web-identity cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file} @@ -780,10 +791,12 @@ functions: params: working_dir: src silent: true + shell: bash script: | + set -ex cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh - ${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js + . ./activate-authawsvenv.sh + python aws_tester.py web-identity cd - cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file} @@ -809,22 +822,19 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY . - cd $AUTH_AWS_DIR - cat < setup.js - const mongo_binaries = "$MONGODB_BINARIES"; - const project_dir = "$ECS_SRC_DIR"; - EOF - - cat setup.js + set -ex + cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh - ${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js + export MONGODB_BINARIES="${MONGODB_BINARIES}"; + export PROJECT_DIRECTORY=$ECS_SRC_DIR; + python aws_tester.py ecs run-ocsp-test: - command: shell.exec type: test @@ -934,11 +944,11 @@ functions: working_dir: src timeout_secs: 60 env: - MONGODB_URI: ${MONGODB_URI} - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + MONGODB_URI: '${MONGODB_URI}' + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh' run lambda handler example tests with aws auth: - command: shell.exec type: test @@ -973,11 +983,11 @@ functions: npx nyc report --reporter=json - command: s3.put params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} + aws_key: '${aws_key}' + aws_secret: '${aws_secret}' local_file: src/coverage/coverage-final.json optional: true - remote_file: mongo-node-driver/${revision}/${version_id}/coverage.${build_variant}.${task_name}.json + remote_file: 'mongo-node-driver/${revision}/${version_id}/coverage.${build_variant}.${task_name}.json' bucket: mciuploads permissions: public-read content_type: application/json @@ -1016,10 +1026,10 @@ functions: --region us-east-1 - command: s3.put params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} + aws_key: '${aws_key}' + aws_secret: '${aws_secret}' local_file: src/coverage-report/index.html - remote_file: mongo-node-driver/${revision}/${version_id}/coverage/index.html + remote_file: 'mongo-node-driver/${revision}/${version_id}/coverage/index.html' bucket: mciuploads permissions: public-read content_type: text/html @@ -1030,11 +1040,11 @@ functions: params: working_dir: src env: - PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} - MONGODB_URI: ${MONGODB_URI} + PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + MONGODB_URI: '${MONGODB_URI}' binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh + - '${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh' tasks: - name: test-serverless tags: @@ -1070,11 +1080,11 @@ tasks: binary: bash add_expansions_to_env: true env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} - GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} - GCPKMS_PROJECT: ${GCPKMS_PROJECT} - GCPKMS_ZONE: ${GCPKMS_ZONE} - GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} + DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' + GCPKMS_PROJECT: '${GCPKMS_PROJECT}' + GCPKMS_ZONE: '${GCPKMS_ZONE}' + GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' args: - src/.evergreen/setup-gcp-testing.sh - command: subprocess.exec @@ -1083,13 +1093,13 @@ tasks: working_dir: src binary: bash env: - GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} - GCPKMS_PROJECT: ${GCPKMS_PROJECT} - GCPKMS_ZONE: ${GCPKMS_ZONE} - GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} + GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' + GCPKMS_PROJECT: '${GCPKMS_PROJECT}' + GCPKMS_ZONE: '${GCPKMS_ZONE}' + GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' GCPKMS_CMD: env EXPECTED_GCPKMS_OUTCOME=success bash src/.evergreen/run-gcp-kms-tests.sh args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh + - '${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh' - name: test-gcpkms-fail-task commands: - func: install dependencies @@ -1125,7 +1135,7 @@ tasks: env: AZUREKMS_CMD: env EXPECTED_AZUREKMS_OUTCOME=success bash src/.evergreen/run-azure-kms-tests.sh args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh + - '${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh' - name: test-azurekms-fail-task commands: - func: install dependencies @@ -3333,9 +3343,9 @@ task_groups: binary: bash add_expansions_to_env: true env: - testgcpkms_key_file: ${gcpkms_key_file} - GCPKMS_SERVICEACCOUNT: ${gcpkms_service_account} - GCPKMS_DRIVERS_TOOLS: ${DRIVERS_TOOLS} + testgcpkms_key_file: '${gcpkms_key_file}' + GCPKMS_SERVICEACCOUNT: '${gcpkms_service_account}' + GCPKMS_DRIVERS_TOOLS: '${DRIVERS_TOOLS}' GCPKMS_MACHINETYPE: e2-standard-4 args: - .evergreen/setup-gcp-instance.sh @@ -3348,12 +3358,12 @@ task_groups: binary: bash add_expansions_to_env: true env: - GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} - GCPKMS_PROJECT: ${GCPKMS_PROJECT} - GCPKMS_ZONE: ${GCPKMS_ZONE} - GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} + GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' + GCPKMS_PROJECT: '${GCPKMS_PROJECT}' + GCPKMS_ZONE: '${GCPKMS_ZONE}' + GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/delete-instance.sh + - '${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/delete-instance.sh' tasks: - test-gcpkms-task - name: test_azurekms_task_group @@ -3380,7 +3390,7 @@ task_groups: binary: bash add_expansions_to_env: true args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/delete-vm.sh + - '${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/delete-vm.sh' tasks: - test-azurekms-task pre: diff --git a/.evergreen/prepare-shell.sh b/.evergreen/prepare-shell.sh index 4e2cfb0eafc..9fc22e1e529 100644 --- a/.evergreen/prepare-shell.sh +++ b/.evergreen/prepare-shell.sh @@ -31,7 +31,7 @@ export PATH="$MONGODB_BINARIES:$PATH" if [ ! -d "$DRIVERS_TOOLS" ]; then # Only clone driver tools if it does not exist - git clone --depth=1 "https://github.com/mongodb-labs/drivers-evergreen-tools.git" "${DRIVERS_TOOLS}" + git clone --depth=1 --branch PYTHON-3692 "https://github.com/blink1073/drivers-evergreen-tools.git" "${DRIVERS_TOOLS}" fi cat < "$MONGO_ORCHESTRATION_HOME/orchestration.config" From 8990e0b09e1b0b0d1db4cf3931112f3676f53ebe Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Mon, 22 May 2023 19:00:12 +0200 Subject: [PATCH 02/13] test: bring back sed fix --- .evergreen/config.in.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index da8b218891f..3ee941be1f1 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -877,7 +877,7 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen From 67955fd4d235e5f48aa72283bd47cb91d7ee7046 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Mon, 22 May 2023 19:02:09 +0200 Subject: [PATCH 03/13] test: fix path --- .evergreen/config.in.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 3ee941be1f1..b4b0e81655e 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -888,7 +888,7 @@ functions: cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh export MONGODB_BINARIES="${MONGODB_BINARIES}"; - export PROJECT_DIRECTORY=$ECS_SRC_DIR; + export PROJECT_DIRECTORY=$PROJECT_DIRECTORY; python aws_tester.py ecs "run-ocsp-test": From 0c19a173b47ed22ebeb664ca9e818f00a0cbc495 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Mon, 22 May 2023 19:23:10 +0200 Subject: [PATCH 04/13] chore: debug --- test/integration/auth/mongodb_aws.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/integration/auth/mongodb_aws.test.ts b/test/integration/auth/mongodb_aws.test.ts index 4f404ffa94f..132fe47e670 100644 --- a/test/integration/auth/mongodb_aws.test.ts +++ b/test/integration/auth/mongodb_aws.test.ts @@ -21,7 +21,9 @@ describe('MONGODB-AWS', function () { }); it('should not authorize when not authenticated', async function () { + console.log(this.configuration.url()); const url = removeAuthFromConnectionString(this.configuration.url()); + console.log(url); client = this.configuration.newClient(url); // strip provided URI of credentials const error = await client @@ -29,9 +31,10 @@ describe('MONGODB-AWS', function () { .collection('aws_test') .estimatedDocumentCount() .catch(error => error); + console.log(error); - expect(error).to.be.instanceOf(MongoServerError); - expect(error).to.have.property('code', 13); + //expect(error).to.be.instanceOf(MongoServerError); + //expect(error).to.have.property('code', 13); }); it('should authorize when successfully authenticated', async function () { From d984dcdcaaec8f48ff3d67963eec75d3a321cedd Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Mon, 22 May 2023 19:46:49 +0200 Subject: [PATCH 05/13] test: remove debug --- test/integration/auth/mongodb_aws.test.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/integration/auth/mongodb_aws.test.ts b/test/integration/auth/mongodb_aws.test.ts index 132fe47e670..4f404ffa94f 100644 --- a/test/integration/auth/mongodb_aws.test.ts +++ b/test/integration/auth/mongodb_aws.test.ts @@ -21,9 +21,7 @@ describe('MONGODB-AWS', function () { }); it('should not authorize when not authenticated', async function () { - console.log(this.configuration.url()); const url = removeAuthFromConnectionString(this.configuration.url()); - console.log(url); client = this.configuration.newClient(url); // strip provided URI of credentials const error = await client @@ -31,10 +29,9 @@ describe('MONGODB-AWS', function () { .collection('aws_test') .estimatedDocumentCount() .catch(error => error); - console.log(error); - //expect(error).to.be.instanceOf(MongoServerError); - //expect(error).to.have.property('code', 13); + expect(error).to.be.instanceOf(MongoServerError); + expect(error).to.have.property('code', 13); }); it('should authorize when successfully authenticated', async function () { From 3f23114b9296e2ad124b0019864d01bf852c64f4 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 26 May 2023 15:50:48 -0400 Subject: [PATCH 06/13] test: use tools master --- .evergreen/prepare-shell.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/prepare-shell.sh b/.evergreen/prepare-shell.sh index 9fc22e1e529..4e2cfb0eafc 100644 --- a/.evergreen/prepare-shell.sh +++ b/.evergreen/prepare-shell.sh @@ -31,7 +31,7 @@ export PATH="$MONGODB_BINARIES:$PATH" if [ ! -d "$DRIVERS_TOOLS" ]; then # Only clone driver tools if it does not exist - git clone --depth=1 --branch PYTHON-3692 "https://github.com/blink1073/drivers-evergreen-tools.git" "${DRIVERS_TOOLS}" + git clone --depth=1 "https://github.com/mongodb-labs/drivers-evergreen-tools.git" "${DRIVERS_TOOLS}" fi cat < "$MONGO_ORCHESTRATION_HOME/orchestration.config" From 239ad1cab5417d2b427f75ceffd2cd515ad10919 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 08:55:13 -0400 Subject: [PATCH 07/13] test: remove auth fail test --- test/integration/auth/mongodb_aws.test.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/integration/auth/mongodb_aws.test.ts b/test/integration/auth/mongodb_aws.test.ts index 4f404ffa94f..9513475504a 100644 --- a/test/integration/auth/mongodb_aws.test.ts +++ b/test/integration/auth/mongodb_aws.test.ts @@ -4,7 +4,6 @@ import { performance } from 'perf_hooks'; import * as sinon from 'sinon'; import { MongoAWSError, MongoClient, MongoServerError } from '../../mongodb'; -import { removeAuthFromConnectionString } from '../../tools/utils'; describe('MONGODB-AWS', function () { let client: MongoClient; @@ -20,20 +19,6 @@ describe('MONGODB-AWS', function () { await client?.close(); }); - it('should not authorize when not authenticated', async function () { - const url = removeAuthFromConnectionString(this.configuration.url()); - client = this.configuration.newClient(url); // strip provided URI of credentials - - const error = await client - .db('aws') - .collection('aws_test') - .estimatedDocumentCount() - .catch(error => error); - - expect(error).to.be.instanceOf(MongoServerError); - expect(error).to.have.property('code', 13); - }); - it('should authorize when successfully authenticated', async function () { client = this.configuration.newClient(process.env.MONGODB_URI); // use the URI built by the test environment From e0454895016aec66f83d315bd9ad47370bb25c10 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 10:24:15 -0400 Subject: [PATCH 08/13] test: skip legacy shell --- .evergreen/run-orchestration.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.evergreen/run-orchestration.sh b/.evergreen/run-orchestration.sh index 74cea23b0cb..ef0f099cba2 100644 --- a/.evergreen/run-orchestration.sh +++ b/.evergreen/run-orchestration.sh @@ -30,4 +30,7 @@ echo "COMPRESSOR=${COMPRESSOR}" export PATH="$MONGODB_BINARIES:$PATH" echo "MONGODB_BINARIES=${MONGODB_BINARIES}" +export SKIP_LEGACY_SHELL="true" +echo "SKIP_LEGACY_SHELL=${SKIP_LEGACY_SHELL}" + bash "${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh" From 22abb0878153b35576aabced04499a2cb0ddba70 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 10:51:13 -0400 Subject: [PATCH 09/13] test: update config yml --- .evergreen/config.yml | 162 +++++++++++++++++++++--------------------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 0900a99d7fb..65adbe4d30c 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -18,8 +18,8 @@ functions: working_dir: src binary: bash env: - is_patch: '${is_patch}' - project: '${project}' + is_patch: ${is_patch} + project: ${project} args: - .evergreen/prepare-shell.sh - command: expansions.update @@ -31,16 +31,16 @@ functions: binary: bash add_expansions_to_env: true env: - MONGODB_VERSION: '${VERSION}' - TOPOLOGY: '${TOPOLOGY}' - AUTH: '${AUTH}' - SSL: '${SSL}' - ORCHESTRATION_FILE: '${ORCHESTRATION_FILE}' - REQUIRE_API_VERSION: '${REQUIRE_API_VERSION}' - LOAD_BALANCER: '${LOAD_BALANCER}' - COMPRESSOR: '${COMPRESSOR}' - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' - MONGODB_BINARIES: '${MONGODB_BINARIES}' + MONGODB_VERSION: ${VERSION} + TOPOLOGY: ${TOPOLOGY} + AUTH: ${AUTH} + SSL: ${SSL} + ORCHESTRATION_FILE: ${ORCHESTRATION_FILE} + REQUIRE_API_VERSION: ${REQUIRE_API_VERSION} + LOAD_BALANCER: ${LOAD_BALANCER} + COMPRESSOR: ${COMPRESSOR} + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_BINARIES: ${MONGODB_BINARIES} args: - src/.evergreen/run-orchestration.sh - command: expansions.update @@ -67,7 +67,7 @@ functions: args: - .evergreen/run-kms-servers.sh env: - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + DRIVERS_TOOLS: ${DRIVERS_TOOLS} - command: subprocess.exec params: background: true @@ -76,11 +76,11 @@ functions: args: - .evergreen/run-azure-kms-mock-server.sh env: - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + DRIVERS_TOOLS: ${DRIVERS_TOOLS} bootstrap oidc: - command: ec2.assume_role params: - role_arn: '${OIDC_AWS_ROLE_ARN}' + role_arn: ${OIDC_AWS_ROLE_ARN} - command: shell.exec type: test params: @@ -111,7 +111,7 @@ functions: args: - .evergreen/setup-oidc-roles.sh env: - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + DRIVERS_TOOLS: ${DRIVERS_TOOLS} run oidc tests aws: - command: shell.exec type: test @@ -129,7 +129,7 @@ functions: run deployed aws lambda tests: - command: ec2.assume_role params: - role_arn: '${LAMBDA_AWS_ROLE_ARN}' + role_arn: ${LAMBDA_AWS_ROLE_ARN} duration_seconds: 3600 - command: subprocess.exec params: @@ -138,18 +138,18 @@ functions: args: - .evergreen/run-deployed-lambda-aws-tests.sh env: - TEST_LAMBDA_DIRECTORY: '${PROJECT_DIRECTORY}/test/lambda' - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' - DRIVERS_ATLAS_PUBLIC_API_KEY: '${DRIVERS_ATLAS_PUBLIC_API_KEY}' - DRIVERS_ATLAS_PRIVATE_API_KEY: '${DRIVERS_ATLAS_PRIVATE_API_KEY}' - DRIVERS_ATLAS_LAMBDA_USER: '${DRIVERS_ATLAS_LAMBDA_USER}' - DRIVERS_ATLAS_LAMBDA_PASSWORD: '${DRIVERS_ATLAS_LAMBDA_PASSWORD}' - DRIVERS_ATLAS_GROUP_ID: '${DRIVERS_ATLAS_GROUP_ID}' + TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + DRIVERS_ATLAS_PUBLIC_API_KEY: ${DRIVERS_ATLAS_PUBLIC_API_KEY} + DRIVERS_ATLAS_PRIVATE_API_KEY: ${DRIVERS_ATLAS_PRIVATE_API_KEY} + DRIVERS_ATLAS_LAMBDA_USER: ${DRIVERS_ATLAS_LAMBDA_USER} + DRIVERS_ATLAS_LAMBDA_PASSWORD: ${DRIVERS_ATLAS_LAMBDA_PASSWORD} + DRIVERS_ATLAS_GROUP_ID: ${DRIVERS_ATLAS_GROUP_ID} LAMBDA_STACK_NAME: dbx-node-lambda AWS_REGION: us-east-1 - AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}' - AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}' - AWS_SESSION_TOKEN: '${AWS_SESSION_TOKEN}' + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} + AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN} run tests: - command: shell.exec type: test @@ -326,10 +326,10 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-lint-checks.sh run unit tests: - command: subprocess.exec type: test @@ -337,10 +337,10 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-unit-tests.sh check types: - command: subprocess.exec type: test @@ -348,12 +348,12 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - TS_VERSION: '${TS_VERSION}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + TS_VERSION: ${TS_VERSION} TS_CHECK: CHECK_TYPES binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh compile driver: - command: subprocess.exec type: test @@ -361,43 +361,43 @@ functions: working_dir: src timeout_secs: 60 env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - TS_VERSION: '${TS_VERSION}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + TS_VERSION: ${TS_VERSION} TS_CHECK: COMPILE_DRIVER binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh compile mongosh: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - TASK_ID: '${task_id}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + TASK_ID: ${task_id} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh run mongosh tests for package: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - TASK_ID: '${task_id}' - MONGOSH_RUN_ONLY_IN_PACKAGE: '${mongosh_package}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + TASK_ID: ${task_id} + MONGOSH_RUN_ONLY_IN_PACKAGE: ${mongosh_package} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-integration-tests.sh run mongosh package scope test: - command: subprocess.exec params: working_dir: src env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - TASK_ID: '${task_id}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + TASK_ID: ${task_id} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-mongosh-scope-test.sh cleanup: - command: shell.exec params: @@ -822,7 +822,7 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen @@ -833,7 +833,7 @@ functions: cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh export MONGODB_BINARIES="${MONGODB_BINARIES}"; - export PROJECT_DIRECTORY=$ECS_SRC_DIR; + export PROJECT_DIRECTORY=$PROJECT_DIRECTORY; python aws_tester.py ecs run-ocsp-test: - command: shell.exec @@ -944,11 +944,11 @@ functions: working_dir: src timeout_secs: 60 env: - MONGODB_URI: '${MONGODB_URI}' - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' + MONGODB_URI: ${MONGODB_URI} + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-lambda-tests.sh run lambda handler example tests with aws auth: - command: shell.exec type: test @@ -983,11 +983,11 @@ functions: npx nyc report --reporter=json - command: s3.put params: - aws_key: '${aws_key}' - aws_secret: '${aws_secret}' + aws_key: ${aws_key} + aws_secret: ${aws_secret} local_file: src/coverage/coverage-final.json optional: true - remote_file: 'mongo-node-driver/${revision}/${version_id}/coverage.${build_variant}.${task_name}.json' + remote_file: mongo-node-driver/${revision}/${version_id}/coverage.${build_variant}.${task_name}.json bucket: mciuploads permissions: public-read content_type: application/json @@ -1026,10 +1026,10 @@ functions: --region us-east-1 - command: s3.put params: - aws_key: '${aws_key}' - aws_secret: '${aws_secret}' + aws_key: ${aws_key} + aws_secret: ${aws_secret} local_file: src/coverage-report/index.html - remote_file: 'mongo-node-driver/${revision}/${version_id}/coverage/index.html' + remote_file: mongo-node-driver/${revision}/${version_id}/coverage/index.html bucket: mciuploads permissions: public-read content_type: text/html @@ -1040,11 +1040,11 @@ functions: params: working_dir: src env: - PROJECT_DIRECTORY: '${PROJECT_DIRECTORY}' - MONGODB_URI: '${MONGODB_URI}' + PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} + MONGODB_URI: ${MONGODB_URI} binary: bash args: - - '${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh' + - ${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh tasks: - name: test-serverless tags: @@ -1080,11 +1080,11 @@ tasks: binary: bash add_expansions_to_env: true env: - DRIVERS_TOOLS: '${DRIVERS_TOOLS}' - GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' - GCPKMS_PROJECT: '${GCPKMS_PROJECT}' - GCPKMS_ZONE: '${GCPKMS_ZONE}' - GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' + DRIVERS_TOOLS: ${DRIVERS_TOOLS} + GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} + GCPKMS_PROJECT: ${GCPKMS_PROJECT} + GCPKMS_ZONE: ${GCPKMS_ZONE} + GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} args: - src/.evergreen/setup-gcp-testing.sh - command: subprocess.exec @@ -1093,13 +1093,13 @@ tasks: working_dir: src binary: bash env: - GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' - GCPKMS_PROJECT: '${GCPKMS_PROJECT}' - GCPKMS_ZONE: '${GCPKMS_ZONE}' - GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' + GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} + GCPKMS_PROJECT: ${GCPKMS_PROJECT} + GCPKMS_ZONE: ${GCPKMS_ZONE} + GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} GCPKMS_CMD: env EXPECTED_GCPKMS_OUTCOME=success bash src/.evergreen/run-gcp-kms-tests.sh args: - - '${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh' + - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh - name: test-gcpkms-fail-task commands: - func: install dependencies @@ -1135,7 +1135,7 @@ tasks: env: AZUREKMS_CMD: env EXPECTED_AZUREKMS_OUTCOME=success bash src/.evergreen/run-azure-kms-tests.sh args: - - '${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh' + - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh - name: test-azurekms-fail-task commands: - func: install dependencies @@ -3343,9 +3343,9 @@ task_groups: binary: bash add_expansions_to_env: true env: - testgcpkms_key_file: '${gcpkms_key_file}' - GCPKMS_SERVICEACCOUNT: '${gcpkms_service_account}' - GCPKMS_DRIVERS_TOOLS: '${DRIVERS_TOOLS}' + testgcpkms_key_file: ${gcpkms_key_file} + GCPKMS_SERVICEACCOUNT: ${gcpkms_service_account} + GCPKMS_DRIVERS_TOOLS: ${DRIVERS_TOOLS} GCPKMS_MACHINETYPE: e2-standard-4 args: - .evergreen/setup-gcp-instance.sh @@ -3358,12 +3358,12 @@ task_groups: binary: bash add_expansions_to_env: true env: - GCPKMS_GCLOUD: '${GCPKMS_GCLOUD}' - GCPKMS_PROJECT: '${GCPKMS_PROJECT}' - GCPKMS_ZONE: '${GCPKMS_ZONE}' - GCPKMS_INSTANCENAME: '${GCPKMS_INSTANCENAME}' + GCPKMS_GCLOUD: ${GCPKMS_GCLOUD} + GCPKMS_PROJECT: ${GCPKMS_PROJECT} + GCPKMS_ZONE: ${GCPKMS_ZONE} + GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME} args: - - '${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/delete-instance.sh' + - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/delete-instance.sh tasks: - test-gcpkms-task - name: test_azurekms_task_group @@ -3390,7 +3390,7 @@ task_groups: binary: bash add_expansions_to_env: true args: - - '${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/delete-vm.sh' + - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/delete-vm.sh tasks: - test-azurekms-task pre: From b69be1efa11c233cdd5d877ff53a5c5933313428 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 13:48:14 -0400 Subject: [PATCH 10/13] test: inspect dir --- .evergreen/run-mongodb-aws-ecs-test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index e133a49fe77..25e34dac66d 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -5,8 +5,10 @@ set -o errexit # Exit the script with error if any of the commands fail export MONGODB_URI="$1" PROJECT_DIRECTORY="$(pwd)/src" +ls -la # untar packed archive cd $PROJECT_DIRECTORY +ls -la tar -xzf src.tgz . # load node.js From 16265c21ada3e2a661f19b5659c2f38532f3b1ce Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 14:13:42 -0400 Subject: [PATCH 11/13] test: archive already untared --- .evergreen/run-mongodb-aws-ecs-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 25e34dac66d..6297c3f2b75 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -9,7 +9,7 @@ ls -la # untar packed archive cd $PROJECT_DIRECTORY ls -la -tar -xzf src.tgz . +# tar -xzf src.tgz . # load node.js set +x From 998c0d3d7e6569ac7bdf5d5dfb6d5f7ce65d93bc Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 30 May 2023 14:30:56 -0400 Subject: [PATCH 12/13] test: fix project dir --- .evergreen/config.in.yml | 4 ++-- .evergreen/config.yml | 4 ++-- .evergreen/run-mongodb-aws-ecs-test.sh | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index b4b0e81655e..da8b218891f 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -877,7 +877,7 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen @@ -888,7 +888,7 @@ functions: cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh export MONGODB_BINARIES="${MONGODB_BINARIES}"; - export PROJECT_DIRECTORY=$PROJECT_DIRECTORY; + export PROJECT_DIRECTORY=$ECS_SRC_DIR; python aws_tester.py ecs "run-ocsp-test": diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 65adbe4d30c..e7209b2ac1e 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -822,7 +822,7 @@ functions: ECS_SRC_DIR=$AUTH_AWS_DIR/src # fix issue with `TestData` in SERVER-46340 - sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js + # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen @@ -833,7 +833,7 @@ functions: cd ${DRIVERS_TOOLS}/.evergreen/auth_aws . ./activate-authawsvenv.sh export MONGODB_BINARIES="${MONGODB_BINARIES}"; - export PROJECT_DIRECTORY=$PROJECT_DIRECTORY; + export PROJECT_DIRECTORY=$ECS_SRC_DIR; python aws_tester.py ecs run-ocsp-test: - command: shell.exec diff --git a/.evergreen/run-mongodb-aws-ecs-test.sh b/.evergreen/run-mongodb-aws-ecs-test.sh index 6297c3f2b75..e133a49fe77 100755 --- a/.evergreen/run-mongodb-aws-ecs-test.sh +++ b/.evergreen/run-mongodb-aws-ecs-test.sh @@ -5,11 +5,9 @@ set -o errexit # Exit the script with error if any of the commands fail export MONGODB_URI="$1" PROJECT_DIRECTORY="$(pwd)/src" -ls -la # untar packed archive cd $PROJECT_DIRECTORY -ls -la -# tar -xzf src.tgz . +tar -xzf src.tgz . # load node.js set +x From 057cbc0a35d3dd9c5acb8db527eb7619d075815b Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 31 May 2023 09:51:27 -0400 Subject: [PATCH 13/13] test: remove sed fix --- .evergreen/config.in.yml | 3 --- .evergreen/config.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index da8b218891f..36c567727e1 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -876,9 +876,6 @@ functions: AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws ECS_SRC_DIR=$AUTH_AWS_DIR/src - # fix issue with `TestData` in SERVER-46340 - # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js - # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen diff --git a/.evergreen/config.yml b/.evergreen/config.yml index e7209b2ac1e..d4907b1415f 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -821,9 +821,6 @@ functions: AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws ECS_SRC_DIR=$AUTH_AWS_DIR/src - # fix issue with `TestData` in SERVER-46340 - # sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js - # pack up project directory to ssh it to the container mkdir -p $ECS_SRC_DIR/.evergreen cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen