diff --git a/.evergreen/combine-coverage.sh b/.evergreen/combine-coverage.sh old mode 100644 new mode 100755 diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 7ca3a72b1a..ac89270d84 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -37,6 +37,8 @@ functions: # Applies the subitted patch, if any # Deprecated. Should be removed. But still needed for certain agents (ZAP) - command: git.apply_patch + + "setup system": # Make an evergreen expansion file with dynamic values - command: subprocess.exec params: @@ -49,13 +51,19 @@ functions: - command: expansions.update params: file: src/expansion.yml - - "prepare resources": - command: subprocess.exec params: + include_expansions_in_env: ["PROJECT_DIRECTORY", "DRIVERS_TOOLS"] binary: bash args: - src/.evergreen/scripts/prepare-resources.sh + # Run drivers-evergreen-tools system setup + - command: subprocess.exec + params: + include_expansions_in_env: ["PROJECT_DIRECTORY", "DRIVERS_TOOLS"] + binary: bash + args: + - ${DRIVERS_TOOLS}/.evergreen/setup.sh "upload coverage" : - command: ec2.assume_role @@ -511,41 +519,32 @@ functions: - .evergreen/scripts/run-with-env.sh - .evergreen/scripts/cleanup.sh - "teardown": + "teardown system": - command: subprocess.exec params: binary: bash working_dir: "src" args: - - ${DRIVERS_TOOLS}/.evergreen/teardown.sh - - "fix absolute paths": + # Ensure the instance profile is reassigned for aws tests. + - ${DRIVERS_TOOLS}/.evergreen/auth_aws/teardown.sh - command: subprocess.exec params: binary: bash + working_dir: "src" args: - - src/.evergreen/scripts/fix-absolute-paths.sh - - "windows fix": + - ${DRIVERS_TOOLS}/.evergreen/csfle/teardown.sh - command: subprocess.exec params: binary: bash + working_dir: "src" args: - - src/.evergreen/scripts/windows-fix.sh - - "make files executable": - - command: subprocess.exec - params: - binary: bash - args: - - src/.evergreen/scripts/make-files-executable.sh - - "init test-results": + - ${DRIVERS_TOOLS}/.evergreen/ocsp/teardown.sh - command: subprocess.exec params: binary: bash + working_dir: "src" args: - - src/.evergreen/scripts/init-test-results.sh + - ${DRIVERS_TOOLS}/.evergreen/teardown.sh "install dependencies": - command: subprocess.exec @@ -621,21 +620,6 @@ functions: args: - src/.evergreen/scripts/stop-load-balancer.sh - "teardown_docker": - - command: subprocess.exec - params: - binary: bash - args: - - src/.evergreen/scripts/teardown-docker.sh - - "teardown_aws": - - command: subprocess.exec - params: - binary: bash - args: - - src/.evergreen/scripts/run-with-env.sh - - src/.evergreen/scripts/teardown-aws.sh - "teardown atlas": - command: subprocess.exec params: @@ -665,25 +649,19 @@ functions: pre: - func: "fetch source" - - func: "prepare resources" - - func: "windows fix" - - func: "fix absolute paths" - - func: "init test-results" - - func: "make files executable" + - func: "setup system" - func: "install dependencies" - func: "assume ec2 role" post: # Disabled, causing timeouts # - func: "upload working dir" - - func: "teardown" + - func: "teardown system" - func: "upload coverage" - func: "upload mo artifacts" - func: "upload test results" - func: "stop mongo-orchestration" - - func: "teardown_aws" - func: "cleanup" - - func: "teardown_docker" task_groups: - name: serverless_task_group @@ -691,7 +669,7 @@ task_groups: setup_group_timeout_secs: 1800 # 30 minutes setup_group: - func: "fetch source" - - func: "prepare resources" + - func: "setup system" - command: subprocess.exec params: binary: bash @@ -714,9 +692,7 @@ task_groups: setup_group_timeout_secs: 1800 # 30 minutes setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - command: subprocess.exec params: binary: bash @@ -735,9 +711,7 @@ task_groups: - name: testazurekms_task_group setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - command: subprocess.exec params: binary: bash @@ -761,9 +735,7 @@ task_groups: - name: testazureoidc_task_group setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - command: subprocess.exec params: binary: bash @@ -785,9 +757,7 @@ task_groups: - name: testgcpoidc_task_group setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - command: subprocess.exec params: binary: bash @@ -809,9 +779,7 @@ task_groups: - name: testk8soidc_task_group setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - command: ec2.assume_role params: role_arn: ${aws_test_secrets_role} @@ -835,9 +803,7 @@ task_groups: - name: testoidc_task_group setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - func: "assume ec2 role" - command: subprocess.exec params: @@ -859,7 +825,7 @@ task_groups: - name: test_aws_lambda_task_group setup_group: - func: fetch source - - func: prepare resources + - func: setup system - func: setup atlas teardown_task: - func: teardown atlas @@ -871,9 +837,7 @@ task_groups: - name: test_atlas_task_group_search_indexes setup_group: - func: fetch source - - func: prepare resources - - func: fix absolute paths - - func: make files executable + - func: setup system - func: setup atlas teardown_task: - func: teardown atlas @@ -1584,7 +1548,7 @@ tasks: - name: testazurekms-fail-task commands: - func: fetch source - - func: make files executable + - func: setup system - func: "bootstrap mongo-orchestration" vars: VERSION: "latest" @@ -1640,6 +1604,7 @@ tasks: params: binary: bash working_dir: src + include_expansions_in_env: ["PYTHON_BINARY"] args: - .evergreen/scripts/check-import-time.sh - ${revision} diff --git a/.evergreen/hatch.sh b/.evergreen/hatch.sh old mode 100644 new mode 100755 diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh old mode 100644 new mode 100755 diff --git a/.evergreen/run-azurekms-fail-test.sh b/.evergreen/run-azurekms-fail-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/run-azurekms-test.sh b/.evergreen/run-azurekms-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/run-deployed-lambda-aws-tests.sh b/.evergreen/run-deployed-lambda-aws-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/run-gcpkms-test.sh b/.evergreen/run-gcpkms-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/run-perf-tests.sh b/.evergreen/run-perf-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/archive-mongodb-logs.sh b/.evergreen/scripts/archive-mongodb-logs.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/bootstrap-mongo-orchestration.sh b/.evergreen/scripts/bootstrap-mongo-orchestration.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/check-import-time.sh b/.evergreen/scripts/check-import-time.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/cleanup.sh b/.evergreen/scripts/cleanup.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/configure-env.sh b/.evergreen/scripts/configure-env.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/download-and-merge-coverage.sh b/.evergreen/scripts/download-and-merge-coverage.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/fix-absolute-paths.sh b/.evergreen/scripts/fix-absolute-paths.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/init-test-results.sh b/.evergreen/scripts/init-test-results.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/install-dependencies.sh b/.evergreen/scripts/install-dependencies.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/make-files-executable.sh b/.evergreen/scripts/make-files-executable.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/prepare-resources.sh b/.evergreen/scripts/prepare-resources.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-atlas-tests.sh b/.evergreen/scripts/run-atlas-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-aws-ecs-auth-test.sh b/.evergreen/scripts/run-aws-ecs-auth-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-doctests.sh b/.evergreen/scripts/run-doctests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-enterprise-auth-tests.sh b/.evergreen/scripts/run-enterprise-auth-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-gcpkms-fail-test.sh b/.evergreen/scripts/run-gcpkms-fail-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-getdata.sh b/.evergreen/scripts/run-getdata.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-load-balancer.sh b/.evergreen/scripts/run-load-balancer.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-mockupdb-tests.sh b/.evergreen/scripts/run-mockupdb-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-mod-wsgi-tests.sh b/.evergreen/scripts/run-mod-wsgi-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-ocsp-test.sh b/.evergreen/scripts/run-ocsp-test.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-perf-tests.sh b/.evergreen/scripts/run-perf-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-tests.sh b/.evergreen/scripts/run-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/run-with-env.sh b/.evergreen/scripts/run-with-env.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/setup-encryption.sh b/.evergreen/scripts/setup-encryption.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/setup-tests.sh b/.evergreen/scripts/setup-tests.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/stop-load-balancer.sh b/.evergreen/scripts/stop-load-balancer.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/teardown-aws.sh b/.evergreen/scripts/teardown-aws.sh deleted file mode 100644 index 634d1e5724..0000000000 --- a/.evergreen/scripts/teardown-aws.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cd "${DRIVERS_TOOLS}/.evergreen/auth_aws" || exit -if [ -f "./aws_e2e_setup.json" ]; then - . ./activate-authawsvenv.sh - python ./lib/aws_assign_instance_profile.py -fi diff --git a/.evergreen/scripts/teardown-docker.sh b/.evergreen/scripts/teardown-docker.sh deleted file mode 100644 index 733779d058..0000000000 --- a/.evergreen/scripts/teardown-docker.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Remove all Docker images -DOCKER=$(command -v docker) || true -if [ -n "$DOCKER" ]; then - docker rmi -f "$(docker images -a -q)" &> /dev/null || true -fi diff --git a/.evergreen/scripts/upload-coverage-report.sh b/.evergreen/scripts/upload-coverage-report.sh old mode 100644 new mode 100755 diff --git a/.evergreen/scripts/windows-fix.sh b/.evergreen/scripts/windows-fix.sh old mode 100644 new mode 100755 diff --git a/.evergreen/setup-encryption.sh b/.evergreen/setup-encryption.sh old mode 100644 new mode 100755 diff --git a/.evergreen/teardown-encryption.sh b/.evergreen/teardown-encryption.sh old mode 100644 new mode 100755 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e2b497e59..4f6759bc5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -102,3 +102,15 @@ repos: # - test/versioned-api/crud-api-version-1-strict.json:514: nin ==> inn, min, bin, nine # - test/test_client.py:188: te ==> the, be, we, to args: ["-L", "fle,fo,infinit,isnt,nin,te,aks"] + +- repo: local + hooks: + - id: executable-shell + name: executable-shell + entry: chmod +x + language: system + types: [shell] + exclude: | + (?x)( + .evergreen/retry-with-backoff.sh + ) diff --git a/pymongo/asynchronous/cursor.py b/pymongo/asynchronous/cursor.py index 7d7ae4a5db..8193e53282 100644 --- a/pymongo/asynchronous/cursor.py +++ b/pymongo/asynchronous/cursor.py @@ -1299,7 +1299,7 @@ async def to_list(self, length: Optional[int] = None) -> list[_DocumentType]: >>> await cursor.to_list() - Or, so read at most n items from the cursor:: + Or, to read at most n items from the cursor:: >>> await cursor.to_list(n) diff --git a/pymongo/synchronous/cursor.py b/pymongo/synchronous/cursor.py index 9a7637704f..b35098a327 100644 --- a/pymongo/synchronous/cursor.py +++ b/pymongo/synchronous/cursor.py @@ -1297,7 +1297,7 @@ def to_list(self, length: Optional[int] = None) -> list[_DocumentType]: >>> cursor.to_list() - Or, so read at most n items from the cursor:: + Or, to read at most n items from the cursor:: >>> cursor.to_list(n) diff --git a/tools/synchro.sh b/tools/synchro.sh old mode 100644 new mode 100755