Skip to content

Commit 3c1bb28

Browse files
authored
Merge branch 'master' into PYTHON-3636
2 parents e38c2ad + 5e055ee commit 3c1bb28

16 files changed

+164
-157
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -267,28 +267,6 @@ functions:
267267
binary: bash
268268
args: [.evergreen/just.sh, run-tests]
269269

270-
"run enterprise auth tests":
271-
- command: subprocess.exec
272-
type: test
273-
params:
274-
binary: bash
275-
working_dir: "src"
276-
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "PYTHON_BINARY"]
277-
args:
278-
- .evergreen/scripts/run-with-env.sh
279-
- .evergreen/scripts/run-enterprise-auth-tests.sh
280-
281-
"run atlas tests":
282-
- command: subprocess.exec
283-
type: test
284-
params:
285-
binary: bash
286-
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "PYTHON_BINARY"]
287-
working_dir: "src"
288-
args:
289-
- .evergreen/scripts/run-with-env.sh
290-
- .evergreen/scripts/run-atlas-tests.sh
291-
292270
"cleanup":
293271
- command: subprocess.exec
294272
params:
@@ -372,29 +350,6 @@ post:
372350
- func: "cleanup"
373351

374352
task_groups:
375-
- name: serverless_task_group
376-
setup_group_can_fail_task: true
377-
setup_group_timeout_secs: 1800 # 30 minutes
378-
setup_group:
379-
- func: "fetch source"
380-
- func: "setup system"
381-
- command: subprocess.exec
382-
params:
383-
binary: bash
384-
env:
385-
VAULT_NAME: ${VAULT_NAME}
386-
args:
387-
- ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
388-
teardown_task:
389-
- command: subprocess.exec
390-
params:
391-
binary: bash
392-
args:
393-
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
394-
- func: "upload test results"
395-
tasks:
396-
- ".serverless"
397-
398353
- name: test_aws_lambda_task_group
399354
setup_group:
400355
- func: fetch source
@@ -445,20 +400,6 @@ tasks:
445400
- func: "run server"
446401
- func: "run doctests"
447402

448-
- name: "test-serverless"
449-
tags: ["serverless"]
450-
commands:
451-
- func: "run tests"
452-
vars:
453-
TEST_NAME: serverless
454-
455-
- name: "test-enterprise-auth"
456-
tags: ["enterprise-auth"]
457-
commands:
458-
- func: "run server"
459-
- func: "assume ec2 role"
460-
- func: "run enterprise auth tests"
461-
462403
- name: "test-search-index-helpers"
463404
commands:
464405
- func: "run server"
@@ -518,12 +459,6 @@ tasks:
518459
TOPOLOGY: "replica_set"
519460
- func: "run tests"
520461

521-
- name: "atlas-connect"
522-
tags: ["atlas-connect"]
523-
commands:
524-
- func: "assume ec2 role"
525-
- func: "run atlas tests"
526-
527462
- name: atlas-data-lake-tests
528463
commands:
529464
- func: "bootstrap data lake"

.evergreen/generated_configs/tasks.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
tasks:
2+
# Atlas connect tests
3+
- name: test-atlas-connect
4+
commands:
5+
- func: assume ec2 role
6+
- func: run tests
7+
vars:
8+
TEST_NAME: atlas_connect
9+
tags: [atlas_connect]
10+
211
# Aws tests
312
- name: test-auth-aws-4.4-regular
413
commands:
@@ -680,6 +689,20 @@ tasks:
680689
AWS_ROLE_SESSION_NAME: test
681690
tags: [auth-aws, auth-aws-web-identity]
682691

692+
# Enterprise auth tests
693+
- name: test-enterprise-auth
694+
commands:
695+
- func: run server
696+
vars:
697+
TEST_NAME: enterprise_auth
698+
AUTH: auth
699+
- func: assume ec2 role
700+
- func: run tests
701+
vars:
702+
TEST_NAME: enterprise_auth
703+
AUTH: auth
704+
tags: [enterprise_auth]
705+
683706
# Kms tests
684707
- name: test-gcpkms
685708
commands:
@@ -5866,3 +5889,13 @@ tasks:
58665889
- noauth
58675890
- nossl
58685891
- sync_async
5892+
5893+
# Serverless tests
5894+
- name: test-serverless
5895+
commands:
5896+
- func: run tests
5897+
vars:
5898+
TEST_NAME: serverless
5899+
AUTH: auth
5900+
SSL: ssl
5901+
tags: [serverless]

.evergreen/generated_configs/variants.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ buildvariants:
4949
# Atlas connect tests
5050
- name: atlas-connect-rhel8-python3.9
5151
tasks:
52-
- name: atlas-connect
52+
- name: .atlas_connect
5353
display_name: Atlas connect RHEL8 Python3.9
5454
run_on:
5555
- rhel87-small
5656
expansions:
5757
PYTHON_BINARY: /opt/python/3.9/bin/python3
5858
- name: atlas-connect-rhel8-python3.13
5959
tasks:
60-
- name: atlas-connect
60+
- name: .atlas_connect
6161
display_name: Atlas connect RHEL8 Python3.13
6262
run_on:
6363
- rhel87-small
@@ -510,59 +510,53 @@ buildvariants:
510510
tags: [encryption_tag]
511511

