Skip to content

PYTHON-4965 - Consolidate startup and teardown tasks #2017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .evergreen/combine-coverage.sh
100644 → 100755
Empty file.
99 changes: 32 additions & 67 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -665,33 +649,27 @@ 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
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: "fetch source"
- func: "prepare resources"
- func: "setup system"
- command: subprocess.exec
params:
binary: bash
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1640,6 +1604,7 @@ tasks:
params:
binary: bash
working_dir: src
include_expansions_in_env: ["PYTHON_BINARY"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bug you caught during the fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to pass this explicitly where needed now to use the correct Python binary. Part of our later work will be to unify the use of PYTHON_BINARY to remove the need to pass it explicitly.

args:
- .evergreen/scripts/check-import-time.sh
- ${revision}
Expand Down
Empty file modified .evergreen/hatch.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/install-dependencies.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/run-azurekms-fail-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/run-azurekms-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/run-deployed-lambda-aws-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/run-gcpkms-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/run-perf-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/archive-mongodb-logs.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/bootstrap-mongo-orchestration.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/check-import-time.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/cleanup.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/configure-env.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/download-and-merge-coverage.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/fix-absolute-paths.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/init-test-results.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/install-dependencies.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/make-files-executable.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/prepare-resources.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-atlas-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-aws-ecs-auth-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-doctests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-enterprise-auth-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-gcpkms-fail-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-getdata.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-load-balancer.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-mockupdb-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-mod-wsgi-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-ocsp-test.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-perf-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/run-with-env.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/setup-encryption.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/setup-tests.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/stop-load-balancer.sh
100644 → 100755
Empty file.
7 changes: 0 additions & 7 deletions .evergreen/scripts/teardown-aws.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .evergreen/scripts/teardown-docker.sh

This file was deleted.

Empty file modified .evergreen/scripts/upload-coverage-report.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/scripts/windows-fix.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/setup-encryption.sh
100644 → 100755
Empty file.
Empty file modified .evergreen/teardown-encryption.sh
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Empty file modified tools/synchro.sh
100644 → 100755
Empty file.
Loading