Skip to content

Commit 9dcc417

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver into PYTHON-4891-c-ext
2 parents 4a4ca3a + 5280596 commit 9dcc417

File tree

3 files changed

+67
-51
lines changed

3 files changed

+67
-51
lines changed

.evergreen/config.yml

Lines changed: 28 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,19 +2247,6 @@ axes:
22472247
variables:
22482248
MOD_WSGI_VERSION: "4"
22492249

2250-
# Choice of MongoDB storage engine
2251-
- id: storage-engine
2252-
display_name: Storage
2253-
values:
2254-
- id: mmapv1
2255-
display_name: MMAPv1
2256-
variables:
2257-
STORAGE_ENGINE: "mmapv1"
2258-
- id: inmemory
2259-
display_name: InMemory
2260-
variables:
2261-
STORAGE_ENGINE: "inmemory"
2262-
22632250
# Run with test commands disabled on server?
22642251
- id: disableTestCommands
22652252
display_name: Disable test commands
@@ -3318,6 +3305,34 @@ buildvariants:
33183305
SSL: ssl
33193306
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
33203307

3308+
# Storage Engine tests.
3309+
- name: storage-inmemory-rhel8-py3.9
3310+
tasks:
3311+
- name: .standalone .4.0
3312+
- name: .standalone .4.4
3313+
- name: .standalone .5.0
3314+
- name: .standalone .6.0
3315+
- name: .standalone .7.0
3316+
- name: .standalone .8.0
3317+
- name: .standalone .rapid
3318+
- name: .standalone .latest
3319+
display_name: Storage InMemory RHEL8 py3.9
3320+
run_on:
3321+
- rhel87-small
3322+
expansions:
3323+
STORAGE_ENGINE: inmemory
3324+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3325+
- name: storage-mmapv1-rhel8-py3.9
3326+
tasks:
3327+
- name: .standalone .4.0
3328+
- name: .replica_set .4.0
3329+
display_name: Storage MMAPv1 RHEL8 py3.9
3330+
run_on:
3331+
- rhel87-small
3332+
expansions:
3333+
STORAGE_ENGINE: mmapv1
3334+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3335+
33213336
# Versioned API tests.
33223337
- name: versioned-api-require-v1-rhel8-py3.9-auth
33233338
tasks:
@@ -3547,38 +3562,6 @@ buildvariants:
35473562
tasks:
35483563
- ".5.0"
35493564

3550-
# Storage engine tests on RHEL 8.4 (x86_64) with Python 3.9.
3551-
- matrix_name: "tests-storage-engines"
3552-
matrix_spec:
3553-
platform: rhel8
3554-
storage-engine: "*"
3555-
python-version: "3.9"
3556-
display_name: "Storage ${storage-engine} ${python-version} ${platform}"
3557-
rules:
3558-
- if:
3559-
platform: rhel8
3560-
storage-engine: ["inmemory"]
3561-
python-version: "*"
3562-
then:
3563-
add_tasks:
3564-
- "test-latest-standalone"
3565-
- "test-8.0-standalone"
3566-
- "test-7.0-standalone"
3567-
- "test-6.0-standalone"
3568-
- "test-5.0-standalone"
3569-
- "test-4.4-standalone"
3570-
- "test-4.2-standalone"
3571-
- "test-4.0-standalone"
3572-
- if:
3573-
# MongoDB 4.2 drops support for MMAPv1
3574-
platform: rhel8
3575-
storage-engine: ["mmapv1"]
3576-
python-version: "*"
3577-
then:
3578-
add_tasks:
3579-
- "test-4.0-standalone"
3580-
- "test-4.0-replica_set"
3581-
35823565
# enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.9.
35833566
- matrix_name: "test-disableTestCommands"
35843567
matrix_spec:

.evergreen/scripts/generate_config.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,24 @@ def get_python_binary(python: str, host: str) -> str:
111111
raise ValueError(f"no match found for python {python} on {host}")
112112

