Skip to content

Commit 344f1f9

Browse files
authored
Merge branch 'master' into PYTHON-4493-prod
2 parents ee1f308 + 8927cfe commit 344f1f9

File tree

79 files changed

+1773
-796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1773
-796
lines changed

.evergreen/config.yml

Lines changed: 11 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,16 @@ functions:
262262
params:
263263
include_expansions_in_env: [AUTH, SSL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
264264
AWS_SESSION_TOKEN, COVERAGE, PYTHON_BINARY, LIBMONGOCRYPT_URL, MONGODB_URI,
265-
DISABLE_TEST_COMMANDS, GREEN_FRAMEWORK, NO_EXT, COMPRESSORS]
265+
DISABLE_TEST_COMMANDS, GREEN_FRAMEWORK, NO_EXT, COMPRESSORS, MONGODB_API_VERSION, DEBUG_LOG]
266266
binary: bash
267267
working_dir: "src"
268-
args: [.evergreen/just.sh, setup-test, "${TEST_NAME}", "${SUB_TEST_NAME}"]
268+
args: [.evergreen/just.sh, setup-tests, "${TEST_NAME}", "${SUB_TEST_NAME}"]
269269
- command: subprocess.exec
270270
type: test
271271
params:
272272
working_dir: "src"
273273
binary: bash
274-
args: [.evergreen/just.sh, test-eg]
274+
args: [.evergreen/just.sh, run-tests]
275275

276276
"run enterprise auth tests":
277277
- command: subprocess.exec
@@ -443,13 +443,12 @@ functions:
443443
binary: bash
444444
working_dir: "src"
445445
args:
446-
- ${DRIVERS_TOOLS}/.evergreen/csfle/teardown.sh
446+
- ${DRIVERS_TOOLS}/.evergreen/ocsp/teardown.sh
447447
- command: subprocess.exec
448448
params:
449-
binary: bash
450-
working_dir: "src"
451-
args:
452-
- ${DRIVERS_TOOLS}/.evergreen/ocsp/teardown.sh
449+
binary: bash
450+
working_dir: "src"
451+
args: [.evergreen/just.sh, teardown-tests]
453452
- command: subprocess.exec
454453
params:
455454
binary: bash
@@ -562,51 +561,6 @@ task_groups:
562561
tasks:
563562
- ".serverless"
564563

565-
- name: testgcpkms_task_group
566-
setup_group_can_fail_task: true
567-
setup_group_timeout_secs: 1800 # 30 minutes
568-
setup_group:
569-
- func: fetch source
570-
- func: setup system
571-
- command: subprocess.exec
572-
params:
573-
binary: bash
574-
args:
575-
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/create-and-setup-instance.sh
576-
teardown_task:
577-
- command: subprocess.exec
578-
params:
579-
binary: bash
580-
args:
581-
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/delete-instance.sh
582-
- func: "upload test results"
583-
tasks:
584-
- testgcpkms-task
585-
586-
- name: testazurekms_task_group
587-
setup_group:
588-
- func: fetch source
589-
- func: setup system
590-
- command: subprocess.exec
591-
params:
592-
binary: bash
593-
env:
594-
AZUREKMS_VMNAME_PREFIX: "PYTHON_DRIVER"
595-
args:
596-
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/create-and-setup-vm.sh
597-
teardown_group:
598-
- command: subprocess.exec
599-
params:
600-
binary: bash
601-
args:
602-
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/delete-vm.sh
603-
- func: "upload test results"
604-
setup_group_can_fail_task: true
605-
teardown_task_can_fail_task: true
606-
setup_group_timeout_secs: 1800
607-
tasks:
608-
- testazurekms-task
609-
610564
- name: testazureoidc_task_group
611565
setup_group:
612566
- func: fetch source
@@ -1395,60 +1349,6 @@ tasks:
13951349
commands:
13961350
- func: "download and merge coverage"
13971351

