Merge branch 'master' of github.com:mongodb/mongo-python-driver

This commit is contained in:
Steven Silvester 2024-10-18 09:09:01 -05:00
commit 8d7c96f649
No known key found for this signature in database
GPG Key ID: B1BF5EC3A8B32F91
6 changed files with 98 additions and 19 deletions

View File

@ -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:
@ -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

View File

@ -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

View File

@ -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)

View File

@ -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",

View File

@ -32,6 +32,8 @@ from test.asynchronous import (
)
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
@ -42,6 +44,8 @@ from pymongo.saslprep import HAVE_STRINGPREP
_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"))

View File

@ -32,6 +32,8 @@ from test import (
)
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
@ -42,6 +44,8 @@ from pymongo.synchronous.auth import HAVE_KERBEROS
_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"))