Skip to content

Commit f6704c3

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into shrub-pyopenssl
2 parents 536544a + 021a9f7 commit f6704c3

File tree

6 files changed

+98
-19
lines changed

6 files changed

+98
-19
lines changed

.evergreen/config.yml

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,71 @@ buildvariants:
31843184
COMPRESSORS: zstd
31853185
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
31863186

3187+
# Enterprise auth tests.
3188+
- name: enterprise-auth-macos-py3.9-auth
3189+
tasks:
3190+
- name: test-enterprise-auth
3191+
display_name: Enterprise Auth macOS py3.9 Auth
3192+
run_on:
3193+
- macos-14
3194+
expansions:
3195+
AUTH: auth
3196+
PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3
3197+
- name: enterprise-auth-rhel8-py3.10-auth
3198+
tasks:
3199+
- name: test-enterprise-auth
3200+
display_name: Enterprise Auth RHEL8 py3.10 Auth
3201+
run_on:
3202+
- rhel87-small
3203+
expansions:
3204+
AUTH: auth
3205+
PYTHON_BINARY: /opt/python/3.10/bin/python3
3206+
- name: enterprise-auth-rhel8-py3.11-auth
3207+
tasks:
3208+
- name: test-enterprise-auth
3209+
display_name: Enterprise Auth RHEL8 py3.11 Auth
3210+
run_on:
3211+
- rhel87-small
3212+
expansions:
3213+
AUTH: auth
3214+
PYTHON_BINARY: /opt/python/3.11/bin/python3
3215+
- name: enterprise-auth-rhel8-py3.12-auth
3216+
tasks:
3217+
- name: test-enterprise-auth
3218+
display_name: Enterprise Auth RHEL8 py3.12 Auth
3219+
run_on:
3220+
- rhel87-small
3221+
expansions:
3222+
AUTH: auth
3223+
PYTHON_BINARY: /opt/python/3.12/bin/python3
3224+
- name: enterprise-auth-win64-py3.13-auth
3225+
tasks:
3226+
- name: test-enterprise-auth
3227+
display_name: Enterprise Auth Win64 py3.13 Auth
3228+
run_on:
3229+
- windows-64-vsMulti-small
3230+
expansions:
3231+
AUTH: auth
3232+
PYTHON_BINARY: C:/python/Python313/python.exe
3233+
- name: enterprise-auth-rhel8-pypy3.9-auth
3234+
tasks:
3235+
- name: test-enterprise-auth
3236+
display_name: Enterprise Auth RHEL8 pypy3.9 Auth
3237+
run_on:
3238+
- rhel87-small
3239+
expansions:
3240+
AUTH: auth
3241+
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
3242+
- name: enterprise-auth-rhel8-pypy3.10-auth
3243+
tasks:
3244+
- name: test-enterprise-auth
3245+
display_name: Enterprise Auth RHEL8 pypy3.10 Auth
3246+
run_on:
3247+
- rhel87-small
3248+
expansions:
3249+
AUTH: auth
3250+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
3251+
31873252
- matrix_name: "tests-fips"
31883253
matrix_spec:
31893254
platform:
@@ -3299,24 +3364,6 @@ buildvariants:
32993364
tasks:
33003365
- ".latest"
33013366

3302-
- matrix_name: "test-linux-enterprise-auth"
3303-
matrix_spec:
3304-
platform: rhel8
3305-
python-version: "*"
3306-
auth: "auth"
3307-
display_name: "Enterprise ${auth} ${platform} ${python-version}"
3308-
tasks:
3309-
- name: "test-enterprise-auth"
3310-
3311-
- matrix_name: "tests-windows-enterprise-auth"
3312-
matrix_spec:
3313-
platform: windows
3314-
python-version-windows: "*"
3315-
auth: "auth"
3316-
display_name: "Enterprise ${auth} ${platform} ${python-version-windows}"
3317-
tasks:
3318-
- name: "test-enterprise-auth"
3319-
33203367
- matrix_name: "test-search-index-helpers"
33213368
matrix_spec:
33223369
platform: rhel8

.evergreen/run-tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ if [ -n "$TEST_ENTERPRISE_AUTH" ]; then
9090
export GSSAPI_HOST=${SASL_HOST}
9191
export GSSAPI_PORT=${SASL_PORT}
9292
export GSSAPI_PRINCIPAL=${PRINCIPAL}
93+
94+
export TEST_SUITES="auth"
9395
fi
9496

9597
if [ -n "$TEST_LOADBALANCER" ]; then

.evergreen/scripts/generate_config.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,31 @@ def create_compression_variants():
416416
return variants
417417

418418

419+
def create_enterprise_auth_variants():
420+
expansions = dict(AUTH="auth")
421+
variants = []
422+
423+
# All python versions across platforms.
424+
for python in ALL_PYTHONS:
425+
if python == CPYTHONS[0]:
426+
host = "macos"
427+
elif python == CPYTHONS[-1]:
428+
host = "win64"
429+
else:
430+
host = "rhel8"
431+
display_name = get_display_name("Enterprise Auth", host, python=python, **expansions)
432+
variant = create_variant(
433+
["test-enterprise-auth"], display_name, host=host, python=python, expansions=expansions
434+
)
435+
variants.append(variant)
436+
437+
return variants
438+
439+
419440
##################
420441
# Generate Config
421442
##################
422443

423-
variants = create_compression_variants()
444+
variants = create_enterprise_auth_variants()
424445
# print(len(variants))
425446
generate_yaml(variants=variants)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ filterwarnings = [
9999
markers = [
100100
"auth_aws: tests that rely on pymongo-auth-aws",
101101
"auth_oidc: tests that rely on oidc auth",
102+
"auth: tests that rely on authentication",
102103
"ocsp: tests that rely on ocsp",
103104
"atlas: tests that rely on atlas",
104105
"data_lake: tests that rely on atlas data lake",

test/asynchronous/test_auth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
)
3333
from test.utils import AllowListEventListener, delay, ignore_deprecations
3434

35+
import pytest
36+
3537
from pymongo import AsyncMongoClient, monitoring
3638
from pymongo.asynchronous.auth import HAVE_KERBEROS
3739
from pymongo.auth_shared import _build_credentials_tuple
@@ -42,6 +44,8 @@
4244

4345
_IS_SYNC = False
4446

47+
pytestmark = pytest.mark.auth
48+
4549
# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS ON UNIX.
4650
GSSAPI_HOST = os.environ.get("GSSAPI_HOST")
4751
GSSAPI_PORT = int(os.environ.get("GSSAPI_PORT", "27017"))

test/test_auth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
)
3333
from test.utils import AllowListEventListener, delay, ignore_deprecations
3434

35+
import pytest
36+
3537
from pymongo import MongoClient, monitoring
3638
from pymongo.auth_shared import _build_credentials_tuple
3739
from pymongo.errors import OperationFailure
@@ -42,6 +44,8 @@
4244

4345
_IS_SYNC = True
4446

47+
pytestmark = pytest.mark.auth
48+
4549
# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS ON UNIX.
4650
GSSAPI_HOST = os.environ.get("GSSAPI_HOST")
4751
GSSAPI_PORT = int(os.environ.get("GSSAPI_PORT", "27017"))

0 commit comments

Comments
 (0)