Skip to content

Commit f1be764

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into PYTHON-5204
2 parents c2aae63 + 6e5126d commit f1be764

20 files changed

+265
-269
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -289,28 +289,6 @@ functions:
289289
- .evergreen/scripts/run-with-env.sh
290290
- .evergreen/scripts/run-atlas-tests.sh
291291

292-
"run oidc auth test with test credentials":
293-
- command: subprocess.exec
294-
type: test
295-
params:
296-
working_dir: "src"
297-
binary: bash
298-
include_expansions_in_env: ["DRIVERS_TOOLS", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
299-
args:
300-
- .evergreen/run-mongodb-oidc-test.sh
301-
302-
"run oidc k8s auth test":
303-
- command: subprocess.exec
304-
type: test
305-
params:
306-
binary: bash
307-
working_dir: src
308-
env:
309-
OIDC_ENV: k8s
310-
include_expansions_in_env: ["DRIVERS_TOOLS", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "K8S_VARIANT"]
311-
args:
312-
- ${PROJECT_DIRECTORY}/.evergreen/run-mongodb-oidc-remote-test.sh
313-
314292
"cleanup":
315293
- command: subprocess.exec
316294
params:
@@ -394,96 +372,6 @@ post:
394372
- func: "cleanup"
395373

396374
task_groups:
397-
- name: testazureoidc_task_group
398-
setup_group:
399-
- func: fetch source
400-
- func: setup system
401-
- command: subprocess.exec
402-
params:
403-
binary: bash
404-
env:
405-
AZUREOIDC_VMNAME_PREFIX: "PYTHON_DRIVER"
406-
args:
407-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
408-
teardown_task:
409-
- command: subprocess.exec
410-
params:
411-
binary: bash
412-
args:
413-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/azure/delete-vm.sh
414-
setup_group_can_fail_task: true
415-
setup_group_timeout_secs: 1800
416-
tasks:
417-
- oidc-auth-test-azure
418-
419-
- name: testgcpoidc_task_group
420-
setup_group:
421-
- func: fetch source
422-
- func: setup system
423-
- command: subprocess.exec
424-
params:
425-
binary: bash
426-
env:
427-
GCPOIDC_VMNAME_PREFIX: "PYTHON_DRIVER"
428-
args:
429-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/gcp/setup.sh
430-
teardown_task:
431-
- command: subprocess.exec
432-
params:
433-
binary: bash
434-
args:
435-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/gcp/teardown.sh
436-
setup_group_can_fail_task: true
437-
setup_group_timeout_secs: 1800
438-
tasks:
439-
- oidc-auth-test-gcp
440-
441-
- name: testk8soidc_task_group
442-
setup_group:
443-
- func: fetch source
444-
- func: setup system
445-
- command: ec2.assume_role
446-
params:
447-
role_arn: ${aws_test_secrets_role}
448-
duration_seconds: 1800
449-
- command: subprocess.exec
450-
params:
451-
binary: bash
452-
args:
453-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/setup.sh
454-
teardown_task:
455-
- command: subprocess.exec
456-
params:
457-
binary: bash
458-
args:
459-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/k8s/teardown.sh
460-
setup_group_can_fail_task: true
461-
setup_group_timeout_secs: 1800
462-
tasks:
463-
- oidc-auth-test-k8s
464-
465-
- name: testoidc_task_group
466-
setup_group:
467-
- func: fetch source
468-
- func: setup system
469-
- func: "assume ec2 role"
470-
- command: subprocess.exec
471-
params:
472-
binary: bash
473-
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
474-
args:
475-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
476-
teardown_task:
477-
- command: subprocess.exec
478-
params:
479-
binary: bash
480-
args:
481-
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/teardown.sh
482-
setup_group_can_fail_task: true
483-
setup_group_timeout_secs: 1800
484-
tasks:
485-
- oidc-auth-test
486-
487375
- name: test_aws_lambda_task_group
488376
setup_group:
489377
- func: fetch source
@@ -629,47 +517,6 @@ tasks:
629517
env:
630518
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/test/lambda
631519

632-
- name: "oidc-auth-test"
633-
commands:
634-
- func: "run oidc auth test with test credentials"
635-
636-
- name: "oidc-auth-test-azure"
637-
commands:
638-
- command: subprocess.exec
639-
type: test
640-
params:
641-
binary: bash
642-
working_dir: src
643-
env:
644-
OIDC_ENV: azure
645-
include_expansions_in_env: ["DRIVERS_TOOLS"]
646-
args:
647-
- ${PROJECT_DIRECTORY}/.evergreen/run-mongodb-oidc-remote-test.sh
648-
649-
- name: "oidc-auth-test-gcp"
650-
commands:
651-
- command: subprocess.exec
652-
type: test
653-
params:
654-
binary: bash
655-
working_dir: src
656-
env:
657-
OIDC_ENV: gcp
658-
include_expansions_in_env: ["DRIVERS_TOOLS"]
659-
args:
660-
- ${PROJECT_DIRECTORY}/.evergreen/run-mongodb-oidc-remote-test.sh
661-
662-
- name: "oidc-auth-test-k8s"
663-
commands:
664-
- func: "run oidc k8s auth test"
665-
vars:
666-
K8S_VARIANT: eks
667-
- func: "run oidc k8s auth test"
668-
vars:
669-
K8S_VARIANT: gke
670-
- func: "run oidc k8s auth test"
671-
vars:
672-
K8S_VARIANT: aks
673520
# }}}
674521
- name: "coverage-report"
675522
tags: ["coverage"]

.evergreen/generated_configs/tasks.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,50 @@ tasks:
10421042
TEST_NAME: ocsp
10431043
tags: [ocsp, ocsp-rsa]
10441044

1045+
# Oidc tests
1046+
- name: test-auth-oidc-default
1047+
commands:
1048+
- func: run tests
1049+
vars:
1050+
TEST_NAME: auth_oidc
1051+
SUB_TEST_NAME: default
1052+
tags: [auth_oidc]
1053+
- name: test-auth-oidc-azure
1054+
commands:
1055+
- func: run tests
1056+
vars:
1057+
TEST_NAME: auth_oidc
1058+
SUB_TEST_NAME: azure
1059+
tags: [auth_oidc, auth_oidc_remote]
1060+
- name: test-auth-oidc-gcp
1061+
commands:
1062+
- func: run tests
1063+
vars:
1064+
TEST_NAME: auth_oidc
1065+
SUB_TEST_NAME: gcp
1066+
tags: [auth_oidc, auth_oidc_remote]
1067+
- name: test-auth-oidc-eks
1068+
commands:
1069+
- func: run tests
1070+
vars:
1071+
TEST_NAME: auth_oidc
1072+
SUB_TEST_NAME: eks
1073+
tags: [auth_oidc, auth_oidc_remote]
1074+
- name: test-auth-oidc-aks
1075+
commands:
1076+
- func: run tests
1077+
vars:
1078+
TEST_NAME: auth_oidc
1079+
SUB_TEST_NAME: aks
1080+
tags: [auth_oidc, auth_oidc_remote]
1081+
- name: test-auth-oidc-gke
1082+
commands:
1083+
- func: run tests
1084+
vars:
1085+
TEST_NAME: auth_oidc
1086+
SUB_TEST_NAME: gke
1087+
tags: [auth_oidc, auth_oidc_remote]
1088+
10451089
# Server tests
10461090
- name: test-4.0-standalone-auth-ssl-sync
10471091
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -920,24 +920,21 @@ buildvariants:
920920
# Oidc auth tests
921921
- name: auth-oidc-ubuntu-22
922922
tasks:
923-
- name: testoidc_task_group
924-
- name: testazureoidc_task_group
925-
- name: testgcpoidc_task_group
926-
- name: testk8soidc_task_group
923+
- name: .auth_oidc
927924
display_name: Auth OIDC Ubuntu-22
928925
run_on:
929926
- ubuntu2204-small
930927
batchtime: 10080
931928
- name: auth-oidc-macos
932929
tasks:
933-
- name: testoidc_task_group
930+
- name: .auth_oidc !.auth_oidc_remote
934931
display_name: Auth OIDC macOS
935932
run_on:
936933
- macos-14
937934
batchtime: 10080
938935
- name: auth-oidc-win64
939936
tasks:
940-
- name: testoidc_task_group
937+
- name: .auth_oidc !.auth_oidc_remote
941938
display_name: Auth OIDC Win64
942939
run_on:
943940
- windows-64-vsMulti-small

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

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

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

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,14 @@
33
set +x # Disable debug trace
44
set -eu
55

6-
echo "Running MONGODB-OIDC authentication tests"
7-
8-
OIDC_ENV=${OIDC_ENV:-"test"}
9-
10-
if [ $OIDC_ENV == "test" ]; then
11-
# Make sure DRIVERS_TOOLS is set.
12-
if [ -z "$DRIVERS_TOOLS" ]; then
13-
echo "Must specify DRIVERS_TOOLS"
14-
exit 1
15-
fi
16-
source ${DRIVERS_TOOLS}/.evergreen/auth_oidc/secrets-export.sh
17-
18-
elif [ $OIDC_ENV == "azure" ]; then
19-
source ./env.sh
20-
21-
elif [ $OIDC_ENV == "gcp" ]; then
22-
source ./secrets-export.sh
23-
24-
elif [ $OIDC_ENV == "k8s" ]; then
25-
echo "Running oidc on k8s"
6+
echo "Running MONGODB-OIDC authentication tests on ${OIDC_ENV}..."
267

8+
if [ ${OIDC_ENV} == "k8s" ]; then
9+
SUB_TEST_NAME=$K8S_VARIANT-remote
2710
else
28-
echo "Unrecognized OIDC_ENV $OIDC_ENV"
29-
exit 1
11+
SUB_TEST_NAME=$OIDC_ENV-remote
3012
fi
31-
32-
COVERAGE=1 bash ./.evergreen/just.sh setup-tests auth_oidc
13+
bash ./.evergreen/just.sh setup-tests auth_oidc $SUB_TEST_NAME
3314
bash ./.evergreen/just.sh run-tests "${@:1}"
15+
16+
echo "Running MONGODB-OIDC authentication tests on ${OIDC_ENV}... done."

.evergreen/run-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fi
2626

2727
# Source the local secrets export file if available.
2828
if [ -f "./secrets-export.sh" ]; then
29+
echo "Sourcing local secrets file"
2930
. "./secrets-export.sh"
3031
fi
3132

.evergreen/scripts/generate_config.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,11 @@ def create_serverless_variants():
661661

662662
def create_oidc_auth_variants():
663663
variants = []
664-
other_tasks = ["testazureoidc_task_group", "testgcpoidc_task_group", "testk8soidc_task_group"]
665664
for host_name in ["ubuntu22", "macos", "win64"]:
666-
tasks = ["testoidc_task_group"]
667665
if host_name == "ubuntu22":
668-
tasks += other_tasks
666+
tasks = [".auth_oidc"]
667+
else:
668+
tasks = [".auth_oidc !.auth_oidc_remote"]
669669
host = HOSTS[host_name]
670670
variants.append(
671671
create_variant(
@@ -882,6 +882,19 @@ def create_aws_tasks():
882882
return tasks
883883

884884

885+
def create_oidc_tasks():
886+
tasks = []
887+
for sub_test in ["default", "azure", "gcp", "eks", "aks", "gke"]:
888+
vars = dict(TEST_NAME="auth_oidc", SUB_TEST_NAME=sub_test)
889+
test_func = FunctionCall(func="run tests", vars=vars)
890+
task_name = f"test-auth-oidc-{sub_test}"
891+
tags = ["auth_oidc"]
892+
if sub_test != "default":
893+
tags.append("auth_oidc_remote")
894+
tasks.append(EvgTask(name=task_name, tags=tags, commands=[test_func]))
895+
return tasks
896+
897+
885898
def _create_ocsp_task(algo, variant, server_type, base_task_name):
886899
file_name = f"{algo}-basic-tls-ocsp-{variant}.json"
887900

0 commit comments

Comments
 (0)