512512
# Enterprise auth tests
513-
- name: auth-enterprise-macos-python3.9-auth
513+
- name: auth-enterprise-macos-python3.9
514514
tasks:
515-
- name: test-enterprise-auth
516-
display_name: Auth Enterprise macOS Python3.9 Auth
515+
- name: .enterprise_auth
516+
display_name: Auth Enterprise macOS Python3.9
517517
run_on:
518518
- macos-14
519519
expansions:
520-
AUTH: auth
521520
PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3
522-
- name: auth-enterprise-rhel8-python3.10-auth
521+
- name: auth-enterprise-rhel8-python3.10
523522
tasks:
524-
- name: test-enterprise-auth
525-
display_name: Auth Enterprise RHEL8 Python3.10 Auth
523+
- name: .enterprise_auth
524+
display_name: Auth Enterprise RHEL8 Python3.10
526525
run_on:
527526
- rhel87-small
528527
expansions:
529-
AUTH: auth
530528
PYTHON_BINARY: /opt/python/3.10/bin/python3
531-
- name: auth-enterprise-rhel8-python3.11-auth
529+
- name: auth-enterprise-rhel8-python3.11
532530
tasks:
533-
- name: test-enterprise-auth
534-
display_name: Auth Enterprise RHEL8 Python3.11 Auth
531+
- name: .enterprise_auth
532+
display_name: Auth Enterprise RHEL8 Python3.11
535533
run_on:
536534
- rhel87-small
537535
expansions:
538-
AUTH: auth
539536
PYTHON_BINARY: /opt/python/3.11/bin/python3
540-
- name: auth-enterprise-rhel8-python3.12-auth
537+
- name: auth-enterprise-rhel8-python3.12
541538
tasks:
542-
- name: test-enterprise-auth
543-
display_name: Auth Enterprise RHEL8 Python3.12 Auth
539+
- name: .enterprise_auth
540+
display_name: Auth Enterprise RHEL8 Python3.12
544541
run_on:
545542
- rhel87-small
546543
expansions:
547-
AUTH: auth
548544
PYTHON_BINARY: /opt/python/3.12/bin/python3
549-
- name: auth-enterprise-win64-python3.13-auth
545+
- name: auth-enterprise-win64-python3.13
550546
tasks:
551-
- name: test-enterprise-auth
552-
display_name: Auth Enterprise Win64 Python3.13 Auth
547+
- name: .enterprise_auth
548+
display_name: Auth Enterprise Win64 Python3.13
553549
run_on:
554550
- windows-64-vsMulti-small
555551
expansions:
556-
AUTH: auth
557552
PYTHON_BINARY: C:/python/Python313/python.exe
558-
- name: auth-enterprise-rhel8-pypy3.10-auth
553+
- name: auth-enterprise-rhel8-pypy3.10
559554
tasks:
560-
- name: test-enterprise-auth
561-
display_name: Auth Enterprise RHEL8 PyPy3.10 Auth
555+
- name: .enterprise_auth
556+
display_name: Auth Enterprise RHEL8 PyPy3.10
562557
run_on:
563558
- rhel87-small
564559
expansions:
565-
AUTH: auth
566560
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
567561

568562
# Free threaded tests
@@ -1235,27 +1229,21 @@ buildvariants:
12351229
# Serverless tests
12361230
- name: serverless-rhel8-python3.9
12371231
tasks:
1238-
- name: serverless_task_group
1232+
- name: .serverless
12391233
display_name: Serverless RHEL8 Python3.9
12401234
run_on:
12411235
- rhel87-small
12421236
batchtime: 10080
12431237
expansions:
1244-
TEST_NAME: serverless
1245-
AUTH: auth
1246-
SSL: ssl
12471238
PYTHON_BINARY: /opt/python/3.9/bin/python3
12481239
- name: serverless-rhel8-python3.13
12491240
tasks:
1250-
- name: serverless_task_group
1241+
- name: .serverless
12511242
display_name: Serverless RHEL8 Python3.13
12521243
run_on:
12531244
- rhel87-small
12541245
batchtime: 10080
12551246
expansions:
1256-
TEST_NAME: serverless
1257-
AUTH: auth
1258-
SSL: ssl
12591247
PYTHON_BINARY: /opt/python/3.13/bin/python3
12601248

12611249
# Stable api tests

.evergreen/scripts/configure-env.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,24 @@ cat <<EOT > expansion.yml
9292
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
9393
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
9494
EOT
95+
96+
# If the toolchain is available, symlink binaries to the bin dir. This has to be done
97+
# after drivers-tools is cloned, since we might be using its binary dir.
98+
_bin_path=""
99+
if [ "Windows_NT" == "${OS:-}" ]; then
100+
_bin_path="/cygdrive/c/Python/Current/Scripts"
101+
elif [ "$(uname -s)" != "Darwin" ]; then
102+
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
103+
else
104+
_bin_path="/opt/python/Current/bin"
105+
fi
106+
if [ -d "${_bin_path}" ]; then
107+
_suffix=""
108+
if [ "Windows_NT" == "${OS:-}" ]; then
109+
_suffix=".exe"
110+
fi
111+
mkdir -p $PYMONGO_BIN_DIR
112+
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
113+
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}
114+
ln -s ${_bin_path}/uvx${_suffix} $PYMONGO_BIN_DIR/uvx${_suffix}
115+
fi

