Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
14d26bc
[1/x] Migrate all pre and most post scripts to subprocess in /scripts
Jibola Sep 6, 2024
56fafb8
command-type fix
Jibola Sep 6, 2024
71de21f
Merge branch 'master' into PYTHON-4069-1
Jibola Sep 6, 2024
f957a69
remove .evergreen/scripts/run-tests from this PR
Jibola Sep 6, 2024
94db687
Merge branch 'master' into PYTHON-4069-1
NoahStapp Nov 6, 2024
051e733
download_and_merge_coverage
NoahStapp Nov 6, 2024
ea5dff8
mockupdb, doctests, atlas
NoahStapp Nov 6, 2024
b10bd37
modwsgi, enterprise auth
NoahStapp Nov 6, 2024
a9b1c07
Fix modwsgi, aws auth
NoahStapp Nov 6, 2024
c017581
Fix aws auth, ocsp
NoahStapp Nov 6, 2024
6ce1f86
Standardize binary to bash
NoahStapp Nov 7, 2024
ec3c2c4
All but run_tests
NoahStapp Nov 7, 2024
312266f
Run tests
NoahStapp Nov 7, 2024
1b1abc8
Cleanup
NoahStapp Nov 7, 2024
b395f01
Debugging
NoahStapp Nov 7, 2024
7bda294
Fixes
NoahStapp Nov 8, 2024
3ef0084
Add run-with-env.sh
NoahStapp Nov 8, 2024
8176e6c
Fix client context OS var checks
NoahStapp Nov 8, 2024
c3bcada
Fix data lake tests
NoahStapp Nov 8, 2024
a49e630
Fix data lake tests
NoahStapp Nov 8, 2024
4a9ddf9
Add expansions to env
NoahStapp Nov 8, 2024
fbc5a0b
debugging
NoahStapp Nov 8, 2024
fe40a95
More env fixes
NoahStapp Nov 11, 2024
40a9984
Add setup-tests.sh
NoahStapp Nov 11, 2024
01704ba
Cleanup
NoahStapp Nov 12, 2024
57acb85
Cleanup
NoahStapp Nov 12, 2024
13c6e83
Merge branch 'master' into PYTHON-4721
NoahStapp Nov 12, 2024
707452b
Remove LOAD_BALANCER from system setup env
NoahStapp Nov 12, 2024
7617ac6
Fix unbound variables
NoahStapp Nov 12, 2024
3ff9a41
Add AUTH + SSL to bootstrap orchestration
NoahStapp Nov 12, 2024
2a3cc4c
Remove AUTH and SSL from system env
NoahStapp Nov 12, 2024
4a83e54
Fixes
NoahStapp Nov 13, 2024
9d2212f
Don't pass PYTHON_BINARY to CSFLE setup
NoahStapp Nov 13, 2024
9949ac9
Silent coverage
NoahStapp Nov 13, 2024
fb15895
Pass TEST_SUITES to run-tests
NoahStapp Nov 13, 2024
6f74878
Fix archive-logs
NoahStapp Nov 13, 2024
ae446f6
Remove unneeded s3 put
NoahStapp Nov 13, 2024
5f0b429
Add drivers-evergreen-tools teardown
NoahStapp Nov 13, 2024
3a3b542
More upload fixes
NoahStapp Nov 13, 2024
d7f79ca
More fixes
NoahStapp Nov 13, 2024
b8cd932
Remove TEST_SUITES from system-setup env, fix bucket
NoahStapp Nov 14, 2024
717c7c0
Add default TEST_SUITES to run-tests.sh
NoahStapp Nov 14, 2024
f7ad42d
Fix upload-coverage-report
NoahStapp Nov 14, 2024
68c9d29
run-with-env.sh should use -u not -eu
NoahStapp Nov 14, 2024
637a6cc
Add type:test back to run tests
NoahStapp Nov 14, 2024
ed73e72
Fix AUTH + SSL
NoahStapp Nov 19, 2024
18d82e0
Merge branch 'master' into PYTHON-4721
NoahStapp Nov 19, 2024
b4695c1
Fix bootstrap AUTH + SSL
NoahStapp Nov 19, 2024
7654361
Only pass PYTHON_BINARY where it was before
NoahStapp Nov 19, 2024
ebab2b6
Merge branch 'master' into PYTHON-4721
NoahStapp Nov 19, 2024
82dcf30
Cleanup
NoahStapp Nov 20, 2024
d5de764
AWS auth fix
NoahStapp Nov 20, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add run-with-env.sh
  • Loading branch information
NoahStapp committed Nov 8, 2024
commit 3ef0084f862b718226de14b0cf231287c2769ecc
25 changes: 23 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ functions:
params:
binary: bash
args:
- src/.evergreen/scripts/run-with-env.sh
- src/.evergreen/scripts/bootstrap-mongo-orchestration.sh
- command: expansions.update
params:
Expand Down Expand Up @@ -267,6 +268,7 @@ functions:
working_dir: "src"
binary: bash
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mod-wsgi-tests.sh

