Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 65 additions & 18 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3194,6 +3194,71 @@ buildvariants:
COMPRESSORS: zstd
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3

# Enterprise auth tests.
- name: enterprise-auth-macos-py3.9-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth macOS py3.9 Auth
run_on:
- macos-14
expansions:
AUTH: auth
PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3
- name: enterprise-auth-rhel8-py3.10-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth RHEL8 py3.10 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/3.10/bin/python3
- name: enterprise-auth-rhel8-py3.11-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth RHEL8 py3.11 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/3.11/bin/python3
- name: enterprise-auth-rhel8-py3.12-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth RHEL8 py3.12 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/3.12/bin/python3
- name: enterprise-auth-win64-py3.13-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth Win64 py3.13 Auth
run_on:
- windows-64-vsMulti-small
expansions:
AUTH: auth
PYTHON_BINARY: C:/python/Python313/python.exe
- name: enterprise-auth-rhel8-pypy3.9-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth RHEL8 pypy3.9 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: enterprise-auth-rhel8-pypy3.10-auth
tasks:
- name: test-enterprise-auth
display_name: Enterprise Auth RHEL8 pypy3.10 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3

- matrix_name: "tests-fips"
matrix_spec:
platform:
Expand Down Expand Up @@ -3350,24 +3415,6 @@ buildvariants:
tasks:
- ".latest"

- matrix_name: "test-linux-enterprise-auth"
matrix_spec:
platform: rhel8
python-version: "*"
auth: "auth"
display_name: "Enterprise ${auth} ${platform} ${python-version}"
tasks:
- name: "test-enterprise-auth"

- matrix_name: "tests-windows-enterprise-auth"
matrix_spec:
platform: windows
python-version-windows: "*"
auth: "auth"
display_name: "Enterprise ${auth} ${platform} ${python-version-windows}"
tasks:
- name: "test-enterprise-auth"

- matrix_name: "test-search-index-helpers"
matrix_spec:
platform: rhel8
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ if [ -n "$TEST_ENTERPRISE_AUTH" ]; then
export GSSAPI_HOST=${SASL_HOST}
export GSSAPI_PORT=${SASL_PORT}
export GSSAPI_PRINCIPAL=${PRINCIPAL}

export TEST_SUITES="auth"
fi

if [ -n "$TEST_LOADBALANCER" ]; then
Expand Down
23 changes: 22 additions & 1 deletion .evergreen/scripts/generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,31 @@ def create_compression_variants():
return variants


def create_enterprise_auth_variants():
expansions = dict(AUTH="auth")
variants = []

# All python versions across platforms.
for python in ALL_PYTHONS:
if python == CPYTHONS[0]:
host = "macos"
elif python == CPYTHONS[-1]:
host = "win64"
else:
host = "rhel8"
display_name = get_display_name("Enterprise Auth", host, python=python, **expansions)
variant = create_variant(
["test-enterprise-auth"], display_name, host=host, python=python, expansions=expansions
)
variants.append(variant)

return variants


##################
# Generate Config
##################

variants = create_compression_variants()
variants = create_enterprise_auth_variants()
# print(len(variants))
generate_yaml(variants=variants)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ filterwarnings = [
markers = [
"auth_aws: tests that rely on pymongo-auth-aws",
"auth_oidc: tests that rely on oidc auth",
"auth: tests that rely on authentication",
"ocsp: tests that rely on ocsp",
"atlas: tests that rely on atlas",
"data_lake: tests that rely on atlas data lake",
Expand Down
4 changes: 4 additions & 0 deletions test/asynchronous/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
)
from test.utils import AllowListEventListener, delay, ignore_deprecations

import pytest

from pymongo import AsyncMongoClient, monitoring
from pymongo.asynchronous.auth import HAVE_KERBEROS
from pymongo.auth_shared import _build_credentials_tuple
Expand All @@ -42,6 +44,8 @@

_IS_SYNC = False

pytestmark = pytest.mark.auth

# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS ON UNIX.
GSSAPI_HOST = os.environ.get("GSSAPI_HOST")
GSSAPI_PORT = int(os.environ.get("GSSAPI_PORT", "27017"))
Expand Down
4 changes: 4 additions & 0 deletions test/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
)
from test.utils import AllowListEventListener, delay, ignore_deprecations

import pytest

from pymongo import MongoClient, monitoring
from pymongo.auth_shared import _build_credentials_tuple
from pymongo.errors import OperationFailure
Expand All @@ -42,6 +44,8 @@

_IS_SYNC = True

pytestmark = pytest.mark.auth

# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS ON UNIX.
GSSAPI_HOST = os.environ.get("GSSAPI_HOST")
GSSAPI_PORT = int(os.environ.get("GSSAPI_PORT", "27017"))
Expand Down
Loading