113113

114-
def get_pythons_from(min_version: str) -> list[str]:
115-
"""Get all pythons starting from a minimum version."""
114+
def get_versions_from(min_version: str) -> list[str]:
115+
"""Get all server versions starting from a minimum version."""
116116
min_version_float = float(min_version)
117117
rapid_latest = ["rapid", "latest"]
118118
versions = [v for v in ALL_VERSIONS if v not in rapid_latest]
119119
return [v for v in versions if float(v) >= min_version_float] + rapid_latest
120120

121121

122+
def get_versions_until(max_version: str) -> list[str]:
123+
"""Get all server version up to a max version."""
124+
max_version_float = float(max_version)
125+
versions = [v for v in ALL_VERSIONS if v not in ["rapid", "latest"]]
126+
versions = [v for v in versions if float(v) <= max_version_float]
127+
if not len(versions):
128+
raise ValueError(f"No server versions found less <= {max_version}")
129+
return versions
130+
131+
122132
def get_display_name(base: str, host: str, **kwargs) -> str:
123133
"""Get the display name of a variant."""
124134
display_name = f"{base} {HOSTS[host].display_name}"
@@ -250,7 +260,7 @@ def create_server_variants() -> list[BuildVariant]:
250260
tasks = [f".{topology}"]
251261
# MacOS arm64 only works on server versions 6.0+
252262
if host == "macos-arm64":
253-
tasks = [f".{topology} .{version}" for version in get_pythons_from("6.0")]
263+
tasks = [f".{topology} .{version}" for version in get_versions_from("6.0")]
254264
expansions = dict(AUTH=auth, SSL=ssl, TEST_SUITES=test_suite, SKIP_CSOT_TESTS="true")
255265
display_name = get_display_name("Test", host, python=python, **expansions)
256266
variant = create_variant(
@@ -337,7 +347,7 @@ def create_load_balancer_variants():
337347
task_names = ["load-balancer-test"]
338348
batchtime = BATCHTIME_WEEK
339349
expansions_base = dict(test_loadbalancer="true")
340-
versions = get_pythons_from("6.0")
350+
versions = get_versions_from("6.0")
341351
variants = []
342352
pythons = CPYTHONS + PYPYS
343353
for ind, (version, (auth, ssl)) in enumerate(product(versions, AUTH_SSLS)):
@@ -449,10 +459,33 @@ def create_pyopenssl_variants():
449459
return variants
450460

451461

462+
def create_storage_engine_tests():
463+
host = "rhel8"
464+
engines = ["InMemory", "MMAPv1"]
465+
variants = []
466+
for engine in engines:
467+
python = CPYTHONS[0]
468+
expansions = dict(STORAGE_ENGINE=engine.lower())
469+
if engine == engines[0]:
470+
tasks = [f".standalone .{v}" for v in ALL_VERSIONS]
471+
else:
472+
# MongoDB 4.2 drops support for MMAPv1
473+
versions = get_versions_until("4.0")
474+
tasks = [f".standalone .{v}" for v in versions] + [
475+
f".replica_set .{v}" for v in versions
476+
]
477+
display_name = get_display_name(f"Storage {engine}", host, python=python)
478+
variant = create_variant(
479+
tasks, display_name, host=host, python=python, expansions=expansions
480+
)
481+
variants.append(variant)
482+
return variants
483+
484+
452485
def create_versioned_api_tests():
453486
host = "rhel8"
454487
tags = ["versionedApi_tag"]
455-
tasks = [f".standalone .{v}" for v in get_pythons_from("5.0")]
488+
tasks = [f".standalone .{v}" for v in get_versions_from("5.0")]
456489
variants = []
457490
types = ["require v1", "accept v2"]
458491

requirements/typing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy==1.11.2
1+
mypy==1.12.1
22
pyright==1.1.384
33
typing_extensions
44
-r ./encryption.txt

0 commit comments

Comments
 (0)