"run mockupdb tests":
Expand All @@ -276,6 +278,7 @@ functions:
working_dir: "src"
binary: bash
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mockupdb-tests.sh

"run doctests":
Expand All @@ -285,6 +288,7 @@ functions:
working_dir: "src"
binary: bash
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-doctests.sh

"run tests":
Expand All @@ -295,13 +299,15 @@ functions:
background: true
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/setup-encryption.sh
- command: subprocess.exec
params:
working_dir: "src"
binary: bash
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-tests.sh

"run enterprise auth tests":
Expand All @@ -312,14 +318,15 @@ functions:
working_dir: "src"
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-enterprise-auth-tests.sh

"run atlas tests":
- command: subprocess.exec
type: test
params:
binary: bash
include_expansions_in_env: ["PYTHON_BINARY", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
Expand All @@ -338,10 +345,11 @@ functions:
- command: subprocess.exec
type: test
params:
include_expansions_in_env: ["DRIVERS_TOOLS", "PYTHON_BINARY", "skip_EC2_auth_test"]
include_expansions_in_env: ["DRIVERS_TOOLS", "skip_EC2_auth_test"]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- regular

Expand All @@ -353,6 +361,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- assume-role

Expand All @@ -364,6 +373,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- ec2

Expand All @@ -376,6 +386,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- web-identity
- command: subprocess.exec
Expand All @@ -385,6 +396,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- AWS_ROLE_SESSION_NAME="test" .evergreen/scripts/run-mongodb-aws-test.sh
- web-identity

Expand All @@ -396,6 +408,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- env-creds

Expand All @@ -407,6 +420,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-mongodb-aws-test.sh
- session-creds

Expand Down Expand Up @@ -439,6 +453,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-aws-ecs-auth-test.sh

"cleanup":
Expand All @@ -447,6 +462,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/cleanup.sh

"fix absolute paths":
Expand Down Expand Up @@ -483,6 +499,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/install-dependencies.sh

"assume ec2 role":
Expand Down Expand Up @@ -512,6 +529,7 @@ functions:
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-ocsp-test.sh

"run-ocsp-server":
Expand All @@ -529,6 +547,7 @@ functions:
binary: bash
include_expansions_in_env: ["MONGODB_URI"]
args:
- src/.evergreen/scripts/run-with-env.sh
- src/.evergreen/scripts/run-load-balancer.sh
- command: expansions.update
params:
Expand All @@ -553,6 +572,7 @@ functions:
params:
binary: bash
args:
- src/.evergreen/scripts/run-with-env.sh
- src/.evergreen/scripts/teardown-aws.sh

"teardown atlas":
Expand All @@ -569,6 +589,7 @@ functions:
working_dir: "src"
binary: bash
args:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/run-perf-tests.sh

"attach benchmark test results":
Expand Down
1 change: 0 additions & 1 deletion .evergreen/scripts/bootstrap-mongo-orchestration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

. src/.evergreen/scripts/env.sh
set -o xtrace

# Enable core dumps if enabled on the machine
Expand Down
1 change: 0 additions & 1 deletion .evergreen/scripts/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

. .evergreen/scripts/env.sh
if [ -f "$DRIVERS_TOOLS"/.evergreen/csfle/secrets-export.sh ]; then
. .evergreen/hatch.sh encryption:teardown
fi
Expand Down
7 changes: 7 additions & 0 deletions .evergreen/scripts/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ export TEST_DATA_LAKE="${TEST_DATA_LAKE:-}"
export TEST_SUITES="${TEST_SUITES:-}"
export MONGODB_API_VERSION="${MONGODB_API_VERSION:-}"
export SKIP_HATCH="${SKIP_HATCH:-}"
export skip_crypt_shared="${skip_crypt_shared:-}"
export VERSION="${VERSION:-}"
export TOPOLOGY="${TOPOLOGY:-}"
export STORAGE_ENGINE="${STORAGE_ENGINE:-}"
export ORCHESTRATION_FILE="${ORCHESTRATION_FILE:-}"
export REQUIRE_API_VERSION="${REQUIRE_API_VERSION:-}"
export LOAD_BALANCER="${LOAD_BALANCER:-}"

export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
export PATH="$MONGODB_BINARIES:$PATH"
Expand Down
3 changes: 1 addition & 2 deletions .evergreen/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

. .evergreen/scripts/env.sh
set -o xtrace
file="$PROJECT_DIRECTORY/.evergreen/install-dependencies.sh"
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
[ -f "$file" ] && bash $file || echo "$file not available, skipping"
[ -f "$file" ] && bash "$file" || echo "$file not available, skipping"
3 changes: 1 addition & 2 deletions .evergreen/scripts/run-aws-ecs-auth-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ if [ "${skip_ECS_auth_test}" = "true" ]; then
echo "This platform does not support the ECS auth test, skipping..."
exit 0
fi
. .evergreen/scripts/env.sh
set -ex
cd $DRIVERS_TOOLS/.evergreen/auth_aws
cd "$DRIVERS_TOOLS"/.evergreen/auth_aws
. ./activate-authawsvenv.sh
. aws_setup.sh ecs
export MONGODB_BINARIES="$MONGODB_BINARIES"
Expand Down
3 changes: 1 addition & 2 deletions .evergreen/scripts/run-doctests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

. .evergreen/scripts/env.sh
set -o xtrace
PYTHON_BINARY=${PYTHON_BINARY} bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh doctest:test
PYTHON_BINARY=${PYTHON_BINARY} bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh doctest:test
2 changes: 1 addition & 1 deletion .evergreen/scripts/run-enterprise-auth-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Disable xtrace for security reasons (just in case it was accidentally set).
set +x
bash ${DRIVERS_TOOLS}/.evergreen/auth_aws/setup_secrets.sh drivers/enterprise_auth
bash "${DRIVERS_TOOLS}"/.evergreen/auth_aws/setup_secrets.sh drivers/enterprise_auth
TEST_ENTERPRISE_AUTH=1 AUTH=auth bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-eg
1 change: 0 additions & 1 deletion .evergreen/scripts/run-load-balancer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

. src/.evergreen/scripts/env.sh
MONGODB_URI=${MONGODB_URI} bash "${DRIVERS_TOOLS}"/.evergreen/run-load-balancer.sh start
3 changes: 1 addition & 2 deletions .evergreen/scripts/run-mockupdb-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

. .evergreen/scripts/env.sh
set -o xtrace
export PYTHON_BINARY=${PYTHON_BINARY}
bash ${PROJECT_DIRECTORY}/.evergreen/hatch.sh test:test-mockupdb
bash "${PROJECT_DIRECTORY}"/.evergreen/hatch.sh test:test-mockupdb
2 changes: 0 additions & 2 deletions .evergreen/scripts/run-mod-wsgi-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -o xtrace
set -o errexit

. .evergreen/scripts/env.sh

APACHE=$(command -v apache2 || command -v /usr/lib/apache2/mpm-prefork/apache2) || true
if [ -n "$APACHE" ]; then
APACHE_CONFIG=apache24ubuntu161404.conf
Expand Down
5 changes: 0 additions & 5 deletions .evergreen/scripts/run-mongodb-aws-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
set -o xtrace
set -o errexit # Exit the script with error if any of the commands fail

set -eu

############################################
# Main Program #
############################################
Expand All @@ -21,11 +19,8 @@ if [ "${skip_EC2_auth_test:-}" = "true" ] && { [ "$1" = "ec2" ] || [ "$1" = "web
exit 0
fi

. .evergreen/scripts/env.sh
echo "Running MONGODB-AWS authentication tests for $1"

python -c "import os; print([key for key in os.environ.keys()])"

# Handle credentials and environment setup.
. "$DRIVERS_TOOLS"/.evergreen/auth_aws/aws_setup.sh "$1"

Expand Down
3 changes: 0 additions & 3 deletions .evergreen/scripts/run-ocsp-test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

set -eu
. .evergreen/scripts/env.sh

TEST_OCSP=1 \
PYTHON_BINARY="${PYTHON_BINARY}" \
CA_FILE="${DRIVERS_TOOLS}/.evergreen/ocsp/${OCSP_ALGORITHM}/ca.pem" \
Expand Down
1 change: 0 additions & 1 deletion .evergreen/scripts/run-perf-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

. .evergreen/scripts/env.sh
PROJECT_DIRECTORY=${PROJECT_DIRECTORY}
bash "${PROJECT_DIRECTORY}"/.evergreen/run-perf-tests.sh
1 change: 0 additions & 1 deletion .evergreen/scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

. .evergreen/scripts/env.sh
if [ -n "${test_encryption}" ]; then
./.evergreen/hatch.sh encryption:setup &
Copy link
Member

Choose a reason for hiding this comment

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

We might need to break this out the way we handle it in the go driver, as a separate background command: https://github.com/mongodb/mongo-go-driver/blob/cf0348c9a63f6e4086e2c62aa62e70a9d3b3a986/.evergreen/config.yml#L508

fi
Expand Down
4 changes: 3 additions & 1 deletion .evergreen/scripts/run-with-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -eu
#!/bin/bash

# Example use: bash run-with-env.sh run-tests.sh {args...}

Expand All @@ -9,5 +9,7 @@ else
. src/.evergreen/scripts/env.sh
fi

set -eu

# shellcheck source=/dev/null
. "$1" "${@:2}"
3 changes: 0 additions & 3 deletions .evergreen/scripts/setup-encryption.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

set -eu

. .evergreen/scripts/env.sh
if [ -n "${test_encryption}" ]; then
./.evergreen/hatch.sh encryption:setup &
fi
2 changes: 0 additions & 2 deletions .evergreen/scripts/teardown-aws.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

. src/.evergreen/scripts/env.sh

cd "${DRIVERS_TOOLS}/.evergreen/auth_aws" || exit
if [ -f "./aws_e2e_setup.json" ]; then
. ./activate-authawsvenv.sh
Expand Down