1398-
- name: "testgcpkms-task"
1399-
commands:
1400-
- command: subprocess.exec
1401-
type: test
1402-
params:
1403-
working_dir: "src"
1404-
binary: bash
1405-
include_expansions_in_env: ["DRIVERS_TOOLS"]
1406-
args:
1407-
- .evergreen/run-gcpkms-test.sh
1408-
1409-
- name: "testgcpkms-fail-task"
1410-
# testgcpkms-fail-task runs in a non-GCE environment.
1411-
# It is expected to fail to obtain GCE credentials.
1412-
commands:
1413-
- func: "bootstrap mongo-orchestration"
1414-
vars:
1415-
VERSION: "latest"
1416-
TOPOLOGY: "server"
1417-
- command: subprocess.exec
1418-
type: test
1419-
params:
1420-
include_expansions_in_env: ["PYTHON_BINARY"]
1421-
working_dir: "src"
1422-
binary: "bash"
1423-
args:
1424-
- .evergreen/scripts/run-gcpkms-fail-test.sh
1425-
1426-
- name: testazurekms-task
1427-
commands:
1428-
- command: subprocess.exec
1429-
type: test
1430-
params:
1431-
binary: bash
1432-
working_dir: src
1433-
include_expansions_in_env: ["DRIVERS_TOOLS"]
1434-
args:
1435-
- .evergreen/run-azurekms-test.sh
1436-
1437-
- name: testazurekms-fail-task
1438-
commands:
1439-
- func: "bootstrap mongo-orchestration"
1440-
vars:
1441-
VERSION: "latest"
1442-
TOPOLOGY: "server"
1443-
- command: subprocess.exec
1444-
type: test
1445-
params:
1446-
binary: bash
1447-
working_dir: src
1448-
include_expansions_in_env: ["DRIVERS_TOOLS"]
1449-
args:
1450-
- .evergreen/run-azurekms-fail-test.sh
1451-
14521352
- name: "perf-6.0-standalone"
14531353
tags: ["perf"]
14541354
commands:
@@ -1529,12 +1429,12 @@ buildvariants:
15291429
run_on:
15301430
- debian11-small
15311431
tasks:
1532-
- name: testgcpkms_task_group
1432+
- name: test-gcpkms
15331433
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README
1534-
- testgcpkms-fail-task
1535-
- name: testazurekms_task_group
1434+
- name: test-gcpkms-fail
1435+
- name: test-azurekms
15361436
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README
1537-
- testazurekms-fail-task
1437+
- name: test-azurekms-fail
15381438

15391439
- name: rhel8-test-lambda
15401440
display_name: FaaS Lambda

.evergreen/generated_configs/tasks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
tasks:
2+
# Kms tests
3+
- name: test-gcpkms
4+
commands:
5+
- func: run tests
6+
vars:
7+
TEST_NAME: kms
8+
SUB_TEST_NAME: gcp
9+
- name: test-gcpkms-fail
10+
commands:
11+
- func: bootstrap mongo-orchestration
12+
- func: run tests
13+
vars:
14+
TEST_NAME: kms
15+
SUB_TEST_NAME: gcp-fail
16+
- name: test-azurekms
17+
commands:
18+
- func: run tests
19+
vars:
20+
TEST_NAME: kms
21+
SUB_TEST_NAME: azure
22+
- name: test-azurekms-fail
23+
commands:
24+
- func: bootstrap mongo-orchestration
25+
- func: run tests
26+
vars:
27+
TEST_NAME: kms
28+
SUB_TEST_NAME: azure-fail
29+
230
# Load balancer tests
331
- name: test-load-balancer-auth-ssl
432
commands:

.evergreen/run-azurekms-fail-test.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.evergreen/run-azurekms-test.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

.evergreen/run-gcpkms-test.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

.evergreen/run-mongodb-aws-ecs-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ export SET_XTRACE_ON=1
3030
cd src
3131
rm -rf .venv
3232
rm -f .evergreen/scripts/test-env.sh || true
33-
bash ./.evergreen/just.sh setup-test auth_aws ecs
34-
bash .evergreen/just.sh test-eg
33+
bash ./.evergreen/just.sh setup-tests auth_aws ecs
34+
bash .evergreen/just.sh run-tests

.evergreen/run-mongodb-oidc-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ else
2929
exit 1
3030
fi
3131

32-
COVERAGE=1 bash ./.evergreen/just.sh setup-test auth_oidc
33-
bash ./.evergreen/just.sh test-eg "${@:1}"
32+
COVERAGE=1 bash ./.evergreen/just.sh setup-tests auth_oidc
33+
bash ./.evergreen/just.sh run-tests "${@:1}"

.evergreen/run-perf-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export OUTPUT_FILE="${PROJECT_DIRECTORY}/results.json"
1515

1616
export PYTHON_BINARY=/opt/mongodbtoolchain/v4/bin/python3
1717

18-
bash ./.evergreen/just.sh setup-test perf
19-
bash ./.evergreen/just.sh test-eg
18+
bash ./.evergreen/just.sh setup-tests perf
19+
bash ./.evergreen/just.sh run-tests

.evergreen/run-tests.sh

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#!/bin/bash
2-
set -eux
2+
set -eu
33

44
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
55
SCRIPT_DIR="$( cd -- "$SCRIPT_DIR" > /dev/null 2>&1 && pwd )"
66
ROOT_DIR="$(dirname $SCRIPT_DIR)"
77

88
pushd $ROOT_DIR
99

10-
export PIP_QUIET=1 # Quiet by default
11-
export PIP_PREFER_BINARY=1 # Prefer binary dists by default
12-
export UV_FROZEN=1 # Do not modify lock files
13-
1410
# Try to source the env file.
1511
if [ -f $SCRIPT_DIR/scripts/env.sh ]; then
1612
echo "Sourcing env inputs"
@@ -24,75 +20,19 @@ if [ -f $SCRIPT_DIR/scripts/test-env.sh ]; then
2420
echo "Sourcing test inputs"
2521
. $SCRIPT_DIR/scripts/test-env.sh
2622
else
27-
echo "Missing test inputs, please run 'just setup-test'"
23+
echo "Missing test inputs, please run 'just setup-tests'"
24+
exit 1
2825
fi
2926

30-
3127
# Source the local secrets export file if available.
3228
if [ -f "./secrets-export.sh" ]; then
3329
. "./secrets-export.sh"
3430
fi
3531

36-
PYTHON_IMPL=$(uv run python -c "import platform; print(platform.python_implementation())")
37-
38-
# Ensure C extensions if applicable.
39-
if [ -z "${NO_EXT:-}" ] && [ "$PYTHON_IMPL" = "CPython" ]; then
40-
uv run --frozen tools/fail_if_no_c.py
41-
fi
42-
43-
if [ -n "${PYMONGOCRYPT_LIB:-}" ]; then
44-
# Ensure pymongocrypt is working properly.
45-
# shellcheck disable=SC2048
46-
uv run ${UV_ARGS} python -c "import pymongocrypt; print('pymongocrypt version: '+pymongocrypt.__version__)"
47-
# shellcheck disable=SC2048
48-
uv run ${UV_ARGS} python -c "import pymongocrypt; print('libmongocrypt version: '+pymongocrypt.libmongocrypt_version())"
49-
# PATH is updated by configure-env.sh for access to mongocryptd.
50-
fi
51-
52-
PYTHON_IMPL=$(uv run python -c "import platform; print(platform.python_implementation())")
53-
echo "Running ${AUTH:-noauth} tests over ${SSL:-nossl} with python $(uv python find)"
54-
uv run python -c 'import sys; print(sys.version)'
55-
56-
# Show the installed packages
57-
# shellcheck disable=SC2048
32+
# List the packages.
5833
PIP_QUIET=0 uv run ${UV_ARGS} --with pip pip list
5934

60-
# Record the start time for a perf test.
61-
if [ -n "${TEST_PERF:-}" ]; then
62-
start_time=$(date +%s)
63-
fi
64-
65-
# Run the tests, and store the results in Evergreen compatible XUnit XML
66-
# files in the xunit-results/ directory.
67-
TEST_ARGS=${TEST_ARGS}
68-
if [ "$#" -ne 0 ]; then
69-
TEST_ARGS="$*"
70-
fi
71-
echo "Running tests with $TEST_ARGS and uv args $UV_ARGS..."
72-
if [ -z "${GREEN_FRAMEWORK:-}" ]; then
73-
# shellcheck disable=SC2048
74-
uv run ${UV_ARGS} pytest $TEST_ARGS
75-
else
76-
# shellcheck disable=SC2048
77-
uv run ${UV_ARGS} green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS
78-
fi
79-
echo "Running tests with $TEST_ARGS... done."
80-
81-
# Handle perf test post actions.
82-
if [ -n "${TEST_PERF:-}" ]; then
83-
end_time=$(date +%s)
84-
elapsed_secs=$((end_time-start_time))
85-
86-
cat results.json
87-
88-
echo "{\"failures\": 0, \"results\": [{\"status\": \"pass\", \"exit_code\": 0, \"test_file\": \"BenchMarkTests\", \"start\": $start_time, \"end\": $end_time, \"elapsed\": $elapsed_secs}]}" > report.json
89-
90-
cat report.json
91-
fi
92-
93-
# Handle coverage post actions.
94-
if [ -n "${COVERAGE:-}" ]; then
95-
rm -rf .pytest_cache
96-
fi
35+
# Start the test runner.
36+
uv run ${UV_ARGS} .evergreen/scripts/run_tests.py "$@"
9737

9838
popd

.evergreen/scripts/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)