Skip to content

Commit 0f37bfd

Browse files
authored
PYTHON-5331 Convert stable api and storage tests to new task pattern (#2295)
1 parent 5f95621 commit 0f37bfd

File tree

3 files changed

+35
-84
lines changed

3 files changed

+35
-84
lines changed

.evergreen/generated_configs/functions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ functions:
143143
- NO_EXT
144144
- COMPRESSORS
145145
- MONGODB_API_VERSION
146+
- REQUIRE_API_VERSION
146147
- DEBUG_LOG
147148
- ORCHESTRATION_FILE
148149
- OCSP_SERVER_TYPE

.evergreen/generated_configs/variants.yml

+22-68
Original file line numberDiff line numberDiff line change
@@ -792,71 +792,36 @@ buildvariants:
792792
PYTHON_BINARY: /opt/python/3.13/bin/python3
793793

794794
# Stable api tests
795-
- name: stable-api-require-v1-rhel8-python3.9-auth
795+
- name: stable-api-require-v1-rhel8-auth
796796
tasks:
797-
- name: "!.replica_set .5.0 .noauth .nossl .sync_async"
798-
- name: "!.replica_set .6.0 .noauth .nossl .sync_async"
799-
- name: "!.replica_set .7.0 .noauth .nossl .sync_async"
800-
- name: "!.replica_set .8.0 .noauth .nossl .sync_async"
801-
- name: "!.replica_set .rapid .noauth .nossl .sync_async"
802-
- name: "!.replica_set .latest .noauth .nossl .sync_async"
803-
display_name: Stable API require v1 RHEL8 Python3.9 Auth
797+
- name: .standard-linux !.replica_set-noauth-ssl .server-5.0
798+
- name: .standard-linux !.replica_set-noauth-ssl .server-6.0
799+
- name: .standard-linux !.replica_set-noauth-ssl .server-7.0
800+
- name: .standard-linux !.replica_set-noauth-ssl .server-8.0
801+
- name: .standard-linux !.replica_set-noauth-ssl .server-rapid
802+
- name: .standard-linux !.replica_set-noauth-ssl .server-latest
803+
display_name: Stable API require v1 RHEL8 Auth
804804
run_on:
805805
- rhel87-small
806806
expansions:
807807
AUTH: auth
808808
REQUIRE_API_VERSION: "1"
809809
MONGODB_API_VERSION: "1"
810-
PYTHON_BINARY: /opt/python/3.9/bin/python3
811-
tags: [versionedApi_tag]
812-
- name: stable-api-accept-v2-rhel8-python3.9-auth
813-
tasks:
814-
- name: .standalone .5.0 .noauth .nossl .sync_async
815-
- name: .standalone .6.0 .noauth .nossl .sync_async
816-
- name: .standalone .7.0 .noauth .nossl .sync_async
817-
- name: .standalone .8.0 .noauth .nossl .sync_async
818-
- name: .standalone .rapid .noauth .nossl .sync_async
819-
- name: .standalone .latest .noauth .nossl .sync_async
820-
display_name: Stable API accept v2 RHEL8 Python3.9 Auth
821-
run_on:
822-
- rhel87-small
823-
expansions:
824-
AUTH: auth
825-
ORCHESTRATION_FILE: versioned-api-testing.json
826-
PYTHON_BINARY: /opt/python/3.9/bin/python3
827-
tags: [versionedApi_tag]
828-
- name: stable-api-require-v1-rhel8-python3.13-auth
829-
tasks:
830-
- name: "!.replica_set .5.0 .noauth .nossl .sync_async"
831-
- name: "!.replica_set .6.0 .noauth .nossl .sync_async"
832-
- name: "!.replica_set .7.0 .noauth .nossl .sync_async"
833-
- name: "!.replica_set .8.0 .noauth .nossl .sync_async"
834-
- name: "!.replica_set .rapid .noauth .nossl .sync_async"
835-
- name: "!.replica_set .latest .noauth .nossl .sync_async"
836-
display_name: Stable API require v1 RHEL8 Python3.13 Auth
837-
run_on:
838-
- rhel87-small
839-
expansions:
840-
AUTH: auth
841-
REQUIRE_API_VERSION: "1"
842-
MONGODB_API_VERSION: "1"
843-
PYTHON_BINARY: /opt/python/3.13/bin/python3
844810
tags: [versionedApi_tag]
845-
- name: stable-api-accept-v2-rhel8-python3.13-auth
811+
- name: stable-api-accept-v2-rhel8-auth
846812
tasks:
847-
- name: .standalone .5.0 .noauth .nossl .sync_async
848-
- name: .standalone .6.0 .noauth .nossl .sync_async
849-
- name: .standalone .7.0 .noauth .nossl .sync_async
850-
- name: .standalone .8.0 .noauth .nossl .sync_async
851-
- name: .standalone .rapid .noauth .nossl .sync_async
852-
- name: .standalone .latest .noauth .nossl .sync_async
853-
display_name: Stable API accept v2 RHEL8 Python3.13 Auth
813+
- name: .standard-linux .server-5.0 .standalone-noauth-nossl
814+
- name: .standard-linux .server-6.0 .standalone-noauth-nossl
815+
- name: .standard-linux .server-7.0 .standalone-noauth-nossl
816+
- name: .standard-linux .server-8.0 .standalone-noauth-nossl
817+
- name: .standard-linux .server-rapid .standalone-noauth-nossl
818+
- name: .standard-linux .server-latest .standalone-noauth-nossl
819+
display_name: Stable API accept v2 RHEL8 Auth
854820
run_on:
855821
- rhel87-small
856822
expansions:
857823
AUTH: auth
858824
ORCHESTRATION_FILE: versioned-api-testing.json
859-
PYTHON_BINARY: /opt/python/3.13/bin/python3
860825
tags: [versionedApi_tag]
861826

862827
# Standard nonlinux tests
@@ -896,30 +861,19 @@ buildvariants:
896861
tags: [standard-non-linux]
897862

898863
# Storage engine tests
899-
- name: storage-inmemory-rhel8-python3.9
864+
- name: storage-inmemory-rhel8
900865
tasks:
901-
- name: .standalone .noauth .nossl .4.0 .sync_async
902-
- name: .standalone .noauth .nossl .4.2 .sync_async
903-
- name: .standalone .noauth .nossl .4.4 .sync_async
904-
- name: .standalone .noauth .nossl .5.0 .sync_async
905-
- name: .standalone .noauth .nossl .6.0 .sync_async
906-
- name: .standalone .noauth .nossl .7.0 .sync_async
907-
- name: .standalone .noauth .nossl .8.0 .sync_async
908-
- name: .standalone .noauth .nossl .rapid .sync_async
909-
- name: .standalone .noauth .nossl .latest .sync_async
910-
display_name: Storage InMemory RHEL8 Python3.9
866+
- name: .standard-linux .standalone-noauth-nossl
867+
display_name: Storage InMemory RHEL8
911868
run_on:
912869
- rhel87-small
913870
expansions:
914871
STORAGE_ENGINE: inmemory
915-
PYTHON_BINARY: /opt/python/3.9/bin/python3
916-
- name: storage-mmapv1-rhel8-python3.9
872+
- name: storage-mmapv1-rhel8
917873
tasks:
918-
- name: .standalone .4.0 .noauth .nossl .sync_async
919-
- name: .replica_set .4.0 .noauth .nossl .sync_async
920-
display_name: Storage MMAPv1 RHEL8 Python3.9
874+
- name: .standard-linux !.sharded_cluster-auth-ssl .server-4.0
875+
display_name: Storage MMAPv1 RHEL8
921876
run_on:
922877
- rhel87-small
923878
expansions:
924879
STORAGE_ENGINE: mmapv1
925-
PYTHON_BINARY: /opt/python/3.9/bin/python3

.evergreen/scripts/generate_config.py

+12-16
Original file line numberDiff line numberDiff line change
@@ -283,20 +283,15 @@ def create_storage_engine_variants():
283283
engines = ["InMemory", "MMAPv1"]
284284
variants = []
285285
for engine in engines:
286-
python = CPYTHONS[0]
287286
expansions = dict(STORAGE_ENGINE=engine.lower())
288287
if engine == engines[0]:
289-
tasks = [f".standalone .noauth .nossl .{v} .sync_async" for v in ALL_VERSIONS]
288+
tasks = [".standard-linux .standalone-noauth-nossl"]
290289
else:
291290
# MongoDB 4.2 drops support for MMAPv1
292291
versions = get_versions_until("4.0")
293-
tasks = [f".standalone .{v} .noauth .nossl .sync_async" for v in versions] + [
294-
f".replica_set .{v} .noauth .nossl .sync_async" for v in versions
295-
]
296-
display_name = get_variant_name(f"Storage {engine}", host, python=python)
297-
variant = create_variant(
298-
tasks, display_name, host=host, python=python, expansions=expansions
299-
)
292+
tasks = [f".standard-linux !.sharded_cluster-auth-ssl .server-{v}" for v in versions]
293+
display_name = get_variant_name(f"Storage {engine}", host)
294+
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
300295
variants.append(variant)
301296
return variants
302297

@@ -308,7 +303,7 @@ def create_stable_api_variants():
308303
types = ["require v1", "accept v2"]
309304

310305
# All python versions across platforms.
311-
for python, test_type in product(MIN_MAX_PYTHON, types):
306+
for test_type in types:
312307
expansions = dict(AUTH="auth")
313308
# Test against a cluster with requireApiVersion=1.
314309
if test_type == types[0]:
@@ -318,21 +313,21 @@ def create_stable_api_variants():
318313
# MONGODB_API_VERSION is the apiVersion to use in the test suite.
319314
expansions["MONGODB_API_VERSION"] = "1"
320315
tasks = [
321-
f"!.replica_set .{v} .noauth .nossl .sync_async" for v in get_versions_from("5.0")
316+
f".standard-linux !.replica_set-noauth-ssl .server-{v}"
317+
for v in get_versions_from("5.0")
322318
]
323319
else:
324320
# Test against a cluster with acceptApiVersion2 but without
325321
# requireApiVersion, and don't automatically add apiVersion to
326322
# clients created in the test suite.
327323
expansions["ORCHESTRATION_FILE"] = "versioned-api-testing.json"
328324
tasks = [
329-
f".standalone .{v} .noauth .nossl .sync_async" for v in get_versions_from("5.0")
325+
f".standard-linux .server-{v} .standalone-noauth-nossl"
326+
for v in get_versions_from("5.0")
330327
]
331328
base_display_name = f"Stable API {test_type}"
332-
display_name = get_variant_name(base_display_name, host, python=python, **expansions)
333-
variant = create_variant(
334-
tasks, display_name, host=host, python=python, tags=tags, expansions=expansions
335-
)
329+
display_name = get_variant_name(base_display_name, host, **expansions)
330+
variant = create_variant(tasks, display_name, host=host, tags=tags, expansions=expansions)
336331
variants.append(variant)
337332

338333
return variants
@@ -1164,6 +1159,7 @@ def create_run_tests_func():
11641159
"NO_EXT",
11651160
"COMPRESSORS",
11661161
"MONGODB_API_VERSION",
1162+
"REQUIRE_API_VERSION",
11671163
"DEBUG_LOG",
11681164
"ORCHESTRATION_FILE",
11691165
"OCSP_SERVER_TYPE",

0 commit comments

Comments
 (0)