.evergreen/scripts/generate_config.py

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ def create_compression_variants():
464464

465465

466466
def create_enterprise_auth_variants():
467-
expansions = dict(AUTH="auth")
468467
variants = []
469468

470469
# All python versions across platforms.
@@ -475,10 +474,8 @@ def create_enterprise_auth_variants():
475474
host = HOSTS["win64"]
476475
else:
477476
host = DEFAULT_HOST
478-
display_name = get_display_name("Auth Enterprise", host, python=python, **expansions)
479-
variant = create_variant(
480-
["test-enterprise-auth"], display_name, host=host, python=python, expansions=expansions
481-
)
477+
display_name = get_display_name("Auth Enterprise", host, python=python)
478+
variant = create_variant([".enterprise_auth"], display_name, host=host, python=python)
482479
variants.append(variant)
483480

484481
return variants
@@ -645,16 +642,14 @@ def create_disable_test_commands_variants():
645642
def create_serverless_variants():
646643
host = DEFAULT_HOST
647644
batchtime = BATCHTIME_WEEK
648-
expansions = dict(TEST_NAME="serverless", AUTH="auth", SSL="ssl")
649-
tasks = ["serverless_task_group"]
645+
tasks = [".serverless"]
650646
base_name = "Serverless"
651647
return [
652648
create_variant(
653649
tasks,
654650
get_display_name(base_name, host, python=python),
655651
host=host,
656652
python=python,
657-
expansions=expansions,
658653
batchtime=batchtime,
659654
)
660655
for python in MIN_MAX_PYTHON
@@ -723,7 +718,7 @@ def create_atlas_connect_variants():
723718
host = DEFAULT_HOST
724719
return [
725720
create_variant(
726-
["atlas-connect"],
721+
[".atlas_connect"],
727722
get_display_name("Atlas connect", host, python=python),
728723
python=python,
729724
host=host,
@@ -915,6 +910,25 @@ def _create_ocsp_task(algo, variant, server_type, base_task_name):
915910
return EvgTask(name=task_name, tags=tags, commands=commands)
916911

917912

913+
def create_atlas_connect_tasks():
914+
vars = dict(TEST_NAME="atlas_connect")
915+
assume_func = FunctionCall(func="assume ec2 role")
916+
test_func = FunctionCall(func="run tests", vars=vars)
917+
task_name = "test-atlas-connect"
918+
tags = ["atlas_connect"]
919+
return [EvgTask(name=task_name, tags=tags, commands=[assume_func, test_func])]
920+
921+
922+
def create_enterprise_auth_tasks():
923+
vars = dict(TEST_NAME="enterprise_auth", AUTH="auth")
924+
server_func = FunctionCall(func="run server", vars=vars)
925+
assume_func = FunctionCall(func="assume ec2 role")
926+
test_func = FunctionCall(func="run tests", vars=vars)
927+
task_name = "test-enterprise-auth"
928+
tags = ["enterprise_auth"]
929+
return [EvgTask(name=task_name, tags=tags, commands=[server_func, assume_func, test_func])]
930+
931+
918932
def create_ocsp_tasks():
919933
tasks = []
920934
tests = [
@@ -951,6 +965,14 @@ def create_ocsp_tasks():
951965
return tasks
952966

953967

968+
def create_serverless_tasks():
969+
vars = dict(TEST_NAME="serverless", AUTH="auth", SSL="ssl")
970+
test_func = FunctionCall(func="run tests", vars=vars)
971+
tags = ["serverless"]
972+
task_name = "test-serverless"
973+
return [EvgTask(name=task_name, tags=tags, commands=[test_func])]
974+
975+
954976
##################
955977
# Generate Config
956978
##################

.evergreen/scripts/install-dependencies.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ function _pip_install() {
2424
echo "Installing $2 using pip..."
2525
createvirtualenv "$(find_python3)" $_VENV_PATH
2626
python -m pip install $1
27+
_suffix=""
2728
if [ "Windows_NT" = "${OS:-}" ]; then
28-
ln -s "$(which $2)" $_BIN_DIR/$2.exe
29-
else
30-
ln -s "$(which $2)" $_BIN_DIR/$2
29+
_suffix=".exe"
30+
fi
31+
ln -s "$(which $2)" $_BIN_DIR/${2}${_suffix}
32+
# uv also comes with a uvx binary.
33+
if [ $2 == "uv" ]; then
34+
ln -s "$(which uvx)" $_BIN_DIR/uvx${_suffix}
3135
fi
3236
echo "Installed to ${_BIN_DIR}"
3337
echo "Installing $2 using pip... done."

0 commit comments

Comments
 (0)