PYTHON-5345 Streamline the standard tasks (#2312)

This commit is contained in:
Steven Silvester 2025-05-01 09:08:48 -05:00 committed by GitHub
parent 85c5ee45b5
commit 0ec57781d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1612 additions and 987 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ buildvariants:
# Alternative hosts tests
- name: openssl-1.0.2-rhel7-v5.0-python3.9
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: OpenSSL 1.0.2 RHEL7 v5.0 Python3.9
run_on:
- rhel79-small
@ -13,7 +13,7 @@ buildvariants:
PYTHON_BINARY: /opt/python/3.9/bin/python3
- name: other-hosts-rhel9-fips-latest
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: Other hosts RHEL9-FIPS latest
run_on:
- rhel92-fips
@ -24,7 +24,7 @@ buildvariants:
REQUIRE_FIPS: "1"
- name: other-hosts-rhel8-zseries-latest
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: Other hosts RHEL8-zseries latest
run_on:
- rhel8-zseries-small
@ -34,7 +34,7 @@ buildvariants:
NO_EXT: "1"
- name: other-hosts-rhel8-power8-latest
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: Other hosts RHEL8-POWER8 latest
run_on:
- rhel8-power-small
@ -44,7 +44,7 @@ buildvariants:
NO_EXT: "1"
- name: other-hosts-rhel8-arm64-latest
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: Other hosts RHEL8-arm64 latest
run_on:
- rhel82-arm64-small
@ -54,7 +54,7 @@ buildvariants:
NO_EXT: "1"
- name: other-hosts-amazon2023-latest
tasks:
- name: .other-hosts
- name: .test-no-toolchain
display_name: Other hosts Amazon2023 latest
run_on:
- amazon2023-arm64-latest-large-m8g
@ -66,7 +66,7 @@ buildvariants:
# Atlas connect tests
- name: atlas-connect-rhel8
tasks:
- name: .no-orchestration
- name: .test-no-orchestration
display_name: Atlas connect RHEL8
run_on:
- rhel87-small
@ -74,7 +74,7 @@ buildvariants:
# Atlas data lake tests
- name: atlas-data-lake-ubuntu-22
tasks:
- name: .no-orchestration
- name: .test-no-orchestration
display_name: Atlas Data Lake Ubuntu-22
run_on:
- ubuntu2204-small
@ -120,7 +120,7 @@ buildvariants:
# Compression tests
- name: compression-snappy-rhel8
tasks:
- name: .standard-linux
- name: .test-standard
display_name: Compression snappy RHEL8
run_on:
- rhel87-small
@ -128,7 +128,7 @@ buildvariants:
COMPRESSOR: snappy
- name: compression-zlib-rhel8
tasks:
- name: .standard-linux
- name: .test-standard
display_name: Compression zlib RHEL8
run_on:
- rhel87-small
@ -136,7 +136,7 @@ buildvariants:
COMPRESSOR: zlib
- name: compression-zstd-rhel8
tasks:
- name: .standard-linux !.server-4.0
- name: .test-standard !.server-4.0
display_name: Compression zstd RHEL8
run_on:
- rhel87-small
@ -167,7 +167,7 @@ buildvariants:
# Doctests tests
- name: doctests-rhel8
tasks:
- name: .standard-linux .standalone-noauth-nossl
- name: .test-non-standard .standalone-noauth-nossl
display_name: Doctests RHEL8
run_on:
- rhel87-small
@ -468,7 +468,7 @@ buildvariants:
# Green framework tests
- name: green-eventlet-rhel8
tasks:
- name: .standard-linux .standalone-noauth-nossl .python-3.9
- name: .test-standard .standalone-noauth-nossl .python-3.9
display_name: Green Eventlet RHEL8
run_on:
- rhel87-small
@ -478,7 +478,7 @@ buildvariants:
SSL: ssl
- name: green-gevent-rhel8
tasks:
- name: .standard-linux .standalone-noauth-nossl
- name: .test-standard .standalone-noauth-nossl
display_name: Green Gevent RHEL8
run_on:
- rhel87-small
@ -511,16 +511,22 @@ buildvariants:
# Load balancer tests
- name: load-balancer
tasks:
- name: .load-balancer
- name: .test-non-standard .server-6.0 .sharded_cluster-auth-ssl
- name: .test-non-standard .server-7.0 .sharded_cluster-auth-ssl
- name: .test-non-standard .server-8.0 .sharded_cluster-auth-ssl
- name: .test-non-standard .server-rapid .sharded_cluster-auth-ssl
- name: .test-non-standard .server-latest .sharded_cluster-auth-ssl
display_name: Load Balancer
run_on:
- rhel87-small
batchtime: 10080
expansions:
TEST_NAME: load_balancer
# Mockupdb tests
- name: mockupdb-rhel8
tasks:
- name: .no-orchestration
- name: .test-no-orchestration
display_name: MockupDB RHEL8
run_on:
- rhel87-small
@ -540,7 +546,7 @@ buildvariants:
# No c ext tests
- name: no-c-ext-rhel8
tasks:
- name: .standard-linux
- name: .test-standard
display_name: No C Ext RHEL8
run_on:
- rhel87-small
@ -548,7 +554,7 @@ buildvariants:
# No server tests
- name: no-server-rhel8
tasks:
- name: .no-orchestration
- name: .test-no-orchestration
display_name: No server RHEL8
run_on:
- rhel87-small
@ -782,12 +788,12 @@ buildvariants:
# Stable api tests
- name: stable-api-require-v1-rhel8-auth
tasks:
- name: .standard-linux !.replica_set-noauth-ssl .server-5.0
- name: .standard-linux !.replica_set-noauth-ssl .server-6.0
- name: .standard-linux !.replica_set-noauth-ssl .server-7.0
- name: .standard-linux !.replica_set-noauth-ssl .server-8.0
- name: .standard-linux !.replica_set-noauth-ssl .server-rapid
- name: .standard-linux !.replica_set-noauth-ssl .server-latest
- name: .test-standard !.replica_set-noauth-ssl .server-5.0
- name: .test-standard !.replica_set-noauth-ssl .server-6.0
- name: .test-standard !.replica_set-noauth-ssl .server-7.0
- name: .test-standard !.replica_set-noauth-ssl .server-8.0
- name: .test-standard !.replica_set-noauth-ssl .server-rapid
- name: .test-standard !.replica_set-noauth-ssl .server-latest
display_name: Stable API require v1 RHEL8 Auth
run_on:
- rhel87-small
@ -798,12 +804,12 @@ buildvariants:
tags: [versionedApi_tag]
- name: stable-api-accept-v2-rhel8-auth
tasks:
- name: .standard-linux .server-5.0 .standalone-noauth-nossl
- name: .standard-linux .server-6.0 .standalone-noauth-nossl
- name: .standard-linux .server-7.0 .standalone-noauth-nossl
- name: .standard-linux .server-8.0 .standalone-noauth-nossl
- name: .standard-linux .server-rapid .standalone-noauth-nossl
- name: .standard-linux .server-latest .standalone-noauth-nossl
- name: .test-standard .server-5.0 .standalone-noauth-nossl
- name: .test-standard .server-6.0 .standalone-noauth-nossl
- name: .test-standard .server-7.0 .standalone-noauth-nossl
- name: .test-standard .server-8.0 .standalone-noauth-nossl
- name: .test-standard .server-rapid .standalone-noauth-nossl
- name: .test-standard .server-latest .standalone-noauth-nossl
display_name: Stable API accept v2 RHEL8 Auth
run_on:
- rhel87-small
@ -815,32 +821,32 @@ buildvariants:
# Standard nonlinux tests
- name: test-macos
tasks:
- name: .standard-non-linux
- name: .test-standard !.pypy
display_name: "* Test macOS"
run_on:
- macos-14
tags: [standard-non-linux]
- name: test-macos-arm64
tasks:
- name: .standard-non-linux .server-6.0
- name: .standard-non-linux .server-7.0
- name: .standard-non-linux .server-8.0
- name: .standard-non-linux .server-rapid
- name: .standard-non-linux .server-latest
- name: .test-standard !.pypy .server-6.0
- name: .test-standard !.pypy .server-7.0
- name: .test-standard !.pypy .server-8.0
- name: .test-standard !.pypy .server-rapid
- name: .test-standard !.pypy .server-latest
display_name: "* Test macOS Arm64"
run_on:
- macos-14-arm64
tags: [standard-non-linux]
- name: test-win64
tasks:
- name: .standard-non-linux
- name: .test-standard !.pypy
display_name: "* Test Win64"
run_on:
- windows-64-vsMulti-small
tags: [standard-non-linux]
- name: test-win32
tasks:
- name: .standard-non-linux
- name: .test-standard !.pypy
display_name: "* Test Win32"
run_on:
- windows-64-vsMulti-small
@ -851,7 +857,7 @@ buildvariants:
# Storage engine tests
- name: storage-inmemory-rhel8
tasks:
- name: .standard-linux .standalone-noauth-nossl
- name: .test-standard .standalone-noauth-nossl
display_name: Storage InMemory RHEL8
run_on:
- rhel87-small
@ -859,7 +865,7 @@ buildvariants:
STORAGE_ENGINE: inmemory
- name: storage-mmapv1-rhel8
tasks:
- name: .standard-linux !.sharded_cluster-auth-ssl .server-4.0
- name: .test-standard !.sharded_cluster-auth-ssl .server-4.0
display_name: Storage MMAPv1 RHEL8
run_on:
- rhel87-small

View File

@ -90,11 +90,11 @@ def create_standard_nonlinux_variants() -> list[BuildVariant]:
# Test a subset on each of the other platforms.
for host_name in ("macos", "macos-arm64", "win64", "win32"):
tasks = [".standard-non-linux"]
tasks = [".test-standard !.pypy"]
# MacOS arm64 only works on server versions 6.0+
if host_name == "macos-arm64":
tasks = [
f".standard-non-linux .server-{version}" for version in get_versions_from("6.0")
f".test-standard !.pypy .server-{version}" for version in get_versions_from("6.0")
]
host = HOSTS[host_name]
tags = ["standard-non-linux"]
@ -203,10 +203,18 @@ def create_encryption_variants() -> list[BuildVariant]:
def create_load_balancer_variants():
# Load balancer tests - run all supported server versions using the lowest supported python.
tasks = [
f".test-non-standard .server-{v} .sharded_cluster-auth-ssl"
for v in get_versions_from("6.0")
]
expansions = dict(TEST_NAME="load_balancer")
return [
create_variant(
[".load-balancer"], "Load Balancer", host=DEFAULT_HOST, batchtime=BATCHTIME_WEEK
tasks,
"Load Balancer",
host=DEFAULT_HOST,
batchtime=BATCHTIME_WEEK,
expansions=expansions,
)
]
@ -218,9 +226,9 @@ def create_compression_variants():
for compressor in "snappy", "zlib", "zstd":
expansions = dict(COMPRESSOR=compressor)
if compressor == "zstd":
tasks = [".standard-linux !.server-4.0"]
tasks = [".test-standard !.server-4.0"]
else:
tasks = [".standard-linux"]
tasks = [".test-standard"]
display_name = get_variant_name(f"Compression {compressor}", host)
variants.append(
create_variant(
@ -296,11 +304,11 @@ def create_storage_engine_variants():
for engine in engines:
expansions = dict(STORAGE_ENGINE=engine.lower())
if engine == engines[0]:
tasks = [".standard-linux .standalone-noauth-nossl"]
tasks = [".test-standard .standalone-noauth-nossl"]
else:
# MongoDB 4.2 drops support for MMAPv1
versions = get_versions_until("4.0")
tasks = [f".standard-linux !.sharded_cluster-auth-ssl .server-{v}" for v in versions]
tasks = [f".test-standard !.sharded_cluster-auth-ssl .server-{v}" for v in versions]
display_name = get_variant_name(f"Storage {engine}", host)
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
variants.append(variant)
@ -324,7 +332,7 @@ def create_stable_api_variants():
# MONGODB_API_VERSION is the apiVersion to use in the test suite.
expansions["MONGODB_API_VERSION"] = "1"
tasks = [
f".standard-linux !.replica_set-noauth-ssl .server-{v}"
f".test-standard !.replica_set-noauth-ssl .server-{v}"
for v in get_versions_from("5.0")
]
else:
@ -333,7 +341,7 @@ def create_stable_api_variants():
# clients created in the test suite.
expansions["ORCHESTRATION_FILE"] = "versioned-api-testing.json"
tasks = [
f".standard-linux .server-{v} .standalone-noauth-nossl"
f".test-standard .server-{v} .standalone-noauth-nossl"
for v in get_versions_from("5.0")
]
base_display_name = f"Stable API {test_type}"
@ -348,11 +356,11 @@ def create_green_framework_variants():
variants = []
host = DEFAULT_HOST
for framework in ["eventlet", "gevent"]:
tasks = [".standard-linux .standalone-noauth-nossl"]
tasks = [".test-standard .standalone-noauth-nossl"]
if framework == "eventlet":
# Eventlet has issues with dnspython > 2.0 and newer versions of CPython
# https://jira.mongodb.org/browse/PYTHON-5284
tasks = [".standard-linux .standalone-noauth-nossl .python-3.9"]
tasks = [".test-standard .standalone-noauth-nossl .python-3.9"]
expansions = dict(GREEN_FRAMEWORK=framework, AUTH="auth", SSL="ssl")
display_name = get_variant_name(f"Green {framework.capitalize()}", host)
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
@ -362,7 +370,7 @@ def create_green_framework_variants():
def create_no_c_ext_variants():
host = DEFAULT_HOST
tasks = [".standard-linux"]
tasks = [".test-standard"]
expansions = dict()
handle_c_ext(C_EXTS[0], expansions)
display_name = get_variant_name("No C Ext", host)
@ -371,7 +379,7 @@ def create_no_c_ext_variants():
def create_atlas_data_lake_variants():
host = HOSTS["ubuntu22"]
tasks = [".no-orchestration"]
tasks = [".test-no-orchestration"]
expansions = dict(TEST_NAME="data_lake")
display_name = get_variant_name("Atlas Data Lake", host)
return [create_variant(tasks, display_name, host=host, expansions=expansions)]
@ -448,7 +456,7 @@ def create_mockupdb_variants():
expansions = dict(TEST_NAME="mockupdb")
return [
create_variant(
[".no-orchestration"],
[".test-no-orchestration"],
get_variant_name("MockupDB", host),
host=host,
expansions=expansions,
@ -461,7 +469,7 @@ def create_doctests_variants():
expansions = dict(TEST_NAME="doctest")
return [
create_variant(
[".standard-linux .standalone-noauth-nossl"],
[".test-non-standard .standalone-noauth-nossl"],
get_variant_name("Doctests", host),
host=host,
expansions=expansions,
@ -473,7 +481,7 @@ def create_atlas_connect_variants():
host = DEFAULT_HOST
return [
create_variant(
[".no-orchestration"],
[".test-no-orchestration"],
get_variant_name("Atlas connect", host),
host=DEFAULT_HOST,
)
@ -532,7 +540,7 @@ def create_aws_auth_variants():
def create_no_server_variants():
host = HOSTS["rhel8"]
name = get_variant_name("No server", host=host)
return [create_variant([".no-orchestration"], name, host=host)]
return [create_variant([".test-no-orchestration"], name, host=host)]
def create_alternative_hosts_variants():
@ -543,7 +551,7 @@ def create_alternative_hosts_variants():
version = "5.0"
variants.append(
create_variant(
[".other-hosts"],
[".test-no-toolchain"],
get_variant_name("OpenSSL 1.0.2", host, python=CPYTHONS[0], version=version),
host=host,
python=CPYTHONS[0],
@ -561,7 +569,7 @@ def create_alternative_hosts_variants():
expansions["REQUIRE_FIPS"] = "1"
variants.append(
create_variant(
[".other-hosts"],
[".test-no-toolchain"],
display_name=get_variant_name("Other hosts", host, version=version),
batchtime=batchtime,
host=host,
@ -583,41 +591,46 @@ def create_aws_lambda_variants():
def create_server_version_tasks():
tasks = []
# Test all pythons with sharded_cluster, auth, and ssl.
task_types = [(p, "sharded_cluster", "auth", "ssl") for p in ALL_PYTHONS]
# Test all combinations of topology, auth, and ssl, with rotating pythons.
for (topology, auth, ssl), python in zip_cycle(
list(product(TOPOLOGIES, ["auth", "noauth"], ["ssl", "nossl"])), ALL_PYTHONS
task_inputs = []
# All combinations of topology, auth, ssl, and sync should be tested.
for (topology, auth, ssl, sync), python in zip_cycle(
list(product(TOPOLOGIES, ["auth", "noauth"], ["ssl", "nossl"], SYNCS)), ALL_PYTHONS
):
# Skip the ones we already have.
if topology == "sharded_cluster" and auth == "auth" and ssl == "ssl":
continue
task_types.append((python, topology, auth, ssl))
for python, topology, auth, ssl in task_types:
tags = ["server-version", f"python-{python}", f"{topology}-{auth}-{ssl}"]
task_inputs.append((topology, auth, ssl, sync, python))
# Every python should be tested with sharded cluster, auth, ssl, with sync and async.
for python, sync in product(ALL_PYTHONS, SYNCS):
task_input = ("sharded_cluster", "auth", "ssl", sync, python)
if task_input not in task_inputs:
task_inputs.append(task_input)
# Assemble the tasks.
for topology, auth, ssl, sync, python in task_inputs:
tags = ["server-version", f"python-{python}", f"{topology}-{auth}-{ssl}", sync]
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology)
if python not in PYPYS:
expansions["COVERAGE"] = "1"
name = get_task_name("test", python=python, **expansions)
name = get_task_name("test-server-version", python=python, sync=sync, **expansions)
server_func = FunctionCall(func="run server", vars=expansions)
test_vars = expansions.copy()
test_vars["PYTHON_VERSION"] = python
test_vars["TEST_NAME"] = f"default_{sync}"
test_func = FunctionCall(func="run tests", vars=test_vars)
tasks.append(EvgTask(name=name, tags=tags, commands=[server_func, test_func]))
return tasks
def create_other_hosts_tasks():
def create_no_toolchain_tasks():
tasks = []
for topology, sync in zip_cycle(TOPOLOGIES, SYNCS):
auth, ssl = get_standard_auth_ssl(topology)
tags = [
"other-hosts",
"test-no-toolchain",
f"{topology}-{auth}-{ssl}",
]
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology)
name = get_task_name("test", sync=sync, **expansions)
name = get_task_name("test-no-toolchain", sync=sync, **expansions)
server_func = FunctionCall(func="run server", vars=expansions)
test_vars = expansions.copy()
test_vars["TEST_NAME"] = f"default_{sync}"
@ -626,21 +639,28 @@ def create_other_hosts_tasks():
return tasks
def create_standard_linux_tasks():
def create_test_non_standard_tasks():
"""For variants that set a TEST_NAME."""
tasks = []
for (version, topology), python in zip_cycle(
list(product(ALL_VERSIONS, TOPOLOGIES)), ALL_PYTHONS
):
task_combos = []
# For each version and topology, rotate through the CPythons.
for (version, topology), python in zip_cycle(list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS):
task_combos.append((version, topology, python))
# For each PyPy and topology, rotate through the the versions.
for (python, topology), version in zip_cycle(list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS):
task_combos.append((version, topology, python))
for version, topology, python in task_combos:
auth, ssl = get_standard_auth_ssl(topology)
tags = [
"standard-linux",
"test-non-standard",
f"server-{version}",
f"python-{python}",
f"{topology}-{auth}-{ssl}",
]
if python in PYPYS:
tags.append("pypy")
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
name = get_task_name("test", python=python, **expansions)
name = get_task_name("test-non-standard", python=python, **expansions)
server_func = FunctionCall(func="run server", vars=expansions)
test_vars = expansions.copy()
test_vars["PYTHON_VERSION"] = python
@ -649,22 +669,34 @@ def create_standard_linux_tasks():
return tasks
def create_standard_non_linux_tasks():
def create_standard_tasks():
"""For variants that do not set a TEST_NAME."""
tasks = []
task_combos = []
# For each version and topology, rotate through the CPythons and sync/async.
for (version, topology), python, sync in zip_cycle(
list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS, SYNCS
):
task_combos.append((version, topology, python, sync))
# For each PyPy and topology, rotate through the the versions and sync/async.
for (python, topology), version, sync in zip_cycle(
list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS, SYNCS
):
task_combos.append((version, topology, python, sync))
for version, topology, python, sync in task_combos:
auth, ssl = get_standard_auth_ssl(topology)
tags = [
"standard-non-linux",
"test-standard",
f"server-{version}",
f"python-{python}",
f"{topology}-{auth}-{ssl}",
sync,
]
if python in PYPYS:
tags.append("pypy")
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
name = get_task_name("test", python=python, sync=sync, **expansions)
name = get_task_name("test-standard", python=python, sync=sync, **expansions)
server_func = FunctionCall(func="run server", vars=expansions)
test_vars = expansions.copy()
test_vars["PYTHON_VERSION"] = python
@ -702,7 +734,7 @@ def create_no_orchestration_tasks():
tasks = []
for python in [*MIN_MAX_PYTHON, PYPYS[-1]]:
tags = [
"no-orchestration",
"test-no-orchestration",
f"python-{python}",
]
name = get_task_name("test-no-orchestration", python=python)
@ -714,26 +746,6 @@ def create_no_orchestration_tasks():
return tasks
def create_load_balancer_tasks():
tasks = []
for (auth, ssl), version in product(AUTH_SSLS, get_versions_from("6.0")):
name = get_task_name(f"test-load-balancer-{auth}-{ssl}", version=version)
tags = ["load-balancer", auth, ssl]
server_vars = dict(
TOPOLOGY="sharded_cluster",
AUTH=auth,
SSL=ssl,
TEST_NAME="load_balancer",
VERSION=version,
)
server_func = FunctionCall(func="run server", vars=server_vars)
test_vars = dict(AUTH=auth, SSL=ssl, TEST_NAME="load_balancer")
test_func = FunctionCall(func="run tests", vars=test_vars)
tasks.append(EvgTask(name=name, tags=tags, commands=[server_func, test_func]))
return tasks
def create_kms_tasks():
tasks = []
for kms_type in ["gcp", "azure"]: