Skip to content

Commit 63c3739

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents 6f330ae + 1145c9d commit 63c3739

31 files changed

+1020
-227
lines changed

.evergreen/config.yml

Lines changed: 10 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ functions:
4242
# Make an evergreen expansion file with dynamic values
4343
- command: subprocess.exec
4444
params:
45-
include_expansions_in_env: ["is_patch", "project", "version_id", "skip_web_identity_auth_test", "skip_ECS_auth_test"]
45+
include_expansions_in_env: ["is_patch", "project", "version_id"]
4646
binary: bash
4747
working_dir: "src"
4848
args:
@@ -213,16 +213,14 @@ functions:
213213
params:
214214
file: ${DRIVERS_TOOLS}/mo-expansion.yml
215215

216-
"run doctests":
217-
- command: subprocess.exec
218-
type: test
219-
params:
220-
include_expansions_in_env: [ "PYTHON_BINARY" ]
221-
working_dir: "src"
222-
binary: bash
223-
args:
224-
- .evergreen/scripts/run-with-env.sh
225-
- .evergreen/scripts/run-doctests.sh
216+
"run just script":
217+
- command: subprocess.exec
218+
type: test
219+
params:
220+
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
221+
binary: bash
222+
working_dir: "src"
223+
args: [.evergreen/just.sh, "${JUSTFILE_TARGET}"]
226224

227225
"run tests":
228226
- command: subprocess.exec
@@ -248,7 +246,6 @@ functions:
248246
binary: bash
249247
working_dir: "src"
250248
args:
251-
- .evergreen/scripts/run-with-env.sh
252249
- .evergreen/scripts/cleanup.sh
253250

254251
"teardown system":
@@ -268,27 +265,7 @@ functions:
268265
- command: ec2.assume_role
269266
params:
270267
role_arn: ${aws_test_secrets_role}
271-
272-
"setup atlas":
273-
- command: subprocess.exec
274-
params:
275-
binary: bash
276-
include_expansions_in_env: ["task_id", "execution"]
277-
env:
278-
MONGODB_VERSION: "7.0"
279-
LAMBDA_STACK_NAME: dbx-python-lambda
280-
args:
281-
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
282-
- command: expansions.update
283-
params:
284-
file: atlas-expansion.yml
285-
286-
"teardown atlas":
287-
- command: subprocess.exec
288-
params:
289-
binary: bash
290-
args:
291-
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
268+
duration_seconds: 3600
292269

293270
"attach benchmark test results":
294271
- command: attach.results
@@ -314,31 +291,6 @@ post:
314291
- func: "upload test results"
315292
- func: "cleanup"
316293

317-
task_groups:
318-
- name: test_aws_lambda_task_group
319-
setup_group:
320-
- func: fetch source
321-
- func: setup system
322-
- func: setup atlas
323-
teardown_task:
324-
- func: teardown atlas
325-
setup_group_can_fail_task: true
326-
setup_group_timeout_secs: 1800
327-
tasks:
328-
- test-aws-lambda-deployed
329-
330-
- name: test_atlas_task_group_search_indexes
331-
setup_group:
332-
- func: fetch source
333-
- func: setup system
334-
- func: setup atlas
335-
teardown_task:
336-
- func: teardown atlas
337-
setup_group_can_fail_task: true
338-
setup_group_timeout_secs: 1800
339-
tasks:
340-
- test-search-index-helpers
341-
342294
tasks:
343295
# Wildcard task. Do you need to find out what tools are available and where?
344296
# Throw it here, and execute this task on all buildvariants
@@ -350,63 +302,7 @@ tasks:
350302
params:
351303
args:
352304
- src/.evergreen/scripts/run-getdata.sh
353-
# Standard test tasks {{{
354-
355-
- name: "mockupdb"
356-
tags: ["mockupdb"]
357-
commands:
358-
- func: "run tests"
359-
vars:
360-
TEST_NAME: mockupdb
361-
362-
- name: "doctests"
363-
tags: ["doctests"]
364-
commands:
365-
- func: "run server"
366-
- func: "run doctests"
367305

368-
- name: "test-search-index-helpers"
369-
commands:
370-
- func: "run server"
371-
vars:
372-
VERSION: "6.0"
373-
TOPOLOGY: "replica_set"
374-
- func: "run tests"
375-
vars:
376-
TEST_NAME: index_management
377-
AUTH: "auth"
378-
379-
- name: "no-server"
380-
tags: ["no-server"]
381-
commands:
382-
- func: "run tests"
383-
384-
- name: "free-threading"
385-
tags: ["free-threading"]
386-
commands:
387-
- func: "run server"
388-
vars:
389-
VERSION: "8.0"
390-
TOPOLOGY: "replica_set"
391-
- func: "run tests"
392-
393-
- name: "test-aws-lambda-deployed"
394-
commands:
395-
- command: ec2.assume_role
396-
params:
397-
role_arn: ${LAMBDA_AWS_ROLE_ARN}
398-
duration_seconds: 3600
399-
- command: subprocess.exec
400-
params:
401-
working_dir: src
402-
binary: bash
403-
add_expansions_to_env: true
404-
args:
405-
- .evergreen/run-deployed-lambda-aws-tests.sh
406-
env:
407-
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
408-
409-
# }}}
410306
- name: "coverage-report"
411307
tags: ["coverage"]
412308
depends_on:
@@ -456,12 +352,6 @@ tasks:
456352
- ${github_commit}
457353

458354
buildvariants:
459-
- name: "no-server"
460-
display_name: "No server"
461-
run_on:
462-
- rhel84-small
463-
tasks:
464-
- name: "no-server"
465355

466356
- name: "Coverage Report"
467357
display_name: "Coverage Report"
@@ -482,12 +372,6 @@ buildvariants:
482372
batchtime: 10080 # 7 days
483373
- name: test-azurekms-fail
484374

485-
- name: rhel8-test-lambda
486-
display_name: FaaS Lambda
487-
run_on: rhel87-small
488-
tasks:
489-
- name: test_aws_lambda_task_group
490-
491375
- name: rhel8-import-time
492376
display_name: Import Time
493377
run_on: rhel87-small

.evergreen/generated_configs/tasks.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ tasks:
2323
TEST_NAME: data_lake
2424
tags: [atlas_data_lake]
2525

26+
# Aws lambda tests
27+
- name: test-aws-lambda-deployed
28+
commands:
29+
- func: assume ec2 role
30+
- func: run tests
31+
vars:
32+
TEST_NAME: aws_lambda
33+
tags: [aws_lambda]
34+
2635
# Aws tests
2736
- name: test-auth-aws-4.4-regular
2837
commands:
@@ -704,6 +713,15 @@ tasks:
704713
AWS_ROLE_SESSION_NAME: test
705714
tags: [auth-aws, auth-aws-web-identity]
706715

716+
# Doctest tests
717+
- name: test-doctests
718+
commands:
719+
- func: run server
720+
- func: run just script
721+
vars:
722+
JUSTFILE_TARGET: docs-test
723+
tags: [doctests]
724+
707725
# Enterprise auth tests
708726
- name: test-enterprise-auth
709727
commands:
@@ -718,6 +736,16 @@ tasks:
718736
AUTH: auth
719737
tags: [enterprise_auth]
720738

739+
# Free threading tests
740+
- name: test-free-threading
741+
commands:
742+
- func: run server
743+
vars:
744+
VERSION: "8.0"
745+
TOPOLOGY: replica_set
746+
- func: run tests
747+
tags: [free-threading]
748+
721749
# Kms tests
722750
- name: test-gcpkms
723751
commands:
@@ -790,6 +818,14 @@ tasks:
790818
TEST_NAME: load_balancer
791819
tags: [load-balancer, noauth, nossl]
792820

821+
# Mockupdb tests
822+
- name: test-mockupdb
823+
commands:
824+
- func: run tests
825+
vars:
826+
TEST_NAME: mockupdb
827+
tags: [mockupdb]
828+
793829
# Mod wsgi tests
794830
- name: mod-wsgi-standalone
795831
commands:
@@ -832,6 +868,12 @@ tasks:
832868
SUB_TEST_NAME: embedded
833869
tags: [mod_wsgi]
834870

