diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index b6200dd9c10..bb11e088cc2 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -134,24 +134,6 @@ functions: args: - .evergreen/perf-send.sh - "run serverless tests": - - command: timeout.update - params: - exec_timeout_secs: 1800 - - <<: *assume_secrets_manager_role - - command: subprocess.exec - type: test - params: - timeout_secs: 300 - working_dir: src - binary: bash - env: - AUTH: "auth" - SSL: "ssl" - add_expansions_to_env: true - args: - - .evergreen/run-serverless-tests.sh - "start-load-balancer": - command: shell.exec params: @@ -752,12 +734,6 @@ tasks: - func: "bootstrap mongohoused" - func: "run data lake tests" - - name: "test-serverless" - tags: ["serverless"] - commands: - - func: install dependencies - - func: "run serverless tests" - - name: "test-gcpkms-task" commands: - command: expansions.update @@ -1007,33 +983,6 @@ tasks: args: - .evergreen/run-search-index-management-tests.sh -task_groups: - - name: serverless_task_group - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 # 30 minutes - setup_group: - - func: "fetch source" - - command: subprocess.exec - params: - working_dir: "src" - binary: bash - env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} - args: - - .evergreen/setup-serverless.sh - - teardown_group: - - func: "upload test results" - - command: subprocess.exec - params: - working_dir: "src" - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh - - tasks: - - ".serverless" - - name: test_gcpkms_task_group setup_group_can_fail_task: true setup_group_timeout_secs: 1800 # 30 minutes diff --git a/.evergreen/config.yml b/.evergreen/config.yml index d1703ae3b43..be83f5ff7a6 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -107,25 +107,6 @@ functions: add_expansions_to_env: true args: - .evergreen/perf-send.sh - run serverless tests: - - command: timeout.update - params: - exec_timeout_secs: 1800 - - command: ec2.assume_role - params: - role_arn: ${DRIVERS_SECRETS_ARN} - - command: subprocess.exec - type: test - params: - timeout_secs: 300 - working_dir: src - binary: bash - env: - AUTH: auth - SSL: ssl - add_expansions_to_env: true - args: - - .evergreen/run-serverless-tests.sh start-load-balancer: - command: shell.exec params: @@ -688,12 +669,6 @@ tasks: - func: install dependencies - func: bootstrap mongohoused - func: run data lake tests - - name: test-serverless - tags: - - serverless - commands: - - func: install dependencies - - func: run serverless tests - name: test-gcpkms-task commands: - command: expansions.update @@ -934,379 +909,628 @@ tasks: add_expansions_to_env: true args: - .evergreen/run-search-index-management-tests.sh - - name: test-latest-server - tags: - - latest - - server - commands: - - command: expansions.update - type: setup + - name: test_gcpkms_task_group + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec params: - updates: - - {key: VERSION, value: latest} - - {key: TOPOLOGY, value: server} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-latest-replica_set - tags: - - latest - - replica_set - commands: - - command: expansions.update - type: setup + working_dir: src + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh + teardown_group: + - command: subprocess.exec params: - updates: - - {key: VERSION, value: latest} - - {key: TOPOLOGY, value: replica_set} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-latest-sharded_cluster - tags: - - latest - - sharded_cluster - commands: - - command: expansions.update - type: setup + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh + - func: upload coverage report + tasks: + - test-gcpkms-task + - name: test_azurekms_task_group + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec params: - updates: - - {key: VERSION, value: latest} - - {key: TOPOLOGY, value: sharded_cluster} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-rapid-server - tags: - - rapid - - server - commands: + working_dir: src + binary: bash + env: + AZUREKMS_VMNAME_PREFIX: NODE_DRIVER + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh + teardown_group: - command: expansions.update - type: setup params: - updates: - - {key: VERSION, value: rapid} - - {key: TOPOLOGY, value: server} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-rapid-replica_set - tags: - - rapid - - replica_set - commands: - - command: expansions.update - type: setup + file: testazurekms-expansions.yml + - command: subprocess.exec params: - updates: - - {key: VERSION, value: rapid} - - {key: TOPOLOGY, value: replica_set} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-rapid-sharded_cluster - tags: - - rapid - - sharded_cluster - commands: - - command: expansions.update - type: setup + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh + - func: upload coverage report + tasks: + - test-azurekms-task + - name: testk8soidc_task_group_eks + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec params: - updates: - - {key: VERSION, value: rapid} - - {key: TOPOLOGY, value: sharded_cluster} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-8.0-server - tags: - - '8.0' - - server - commands: - - command: expansions.update - type: setup + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh + teardown_group: + - func: upload coverage report + - command: subprocess.exec params: - updates: - - {key: VERSION, value: '8.0'} - - {key: TOPOLOGY, value: server} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-8.0-replica_set - tags: - - '8.0' - - replica_set - commands: - - command: expansions.update - type: setup + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-k8s-latest-eks + - name: testk8soidc_task_group_gke + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec params: - updates: - - {key: VERSION, value: '8.0'} - - {key: TOPOLOGY, value: replica_set} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-8.0-sharded_cluster - tags: - - '8.0' - - sharded_cluster - commands: - - command: expansions.update - type: setup + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh + teardown_group: + - func: upload coverage report + - command: subprocess.exec params: - updates: - - {key: VERSION, value: '8.0'} - - {key: TOPOLOGY, value: sharded_cluster} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-7.0-server - tags: - - '7.0' - - server - commands: - - command: expansions.update - type: setup + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-k8s-latest-gke + - name: testk8soidc_task_group_aks + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec params: - updates: - - {key: VERSION, value: '7.0'} - - {key: TOPOLOGY, value: server} - - {key: AUTH, value: auth} - - func: install dependencies - - func: bootstrap mongo-orchestration - - func: run tests - - name: test-7.0-replica_set - tags: - - '7.0' - - replica_set - commands: - - command: expansions.update - type: setup + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh + teardown_group: + - func: upload coverage report + - command: subprocess.exec params: - updates: - - {key: VERSION, value: '7.0'} + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-k8s-latest-aks + - name: testtestoidc_task_group + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: subprocess.exec + params: + binary: bash + include_expansions_in_env: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + env: + MONGODB_VERSION: '8.0' + args: + - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh + teardown_task: + - func: upload coverage report + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-test-latest + - name: testazureoidc_task_group + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: shell.exec + params: + shell: bash + add_expansions_to_env: true + script: |- + set -o errexit + ${PREPARE_SHELL} + export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER" + $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/setup.sh + teardown_group: + - command: shell.exec + params: + shell: bash + script: |- + ${PREPARE_SHELL} + $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/teardown.sh + - func: upload coverage report + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-azure-latest + - name: testgcpoidc_task_group + setup_group: + - func: fetch source + - func: assume secrets manager role + - command: shell.exec + params: + shell: bash + add_expansions_to_env: true + script: |- + set -o errexit + ${PREPARE_SHELL} + export GCPOIDC_VMNAME_PREFIX="NODE_DRIVER" + $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/setup.sh + teardown_group: + - command: shell.exec + params: + shell: bash + script: |- + ${PREPARE_SHELL} + $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/teardown.sh + - func: upload coverage report + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - oidc-auth-test-gcp-latest + - name: test_atlas_task_group + setup_group: + - func: fetch source + - command: expansions.update + type: setup + params: + updates: + - {key: MONGODB_VERSION, value: '7.0'} + - {key: LAMBDA_STACK_NAME, value: dbx-node-lambda} + - {key: CLUSTER_PREFIX, value: dbx-node-lambda} + - func: assume secrets manager role + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh + - atlas + - command: expansions.update + params: + file: src/atlas-expansion.yml + teardown_group: + - command: subprocess.exec + params: + working_dir: src + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh + - func: upload coverage report + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - test-aws-lambda-deployed + - name: test_atlas_task_group_search_indexes + setup_group: + - func: fetch source + - command: expansions.update + type: setup + params: + updates: + - {key: MONGODB_VERSION, value: '7.0'} + - {key: CLUSTER_PREFIX, value: dbx-node-lambda} + - func: assume secrets manager role + - command: subprocess.exec + params: + working_dir: src + binary: bash + add_expansions_to_env: true + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh + - command: expansions.update + params: + file: src/atlas-expansion.yml + teardown_group: + - command: subprocess.exec + params: + working_dir: src + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh + - func: upload coverage report + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 + tasks: + - test-search-index-helpers + - name: test-latest-server + tags: + - latest + - server + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: latest} + - {key: TOPOLOGY, value: server} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-latest-replica_set + tags: + - latest + - replica_set + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: latest} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-7.0-sharded_cluster + - name: test-latest-sharded_cluster tags: - - '7.0' + - latest - sharded_cluster commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '7.0'} + - {key: VERSION, value: latest} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-6.0-server + - name: test-rapid-server tags: - - '6.0' + - rapid - server commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '6.0'} + - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: server} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-6.0-replica_set + - name: test-rapid-replica_set tags: - - '6.0' + - rapid - replica_set commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '6.0'} + - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-6.0-sharded_cluster + - name: test-rapid-sharded_cluster tags: - - '6.0' + - rapid - sharded_cluster commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '6.0'} + - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-5.0-server + - name: test-8.0-server tags: - - '5.0' + - '8.0' - server commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '5.0'} + - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-5.0-replica_set + - name: test-8.0-replica_set tags: - - '5.0' + - '8.0' - replica_set commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '5.0'} + - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-5.0-sharded_cluster + - name: test-8.0-sharded_cluster tags: - - '5.0' + - '8.0' - sharded_cluster commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '5.0'} + - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.4-server + - name: test-7.0-server tags: - - '4.4' + - '7.0' - server commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.4'} + - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.4-replica_set + - name: test-7.0-replica_set tags: - - '4.4' + - '7.0' - replica_set commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.4'} + - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.4-sharded_cluster + - name: test-7.0-sharded_cluster tags: - - '4.4' + - '7.0' - sharded_cluster commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.4'} + - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.2-server + - name: test-6.0-server tags: - - '4.2' + - '6.0' - server commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.2'} + - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.2-replica_set + - name: test-6.0-replica_set tags: - - '4.2' + - '6.0' - replica_set commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.2'} + - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-4.2-sharded_cluster + - name: test-6.0-sharded_cluster tags: - - '4.2' + - '6.0' - sharded_cluster commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: '4.2'} + - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests - - name: test-latest-server-v1-api + - name: test-5.0-server tags: - - latest + - '5.0' - server - - v1-api commands: - command: expansions.update type: setup params: updates: - - {key: VERSION, value: latest} + - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: server} - - {key: REQUIRE_API_VERSION, value: '1'} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-5.0-replica_set + tags: + - '5.0' + - replica_set + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '5.0'} + - {key: TOPOLOGY, value: replica_set} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-5.0-sharded_cluster + tags: + - '5.0' + - sharded_cluster + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '5.0'} + - {key: TOPOLOGY, value: sharded_cluster} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.4-server + tags: + - '4.4' + - server + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.4'} + - {key: TOPOLOGY, value: server} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.4-replica_set + tags: + - '4.4' + - replica_set + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.4'} + - {key: TOPOLOGY, value: replica_set} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.4-sharded_cluster + tags: + - '4.4' + - sharded_cluster + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.4'} + - {key: TOPOLOGY, value: sharded_cluster} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.2-server + tags: + - '4.2' + - server + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.2'} + - {key: TOPOLOGY, value: server} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.2-replica_set + tags: + - '4.2' + - replica_set + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.2'} + - {key: TOPOLOGY, value: replica_set} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-4.2-sharded_cluster + tags: + - '4.2' + - sharded_cluster + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: '4.2'} + - {key: TOPOLOGY, value: sharded_cluster} + - {key: AUTH, value: auth} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run tests + - name: test-latest-server-v1-api + tags: + - latest + - server + - v1-api + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: VERSION, value: latest} + - {key: TOPOLOGY, value: server} + - {key: REQUIRE_API_VERSION, value: '1'} - {key: MONGODB_API_VERSION, value: '1'} - {key: AUTH, value: auth} - {key: TEST_CSFLE, value: 'true'} @@ -2772,279 +2996,6 @@ tasks: - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests -task_groups: - - name: serverless_task_group - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - setup_group: - - func: fetch source - - command: subprocess.exec - params: - working_dir: src - binary: bash - env: - DRIVERS_TOOLS: ${DRIVERS_TOOLS} - args: - - .evergreen/setup-serverless.sh - teardown_group: - - func: upload test results - - command: subprocess.exec - params: - working_dir: src - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh - tasks: - - .serverless - - name: test_gcpkms_task_group - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh - teardown_group: - - command: subprocess.exec - params: - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh - - func: upload coverage report - tasks: - - test-gcpkms-task - - name: test_azurekms_task_group - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - working_dir: src - binary: bash - env: - AZUREKMS_VMNAME_PREFIX: NODE_DRIVER - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh - teardown_group: - - command: expansions.update - params: - file: testazurekms-expansions.yml - - command: subprocess.exec - params: - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh - - func: upload coverage report - tasks: - - test-azurekms-task - - name: testk8soidc_task_group_eks - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh - teardown_group: - - func: upload coverage report - - command: subprocess.exec - params: - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-k8s-latest-eks - - name: testk8soidc_task_group_gke - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh - teardown_group: - - func: upload coverage report - - command: subprocess.exec - params: - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-k8s-latest-gke - - name: testk8soidc_task_group_aks - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh - teardown_group: - - func: upload coverage report - - command: subprocess.exec - params: - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-k8s-latest-aks - - name: testtestoidc_task_group - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: subprocess.exec - params: - binary: bash - include_expansions_in_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - env: - MONGODB_VERSION: '8.0' - args: - - ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh - teardown_task: - - func: upload coverage report - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-test-latest - - name: testazureoidc_task_group - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: shell.exec - params: - shell: bash - add_expansions_to_env: true - script: |- - set -o errexit - ${PREPARE_SHELL} - export AZUREOIDC_VMNAME_PREFIX="NODE_DRIVER" - $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/setup.sh - teardown_group: - - command: shell.exec - params: - shell: bash - script: |- - ${PREPARE_SHELL} - $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/teardown.sh - - func: upload coverage report - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-azure-latest - - name: testgcpoidc_task_group - setup_group: - - func: fetch source - - func: assume secrets manager role - - command: shell.exec - params: - shell: bash - add_expansions_to_env: true - script: |- - set -o errexit - ${PREPARE_SHELL} - export GCPOIDC_VMNAME_PREFIX="NODE_DRIVER" - $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/setup.sh - teardown_group: - - command: shell.exec - params: - shell: bash - script: |- - ${PREPARE_SHELL} - $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/teardown.sh - - func: upload coverage report - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - oidc-auth-test-gcp-latest - - name: test_atlas_task_group - setup_group: - - func: fetch source - - command: expansions.update - type: setup - params: - updates: - - {key: MONGODB_VERSION, value: '7.0'} - - {key: LAMBDA_STACK_NAME, value: dbx-node-lambda} - - {key: CLUSTER_PREFIX, value: dbx-node-lambda} - - func: assume secrets manager role - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh - - atlas - - command: expansions.update - params: - file: src/atlas-expansion.yml - teardown_group: - - command: subprocess.exec - params: - working_dir: src - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh - - func: upload coverage report - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-aws-lambda-deployed - - name: test_atlas_task_group_search_indexes - setup_group: - - func: fetch source - - command: expansions.update - type: setup - params: - updates: - - {key: MONGODB_VERSION, value: '7.0'} - - {key: CLUSTER_PREFIX, value: dbx-node-lambda} - - func: assume secrets manager role - - command: subprocess.exec - params: - working_dir: src - binary: bash - add_expansions_to_env: true - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh - - command: expansions.update - params: - file: src/atlas-expansion.yml - teardown_group: - - command: subprocess.exec - params: - working_dir: src - binary: bash - args: - - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh - - func: upload coverage report - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 - tasks: - - test-search-index-helpers pre: - func: fetch source - func: windows fix diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 30d6466b490..269e0aa5a1e 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -800,18 +800,6 @@ BUILD_VARIANTS.push({ tasks: customDependencyTests.map(({ name }) => name) }); -// TODO(NODE-6786): Reenable serverless testing. -// BUILD_VARIANTS.push({ -// name: 'rhel8-test-serverless', -// display_name: 'Serverless Test', -// run_on: DEFAULT_OS, -// expansions: { -// NODE_LTS_VERSION: LOWEST_LTS, -// NPM_VERSION: 9 -// }, -// tasks: ['serverless_task_group'] -// }); - BUILD_VARIANTS.push({ name: 'rhel8-test-gcp-kms', display_name: 'GCP KMS Test', diff --git a/.evergreen/run-serverless-tests.sh b/.evergreen/run-serverless-tests.sh deleted file mode 100755 index 1799b34db30..00000000000 --- a/.evergreen/run-serverless-tests.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -source secrets-export.sh -source serverless.env - -# next, set up FLE -export TEST_CSFLE=true -source .evergreen/setup-fle.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 ${SINGLE_MONGOS_LB_URI+omitted} ]; then echo "SINGLE_MONGOS_LB_URI is unset" && exit 1; fi -if [ -z ${MULTI_MONGOS_LB_URI+omitted} ]; then echo "MULTI_MONGOS_LB_URI is unset" && exit 1; fi -if [ -z ${MONGODB_URI+omitted} ]; then echo "MONGODB_URI is unset" && exit 1; fi -if [ -z ${SERVERLESS_ATLAS_USER+omitted} ]; then echo "SERVERLESS_ATLAS_USER is unset" && exit 1; fi -if [ -z ${SERVERLESS_ATLAS_PASSWORD+omitted} ]; then echo "SERVERLESS_ATLAS_PASSWORD is unset" && exit 1; fi - -npx mocha \ - --config test/mocha_mongodb.js \ - test/integration/crud/crud.spec.test.ts \ - test/integration/crud/crud.prose.test.ts \ - test/integration/retryable-reads/retryable_reads.spec.test.ts \ - test/integration/retryable-writes/retryable_writes.spec.test.ts \ - test/integration/sessions/sessions.spec.test.ts \ - test/integration/sessions/sessions.prose.test.ts \ - test/integration/sessions/sessions.test.ts \ - test/integration/transactions/transactions.spec.test.ts \ - test/integration/transactions-convenient-api/transactions-convenient-api.spec.test.ts \ - test/integration/transactions/transactions.test.ts \ - test/integration/versioned-api/versioned_api.spec.test.ts \ - test/integration/load-balancers/load_balancers.spec.test.ts \ - test/integration/client-side-encryption/client_side_encryption.spec.test.ts \ - test/integration/run-command/run_command.spec.test.ts diff --git a/.evergreen/setup-serverless.sh b/.evergreen/setup-serverless.sh deleted file mode 100644 index c5c7d6c57ca..00000000000 --- a/.evergreen/setup-serverless.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -bash ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/serverless -bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh - -cp ${DRIVERS_TOOLS}/.evergreen/serverless/secrets-export.sh . - -# generate a source-able expansion file -cat serverless-expansion.yml | sed 's/: /=/g' > serverless.env - -echo 'export MONGODB_URI="${SERVERLESS_URI}"' >> serverless.env -echo 'export SINGLE_MONGOS_LB_URI="${SERVERLESS_URI}"' >> serverless.env -echo 'export MULTI_MONGOS_LB_URI="${SERVERLESS_URI}"' >> serverless.env -echo 'export SERVERLESS=1' >> serverless.env diff --git a/.gitignore b/.gitignore index 36a3aac2c16..e5ae91dd1d9 100644 --- a/.gitignore +++ b/.gitignore @@ -70,9 +70,6 @@ lib/ .vscode output -serverless-expansion.yml -serverless.env - expansion.yml mo-expansion.yml lb-expansion.yml diff --git a/global.d.ts b/global.d.ts index 09c35deea6e..6976c9647d4 100644 --- a/global.d.ts +++ b/global.d.ts @@ -16,7 +16,6 @@ declare global { * of mongodb-client-encryption. Ex: `clientSideEncryption: '>=6.0.1'` */ clientSideEncryption?: string | true; - serverless?: 'forbid' | 'allow' | 'require'; auth?: 'enabled' | 'disabled'; idmsMockServer?: true; nodejs?: string; diff --git a/test/integration/client-side-encryption/client_side_encryption.spec.test.ts b/test/integration/client-side-encryption/client_side_encryption.spec.test.ts index 2dcfa518bee..87da0f212f9 100644 --- a/test/integration/client-side-encryption/client_side_encryption.spec.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.spec.test.ts @@ -55,8 +55,6 @@ const SKIPPED_TESTS = new Set([ ] ]); -const isServerless = !!process.env.SERVERLESS; - describe('Client Side Encryption (Legacy)', function () { const testContext = new TestRunnerContext({ requiresCSFLE: true }); const testSuites = gatherTestSuites( @@ -84,16 +82,6 @@ describe('Client Side Encryption (Legacy)', function () { return 'TODO(NODE-5686): add CSOT support to FLE'; } - if (isServerless) { - // TODO(NODE-4730): Fix failing csfle tests against serverless - const isSkippedTest = [ - 'BypassQueryAnalysis decrypts', - 'encryptedFieldsMap is preferred over remote encryptedFields' - ].includes(description); - - return isSkippedTest ? 'TODO(NODE-4730): Fix failing csfle tests against serverless' : true; - } - if ( [ 'Insert a document with auto encryption using KMIP delegated KMS provider', @@ -161,7 +149,7 @@ describe('Client Side Encryption (Unified)', function () { if (typeof shouldSkip === 'string') return shouldSkip; } - return isServerless ? 'Unified CSFLE tests to not run on serverless' : false; + return false; } ); }); diff --git a/test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts b/test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts index 10c7cd7df47..30347b1f5c3 100644 --- a/test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts +++ b/test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts @@ -1342,7 +1342,7 @@ describe('CSOT spec prose tests', function () { describe( '11. Multi-batch bulkWrites', - { requires: { mongodb: '>=8.0', serverless: 'forbid', topology: 'single' } }, + { requires: { mongodb: '>=8.0', topology: 'single' } }, function () { /** * ### 11. Multi-batch bulkWrites diff --git a/test/integration/client-side-operations-timeout/unified-csot-node-specs/command-execution.json b/test/integration/client-side-operations-timeout/unified-csot-node-specs/command-execution.json index dd6fcb2cf84..019b238f7f1 100644 --- a/test/integration/client-side-operations-timeout/unified-csot-node-specs/command-execution.json +++ b/test/integration/client-side-operations-timeout/unified-csot-node-specs/command-execution.json @@ -8,8 +8,7 @@ "single", "replicaset", "sharded" - ], - "serverless": "forbid" + ] } ], "createEntities": [ diff --git a/test/integration/crud/abstract_operation.test.ts b/test/integration/crud/abstract_operation.test.ts index 972dc950fa6..a30c185db6b 100644 --- a/test/integration/crud/abstract_operation.test.ts +++ b/test/integration/crud/abstract_operation.test.ts @@ -13,7 +13,7 @@ describe('abstract operation', function () { correctCommandName: string; } - const WrapperandServerlessSubclasses = [ + const WrapperSubclasses = [ 'RunAdminCommandOperation', 'RunCommandOperation', 'OptionsOperation', @@ -313,7 +313,7 @@ describe('abstract operation', function () { expect(subclassInstance.commandName).to.equal(correctCommandName); }); - if (!WrapperandServerlessSubclasses.includes(subclassType.name.toString())) { + if (!WrapperSubclasses.includes(subclassType.name.toString())) { it(`operation.commandName equals key in command document`, async function () { const subclassInstance = subclassCreator(); const yieldDoc = diff --git a/test/integration/crud/client_bulk_write.test.ts b/test/integration/crud/client_bulk_write.test.ts index c2a626fe9d9..a502c88318b 100644 --- a/test/integration/crud/client_bulk_write.test.ts +++ b/test/integration/crud/client_bulk_write.test.ts @@ -21,8 +21,7 @@ import { filterForCommands } from '../shared'; const metadata: MongoDBMetadataUI = { requires: { - mongodb: '>=8.0', - serverless: 'forbid' + mongodb: '>=8.0' } }; diff --git a/test/integration/crud/crud.prose.test.ts b/test/integration/crud/crud.prose.test.ts index ac8550aac53..79cedead66e 100644 --- a/test/integration/crud/crud.prose.test.ts +++ b/test/integration/crud/crud.prose.test.ts @@ -201,7 +201,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('splits the commands into 2 operations', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const result = await client.bulkWrite(models); expect(result.insertedCount).to.equal(maxWriteBatchSize + 1); @@ -273,7 +273,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('splits the commands into 2 operations', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const result = await client.bulkWrite(models); expect(result.insertedCount).to.equal(numModels); @@ -351,7 +351,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('splits the commands into 2 operations and handles the errors', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client.bulkWrite(models).catch(error => error); expect(error).to.be.instanceOf(MongoClientBulkWriteError); @@ -416,7 +416,7 @@ describe('CRUD Prose Spec Tests', () => { // Assert that unorderedError.writeErrors has a length of maxWriteBatchSize + 1. // Assert that two CommandStartedEvents were observed for the bulkWrite command. it('splits the commands into 2 operations and handles the errors', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client.bulkWrite(models, { ordered: false }).catch(error => error); expect(error).to.be.instanceOf(MongoClientBulkWriteError); @@ -434,7 +434,7 @@ describe('CRUD Prose Spec Tests', () => { // Assert that orderedError.writeErrors has a length of 1. // Assert that one CommandStartedEvent was observed for the bulkWrite command. it('splits the commands into 2 operations and halts on first error', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client.bulkWrite(models, { ordered: true }).catch(error => error); expect(error).to.be.instanceOf(MongoClientBulkWriteError); @@ -504,7 +504,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('handles a getMore on the results', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const result = await client.bulkWrite(models, { verboseResults: true }); expect(result.upsertedCount).to.equal(2); @@ -582,7 +582,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('handles a getMore on the results in a transaction', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid', topology: '!single' } }, + metadata: { requires: { mongodb: '>=8.0.0', topology: '!single' } }, async test() { const result = await client.bulkWrite(models, { verboseResults: true, session }); expect(result.upsertedCount).to.equal(2); @@ -677,7 +677,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('handles a getMore that errors', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client .bulkWrite(models, { verboseResults: true }) @@ -733,7 +733,7 @@ describe('CRUD Prose Spec Tests', () => { // Call MongoClient.bulkWrite with models and BulkWriteOptions.writeConcern set to an unacknowledged write concern. // Expect a client-side error due the size. it('throws an error', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client .bulkWrite([{ name: 'insertOne', namespace: 'db.coll', document: document }], { @@ -758,7 +758,7 @@ describe('CRUD Prose Spec Tests', () => { // Call MongoClient.bulkWrite with models and BulkWriteOptions.writeConcern set to an unacknowledged write concern. // Expect a client-side error due the size. it('throws an error', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const error = await client .bulkWrite( @@ -856,7 +856,7 @@ describe('CRUD Prose Spec Tests', () => { // Assert that the length of event.command.ops is numModels + 1. Assert that the length of event.command.nsInfo is 1. // Assert that the namespace contained in event.command.nsInfo is "db.coll". it('executes in a single batch', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const sameNamespaceModel: ClientBulkWriteModel = { name: 'insertOne', @@ -892,7 +892,7 @@ describe('CRUD Prose Spec Tests', () => { // Assert that the length of secondEvent.command.ops is equal to 1. Assert that the length of secondEvent.command.nsInfo // is equal to 1. Assert that the namespace contained in secondEvent.command.nsInfo is namespace. it('executes in multiple batches', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const namespace = `db.${'c'.repeat(200)}`; const newNamespaceModel: ClientBulkWriteModel = { @@ -947,7 +947,7 @@ describe('CRUD Prose Spec Tests', () => { // Execute bulkWrite on client with largeDocumentModel. Assert that an error (referred to as error) is returned. // Assert that error is a client error. it('raises a client error', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const model: ClientBulkWriteModel = { name: 'insertOne', @@ -972,7 +972,7 @@ describe('CRUD Prose Spec Tests', () => { // Execute bulkWrite on client with largeNamespaceModel. Assert that an error (referred to as error) is returned. // Assert that error is a client error. it('raises a client error', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const namespace = `db.${'c'.repeat(maxMessageSizeBytes)}`; const model: ClientBulkWriteModel = { @@ -1151,7 +1151,7 @@ describe('CRUD Prose Spec Tests', () => { }); it('performs all writes unacknowledged', { - metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } }, + metadata: { requires: { mongodb: '>=8.0.0' } }, async test() { const result = await client.bulkWrite(models, { ordered: false, writeConcern: { w: 0 } }); expect(result.acknowledged).to.be.false; diff --git a/test/integration/index-management/search-index-management.test.ts b/test/integration/index-management/search-index-management.test.ts index 1c191f79517..39d17f22818 100644 --- a/test/integration/index-management/search-index-management.test.ts +++ b/test/integration/index-management/search-index-management.test.ts @@ -25,8 +25,7 @@ describe('Search Index Management Integration Tests', function () { metadata: { requires: { topology: '!single', - mongodb: '>=7.0', - serverless: 'forbid' + mongodb: '>=7.0' } }, test: async function () { @@ -47,8 +46,7 @@ describe('Search Index Management Integration Tests', function () { metadata: { requires: { topology: ['replicaset', 'sharded'], - mongodb: '>=7.0', - serverless: 'forbid' + mongodb: '>=7.0' } }, test: async function () { diff --git a/test/integration/transactions/transactions.test.ts b/test/integration/transactions/transactions.test.ts index 762bfb8fb97..e0ccf4b2567 100644 --- a/test/integration/transactions/transactions.test.ts +++ b/test/integration/transactions/transactions.test.ts @@ -31,8 +31,7 @@ describe('Transactions', function () { 'should provide a useful error if a Promise is not returned', { requires: { - topology: ['replicaset', 'sharded'], - serverless: 'forbid' + topology: ['replicaset', 'sharded'] } }, async function () { @@ -54,7 +53,7 @@ describe('Transactions', function () { it('should return readable error if promise rejected with no reason', { metadata: { - requires: { topology: ['replicaset', 'sharded'], serverless: 'forbid' } + requires: { topology: ['replicaset', 'sharded'] } }, test: function (done) { function fnThatReturnsBadPromise() { diff --git a/test/manual/atlas_connectivity.test.ts b/test/manual/atlas_connectivity.test.ts index a49ed0bafc6..61b7c0d0b99 100644 --- a/test/manual/atlas_connectivity.test.ts +++ b/test/manual/atlas_connectivity.test.ts @@ -22,8 +22,6 @@ describe('Atlas Connectivity', function () { }); const environments = [ - 'ATLAS_SERVERLESS', - 'ATLAS_SRV_SERVERLESS', 'ATLAS_FREE', 'ATLAS_SRV_FREE', 'ATLAS_REPL', diff --git a/test/readme.md b/test/readme.md index 83134bb451e..3e4c5103973 100644 --- a/test/readme.md +++ b/test/readme.md @@ -28,7 +28,6 @@ about the types of tests and how to run them. - [Configuration](#configuration) - [Secrets](#secrets) - [Testing with Special Environments](#testing-with-special-environments) - - [Serverless](#serverless) - [Load Balanced](#load-balanced) - [Client-Side Field-Level Encryption (CSFLE)](#client-side-field-level-encryption-csfle) - [Deployed KMS Tests](#deployed-kms-tests) @@ -380,32 +379,6 @@ We recommend creating an environment variable named `DRIVERS_TOOLS` that stores export DRIVERS_TOOLS="./drivers-evergreen-tools" ``` -### Serverless - -The following steps will walk you through how to create and test a MongoDB Serverless instance. - -> [!IMPORTANT] -> If you set up an Atlas cluster for local use, you MUST delete it when you are finished with it using the [delete-instance script](https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/serverless/delete-instance.sh). - -This script uses aws secrets manager to fetch credentials. Make sure you are logged into AWS and have your profile set correctly. - -1. Run the setup-serverless script: - -```bash -bash .evergreen/setup-serverless.sh -``` - -2. Source the expansions and secrets: - -```bash -source secrets-export.sh -source serverless.env -``` - -3. Comment out the line in `.evergreen/run-serverless-tests.sh` that sources `install-dependencies.sh` (this downloads node and npm and is only used in CI). - -4. Run the `.evergreen/run-serverless-tests.sh` script directly to test serverless instances from your local machine. - ### Load Balanced The following steps will walk you through how to start and test a load balancer. @@ -704,7 +677,6 @@ needs to be tested. [driver-specs]: https://github.com/mongodb/specifications [node-quick-start]: https://github.com/mongodb-developer/nodejs-quickstart [js-bson]: https://github.com/mongodb/js-bson -[create-instance-script]: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/serverless/create-instance.sh [npm-csfle]: https://www.npmjs.com/package/mongodb-client-encryption [atlas-api-key]: https://docs.atlas.mongodb.com/tutorial/configure-api-access/organization/create-one-api-key [scram-auth]: https://docs.atlas.mongodb.com/security-add-mongodb-users/#database-user-authentication diff --git a/test/tools/runner/config.ts b/test/tools/runner/config.ts index 477e758f620..14a28a52144 100644 --- a/test/tools/runner/config.ts +++ b/test/tools/runner/config.ts @@ -75,7 +75,6 @@ export class TestConfiguration { parameters: Record; singleMongosLoadBalancerUri: string; multiMongosLoadBalancerUri: string; - isServerless: boolean; topologyType: TopologyType; buildInfo: Record; options: { @@ -108,7 +107,6 @@ export class TestConfiguration { this.parameters = { ...context.parameters }; this.singleMongosLoadBalancerUri = context.singleMongosLoadBalancerUri; this.multiMongosLoadBalancerUri = context.multiMongosLoadBalancerUri; - this.isServerless = !!process.env.SERVERLESS; this.topologyType = this.isLoadBalanced ? TopologyType.LoadBalanced : context.topologyType; this.buildInfo = context.buildInfo; this.serverApi = context.serverApi; @@ -118,10 +116,7 @@ export class TestConfiguration { hostAddresses, hostAddress: hostAddresses[0], host: hostAddresses[0].host, - port: - typeof hostAddresses[0].host === 'string' && !this.isServerless - ? hostAddresses[0].port - : undefined, + port: typeof hostAddresses[0].host === 'string' && hostAddresses[0].port, db: url.pathname.slice(1) ? url.pathname.slice(1) : 'integration_tests', replicaSet: url.searchParams.get('replicaSet'), proxyURIParams: url.searchParams.get('proxyHost') @@ -143,17 +138,10 @@ export class TestConfiguration { this.filters = Object.fromEntries( context.filters.map(filter => [filter.constructor.name, filter]) ); - - if (context.serverlessCredentials) { - const { username, password } = context.serverlessCredentials; - this.options.auth = { username, password, authSource: 'admin' }; - } } get isLoadBalanced() { - return ( - !!this.singleMongosLoadBalancerUri && !!this.multiMongosLoadBalancerUri && !this.isServerless - ); + return !!this.singleMongosLoadBalancerUri && !!this.multiMongosLoadBalancerUri; } writeConcern() { @@ -268,15 +256,15 @@ export class TestConfiguration { delete queryOptions.writeConcern; } - if (this.topologyType === TopologyType.LoadBalanced && !this.isServerless) { + if (this.topologyType === TopologyType.LoadBalanced) { queryOptions.loadBalanced = true; } const urlOptions: url.UrlObject = { - protocol: this.isServerless ? 'mongodb+srv' : 'mongodb', + protocol: 'mongodb', slashes: true, hostname: dbHost, - port: this.isServerless ? null : dbPort, + port: dbPort, query: queryOptions, pathname: '/' }; @@ -337,7 +325,7 @@ export class TestConfiguration { const FILLER_HOST = 'fillerHost'; - const protocol = this.isServerless ? 'mongodb+srv' : 'mongodb'; + const protocol = 'mongodb'; const url = new URL(`${protocol}://${FILLER_HOST}`); if (options.replicaSet) { @@ -365,7 +353,7 @@ export class TestConfiguration { url.password = password; } - if (this.isLoadBalanced && !this.isServerless) { + if (this.isLoadBalanced) { url.searchParams.append('loadBalanced', 'true'); } @@ -384,14 +372,10 @@ export class TestConfiguration { if (options.authSource) { url.searchParams.append('authSource', options.authSource); } - } else if (this.isServerless) { - url.searchParams.append('ssl', 'true'); - url.searchParams.append('authSource', 'admin'); } let actualHostsString; - // Ignore multi mongos options in serverless testing. - if (options.useMultipleMongoses && !this.isServerless) { + if (options.useMultipleMongoses) { if (this.isLoadBalanced) { const multiUri = new ConnectionString(this.multiMongosLoadBalancerUri); if (multiUri.isSRV) { @@ -403,7 +387,7 @@ export class TestConfiguration { actualHostsString = this.options.hostAddresses.map(ha => ha.toString()).join(','); } } else { - if (this.isLoadBalanced || this.isServerless) { + if (this.isLoadBalanced) { const singleUri = new ConnectionString(this.singleMongosLoadBalancerUri); actualHostsString = singleUri.hosts[0].toString(); } else { diff --git a/test/tools/runner/filters/serverless_filter.ts b/test/tools/runner/filters/serverless_filter.ts deleted file mode 100755 index 20347c0327a..00000000000 --- a/test/tools/runner/filters/serverless_filter.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { type MongoClient } from '../../../mongodb'; -import { shouldRunServerlessTest } from '../../utils'; -import { Filter } from './filter'; - -/** - * Filter to allow to tests to run on serverless - * - * @example - * ```js - * metadata: { - * requires: { - * serverless: 'forbid' - * } - * } - * ``` - */ -export class ServerlessFilter extends Filter { - serverless: boolean; - constructor() { - super(); - // Get environmental variables that are known - this.serverless = !!process.env.SERVERLESS; - } - - override async initializeFilter(client: MongoClient, context: Record) { - if (this.serverless) { - context.serverlessCredentials = { - username: process.env.SERVERLESS_ATLAS_USER, - password: process.env.SERVERLESS_ATLAS_PASSWORD - }; - } - } - - filter(test: { metadata?: MongoDBMetadataUI }) { - if (!test.metadata) return true; - if (!test.metadata.requires) return true; - return shouldRunServerlessTest(test.metadata.requires.serverless, this.serverless); - } -} diff --git a/test/tools/runner/hooks/configuration.ts b/test/tools/runner/hooks/configuration.ts index a5aa8c7f5dc..36e2684904d 100644 --- a/test/tools/runner/hooks/configuration.ts +++ b/test/tools/runner/hooks/configuration.ts @@ -20,7 +20,6 @@ import { MongoDBTopologyFilter } from '../filters/mongodb_topology_filter'; import { MongoDBVersionFilter } from '../filters/mongodb_version_filter'; import { NodeVersionFilter } from '../filters/node_version_filter'; import { OSFilter } from '../filters/os_filter'; -import { ServerlessFilter } from '../filters/serverless_filter'; import { type Filter } from '../filters/filter'; import { type Context } from 'mocha'; import { flakyTests } from '../flaky'; @@ -63,8 +62,7 @@ async function initializeFilters(client): Promise> { new MongoDBTopologyFilter(), new MongoDBVersionFilter(), new NodeVersionFilter(), - new OSFilter(), - new ServerlessFilter() + new OSFilter() ] }; @@ -176,7 +174,6 @@ const testConfigBeforeHook = async function () { alpineLinux: Boolean(process.env.ALPINE), cryptdUri: process.env.MONGOCRYPTD_URI, pid: process.pid, - serverless: process.env.SERVERLESS === '1', auth: process.env.AUTH === 'auth', tls: process.env.SSL === 'ssl', csfle: { diff --git a/test/tools/spec-runner/context.js b/test/tools/spec-runner/context.js index 7a678194b55..2c82fefa552 100644 --- a/test/tools/spec-runner/context.js +++ b/test/tools/spec-runner/context.js @@ -47,12 +47,6 @@ class TestRunnerContext { this.user = opts.user; this.password = opts.password; this.authSource = opts.authSource; - if (process.env.SERVERLESS) { - this.user = process.env.SERVERLESS_ATLAS_USER; - this.password = process.env.SERVERLESS_ATLAS_PASSWORD; - this.authSource = 'admin'; - this.serverless = true; - } this.sharedClient = null; this.failPointClients = []; this.appliedFailPoints = []; diff --git a/test/tools/spec-runner/index.js b/test/tools/spec-runner/index.js index 62ee50ff71e..4807c2620be 100644 --- a/test/tools/spec-runner/index.js +++ b/test/tools/spec-runner/index.js @@ -255,23 +255,20 @@ function prepareDatabaseForSuite(suite, context) { if (context.skipPrepareDatabase) return Promise.resolve(); - // Note: killAllSession is not supported on serverless, see CLOUDP-84298 - const setupPromise = context.serverless - ? Promise.resolve() - : db - .admin() - .command({ killAllSessions: [] }) - .catch(err => { - if ( - err.message.match(/no such (cmd|command)/) || - err.message.match(/Failed to kill on some hosts/) || - err.code === 11601 - ) { - return; - } + const setupPromise = db + .admin() + .command({ killAllSessions: [] }) + .catch(err => { + if ( + err.message.match(/no such (cmd|command)/) || + err.message.match(/Failed to kill on some hosts/) || + err.code === 11601 + ) { + return; + } - throw err; - }); + throw err; + }); if (context.collectionName == null || context.dbName === 'admin') { return setupPromise; diff --git a/test/tools/unified-spec-runner/entities.ts b/test/tools/unified-spec-runner/entities.ts index b228c0669a0..bc43bac25b7 100644 --- a/test/tools/unified-spec-runner/entities.ts +++ b/test/tools/unified-spec-runner/entities.ts @@ -406,7 +406,7 @@ export class FailPointMap extends Map { const entries = Array.from(this.entries()); await Promise.all( entries.map(async ([hostAddress, configureFailPoint]) => { - if (process.env.SERVERLESS || process.env.LOAD_BALANCER) { + if (process.env.LOAD_BALANCER) { hostAddress += '?loadBalanced=true'; } const client = getClient(hostAddress); diff --git a/test/tools/unified-spec-runner/runner.ts b/test/tools/unified-spec-runner/runner.ts index 84bea56766a..20962618ac3 100644 --- a/test/tools/unified-spec-runner/runner.ts +++ b/test/tools/unified-spec-runner/runner.ts @@ -31,9 +31,8 @@ async function isAtlasDataLake(client: MongoClient): Promise { } async function terminateOpenTransactions(client: MongoClient) { - // Note: killAllSession is not supported on serverless, see CLOUDP-84298 - // killAllSession is not allowed in ADL either. - if (process.env.SERVERLESS || (await isAtlasDataLake(client))) { + // killAllSessions is not allowed in ADL. + if (await isAtlasDataLake(client)) { return; } // TODO(NODE-3491): on sharded clusters this has to be run on each mongos diff --git a/test/tools/unified-spec-runner/schema.ts b/test/tools/unified-spec-runner/schema.ts index 6f9bba3d8ea..c8f433aba17 100644 --- a/test/tools/unified-spec-runner/schema.ts +++ b/test/tools/unified-spec-runner/schema.ts @@ -106,7 +106,6 @@ export const TopologyName = Object.freeze({ export type TopologyName = (typeof TopologyName)[keyof typeof TopologyName]; export interface RunOnRequirement { - serverless?: 'forbid' | 'allow' | 'require'; auth?: boolean; authMechanism?: string; maxServerVersion?: string; diff --git a/test/tools/unified-spec-runner/unified-utils.ts b/test/tools/unified-spec-runner/unified-utils.ts index 156e230241e..f966f10d378 100644 --- a/test/tools/unified-spec-runner/unified-utils.ts +++ b/test/tools/unified-spec-runner/unified-utils.ts @@ -15,7 +15,6 @@ import { type MongoClient, ReturnDocument } from '../../mongodb'; -import { shouldRunServerlessTest } from '../../tools/utils'; import type { CmapEvent, CommandEvent, EntitiesMap, SdamEvent } from './entities'; import { matchesEvents } from './match'; import { MalformedOperationError } from './operations'; @@ -116,11 +115,6 @@ export async function topologySatisfies( } } - if (r.serverless) { - ok &&= shouldRunServerlessTest(r.serverless, config.isServerless); - if (!ok && skipReason == null) skipReason = `has serverless set to ${r.serverless}`; - } - if (typeof r.csfle === 'boolean') { const versionSupportsCSFLE = semverGte(config.version, '4.2.0'); const csfleEnabled = config.clientSideEncryption.enabled; diff --git a/test/tools/utils.ts b/test/tools/utils.ts index b0ac3703f1e..2525c92d830 100644 --- a/test/tools/utils.ts +++ b/test/tools/utils.ts @@ -126,36 +126,9 @@ export function getEnvironmentalOptions() { serverApi: { version: process.env.MONGODB_API_VERSION } }); } - if (process.env.SERVERLESS) { - Object.assign(options, { - auth: { - username: process.env.SERVERLESS_ATLAS_USER, - password: process.env.SERVERLESS_ATLAS_PASSWORD - }, - tls: true, - compressors: 'snappy,zlib' - }); - } return options; } -export function shouldRunServerlessTest(testRequirement: any, isServerless: any) { - if (!testRequirement) return true; - switch (testRequirement) { - case 'forbid': - // return true if the configuration is NOT serverless - return !isServerless; - case 'allow': - // always return true - return true; - case 'require': - // only return true if the configuration is serverless - return isServerless; - default: - throw new Error(`Invalid serverless filter: ${testRequirement}`); - } -} - /** * Use as a template string tag to stringify objects in the template string * Attempts to use EJSON (to make type information obvious)