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 setup-tests.sh
  • Loading branch information
NoahStapp committed Nov 12, 2024
commit 40a99843b6e32b3d23b11e6f7865783f3c3158fc
65 changes: 64 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ functions:
- command: subprocess.exec
params:
binary: bash
include_expansions_in_env: ["VERSION", "TOPOLOGY"]
include_expansions_in_env: ["VERSION", "TOPOLOGY", "ORCHESTRATION_FILE"]
args:
- src/.evergreen/scripts/run-with-env.sh
- src/.evergreen/scripts/bootstrap-mongo-orchestration.sh
Expand Down Expand Up @@ -293,6 +293,13 @@ functions:
- .evergreen/scripts/run-doctests.sh

"run tests":
- command: subprocess.exec
params:
include_expansions_in_env: ["TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE", "SINGLE_MONGOS_LB_URI", "MULTI_MONGOS_LB_URI"]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
params:
working_dir: "src"
Expand Down Expand Up @@ -343,6 +350,13 @@ functions:
- ${DRIVERS_TOOLS}/.evergreen/auth_aws/setup-secrets.sh

"run aws auth test with regular aws credentials":
- command: subprocess.exec
params:
include_expansions_in_env: ["TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE"]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand All @@ -355,6 +369,13 @@ functions:
- regular

"run aws auth test with assume role credentials":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand All @@ -367,6 +388,13 @@ functions:
- assume-role

"run aws auth test with aws EC2 credentials":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand All @@ -379,6 +407,13 @@ functions:
- ec2

"run aws auth test with aws web identity credentials":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- # Test with and without AWS_ROLE_SESSION_NAME set.
- command: subprocess.exec
type: test
Expand All @@ -402,6 +437,13 @@ functions:
- web-identity

"run aws auth test with aws credentials as environment variables":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand All @@ -414,6 +456,13 @@ functions:
- env-creds

"run aws auth test with aws credentials and session token as environment variables":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand All @@ -426,6 +475,13 @@ functions:
- session-creds

"run oidc auth test with test credentials":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand Down Expand Up @@ -523,6 +579,13 @@ functions:
file: atlas-expansion.yml

"run-ocsp-test":
- command: subprocess.exec
params:
include_expansions_in_env: [ "TEST_DATA_LAKE", "TEST_INDEX_MANAGEMENT", "CRYPT_SHARED_LIB_PATH", "test_encryption", "test_encryption_pyopenssl", "test_crypt_shared", "test_pyopenssl", "test_loadbalancer", "test_serverless", "ORCHESTRATION_FILE" ]
binary: bash
working_dir: "src"
args:
- .evergreen/scripts/setup-tests.sh
- command: subprocess.exec
type: test
params:
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/scripts/bootstrap-mongo-orchestration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MONGODB_VERSION=${VERSION} \
SSL=${SSL} \
STORAGE_ENGINE=${STORAGE_ENGINE} \
DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \
ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
ORCHESTRATION_FILE=${ORCHESTRATION_FILE:-} \
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
LOAD_BALANCER=${LOAD_BALANCER} \
bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
Expand Down
7 changes: 0 additions & 7 deletions .evergreen/scripts/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,8 @@ export MONGODB_API_VERSION="${MONGODB_API_VERSION:-}"
export SKIP_HATCH="${SKIP_HATCH:-}"
export skip_crypt_shared="${skip_crypt_shared:-}"
export STORAGE_ENGINE="${STORAGE_ENGINE:-}"
export ORCHESTRATION_FILE="${ORCHESTRATION_FILE:-}"
export REQUIRE_API_VERSION="${REQUIRE_API_VERSION:-}"
export LOAD_BALANCER="${LOAD_BALANCER:-}"
test_encryption="${test_encryption:-}"
test_encryption_pyopenssl="${test_encryption_pyopenssl:-}"
test_crypt_shared="${test_crypt_shared:-}"
test_pyopenssl="${test_pyopenssl:-}"
test_loadbalancer="${test_loadbalancer:-}"
test_serverless="${test_serverless:-}"

export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
export PATH="$MONGODB_BINARIES:$PATH"
Expand Down
8 changes: 7 additions & 1 deletion .evergreen/scripts/run-with-env.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
#!/bin/bash -eu

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

# Parameter expansion to get just the current directory's name
if [ "${PWD##*/}" == "src" ]; then
. .evergreen/scripts/env.sh
if [ -f ".evergreen/scripts/test-env.sh" ]; then
. .evergreen/scripts/test-env.sh
fi
else
. src/.evergreen/scripts/env.sh
if [ -f "src/.evergreen/scripts/test-env.sh" ]; then
. src/.evergreen/scripts/test-env.sh
fi
fi

set -eu
Expand Down
25 changes: 25 additions & 0 deletions .evergreen/scripts/setup-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -eux

PROJECT_DIRECTORY="$(pwd)"
SCRIPT_DIR="$PROJECT_DIRECTORY/.evergreen/scripts"

if [ -f "$SCRIPT_DIR/test-env.sh" ]; then
echo "Reading $SCRIPT_DIR/test-env.sh file"
. "$SCRIPT_DIR/test-env.sh"
exit 0
fi

cat <<EOT > "$SCRIPT_DIR"/test-env.sh
echo "Sourcing test-env.sh now, ORCHESTRATION_FILE: $ORCHESTRATION_FILE"
export test_encryption="${test_encryption:-}"
export test_encryption_pyopenssl="${test_encryption_pyopenssl:-}"
export test_crypt_shared="${test_crypt_shared:-}"
export test_pyopenssl="${test_pyopenssl:-}"
export test_loadbalancer="${test_loadbalancer:-}"
export test_serverless="${test_serverless:-}"
export TEST_INDEX_MANAGEMENT="${TEST_INDEX_MANAGEMENT:-}"
export TEST_DATA_LAKE="${TEST_DATA_LAKE:-}"
export ORCHESTRATION_FILE="${ORCHESTRATION_FILE:-}"
EOT

chmod +x "$SCRIPT_DIR"/test-env.sh