871+
# No server tests
872+
- name: test-no-server
873+
commands:
874+
- func: run tests
875+
tags: [no-server]
876+
835877
# Ocsp tests
836878
- name: test-ocsp-ecdsa-valid-cert-server-does-not-staple
837879
commands:
@@ -1220,6 +1262,18 @@ tasks:
12201262
- func: send dashboard data
12211263
tags: [perf]
12221264

1265+
# Search index tests
1266+
- name: test-search-index-helpers
1267+
commands:
1268+
- func: assume ec2 role
1269+
- func: run server
1270+
vars:
1271+
TEST_NAME: search_index
1272+
- func: run tests
1273+
vars:
1274+
TEST_NAME: search_index
1275+
tags: [search_index]
1276+
12231277
# Server tests
12241278
- name: test-4.0-standalone-auth-ssl-sync
12251279
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ buildvariants:
132132
expansions:
133133
PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3
134134

135+
# Aws lambda tests
136+
- name: faas-lambda
137+
tasks:
138+
- name: .aws_lambda
139+
display_name: FaaS Lambda
140+
run_on:
141+
- rhel87-small
142+
135143
# Compression tests
136144
- name: compression-snappy-rhel8-python3.9-no-c
137145
tasks:
@@ -234,7 +242,7 @@ buildvariants:
234242
# Doctests tests
235243
- name: doctests-rhel8-python3.9
236244
tasks:
237-
- name: doctests
245+
- name: .doctests
238246
display_name: Doctests RHEL8 Python3.9
239247
run_on:
240248
- rhel87-small
@@ -664,7 +672,7 @@ buildvariants:
664672
# Mockupdb tests
665673
- name: mockupdb-rhel8-python3.9
666674
tasks:
667-
- name: mockupdb
675+
- name: .mockupdb
668676
display_name: MockupDB RHEL8 Python3.9
669677
run_on:
670678
- rhel87-small
@@ -738,6 +746,14 @@ buildvariants:
738746
NO_EXT: "1"
739747
PYTHON_BINARY: /opt/python/3.13/bin/python3
740748

749+
# No server tests
750+
- name: no-server
751+
tasks:
752+
- name: .no-server
753+
display_name: No server
754+
run_on:
755+
- rhel87-small
756+
741757
# Ocsp tests
742758
- name: ocsp-rhel8-v4.4-python3.9
743759
tasks:
@@ -986,7 +1002,7 @@ buildvariants:
9861002
# Search index tests
9871003
- name: search-index-helpers-rhel8-python3.9
9881004
tasks:
989-
- name: test_atlas_task_group_search_indexes
1005+
- name: .search_index
9901006
display_name: Search Index Helpers RHEL8 Python3.9
9911007
run_on:
9921008
- rhel87-small

.evergreen/run-deployed-lambda-aws-tests.sh

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

.evergreen/run-tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ fi
3434
uv sync ${UV_ARGS} --reinstall
3535
uv pip list
3636

37+
# Ensure we go back to base environment after the test.
38+
trap "uv sync" EXIT HUP
39+
3740
# Start the test runner.
38-
uv run .evergreen/scripts/run_tests.py "$@"
41+
uv run ${UV_ARGS} .evergreen/scripts/run_tests.py "$@"
3942

4043
popd

.evergreen/scripts/cleanup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
22

3+
HERE=$(dirname ${BASH_SOURCE:-$0})
4+
5+
# Try to source the env file.
6+
if [ -f $HERE/env.sh ]; then
7+
echo "Sourcing env file"
8+
source $HERE/env.sh
9+
fi
10+
311
rm -rf "${DRIVERS_TOOLS}" || true
412
rm -f ./secrets-export.sh || true

.evergreen/scripts/configure-env.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
6060
export MONGODB_BINARIES="$MONGODB_BINARIES"
6161
export DRIVERS_TOOLS_BINARIES="$DRIVERS_TOOLS_BINARIES"
6262
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
63-
export skip_web_identity_auth_test="${skip_web_identity_auth_test:-}"
64-
export skip_ECS_auth_test="${skip_ECS_auth_test:-}"
6563
6664
export CARGO_HOME="$CARGO_HOME"
6765
export UV_TOOL_DIR="$UV_TOOL_DIR"

0 commit comments

Comments
 (0)