@@ -111,14 +111,24 @@ def get_python_binary(python: str, host: str) -> str:
111
111
raise ValueError (f"no match found for python { python } on { host } " )
112
112
113
113
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."""
116
116
min_version_float = float (min_version )
117
117
rapid_latest = ["rapid" , "latest" ]
118
118
versions = [v for v in ALL_VERSIONS if v not in rapid_latest ]
119
119
return [v for v in versions if float (v ) >= min_version_float ] + rapid_latest
120
120
121
121
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
+
122
132
def get_display_name (base : str , host : str , ** kwargs ) -> str :
123
133
"""Get the display name of a variant."""
124
134
display_name = f"{ base } { HOSTS [host ].display_name } "
@@ -250,7 +260,7 @@ def create_server_variants() -> list[BuildVariant]:
250
260
tasks = [f".{ topology } " ]
251
261
# MacOS arm64 only works on server versions 6.0+
252
262
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" )]
254
264
expansions = dict (AUTH = auth , SSL = ssl , TEST_SUITES = test_suite , SKIP_CSOT_TESTS = "true" )
255
265
display_name = get_display_name ("Test" , host , python = python , ** expansions )
256
266
variant = create_variant (
@@ -337,7 +347,7 @@ def create_load_balancer_variants():
337
347
task_names = ["load-balancer-test" ]
338
348
batchtime = BATCHTIME_WEEK
339
349
expansions_base = dict (test_loadbalancer = "true" )
340
- versions = get_pythons_from ("6.0" )
350
+ versions = get_versions_from ("6.0" )
341
351
variants = []
342
352
pythons = CPYTHONS + PYPYS
343
353
for ind , (version , (auth , ssl )) in enumerate (product (versions , AUTH_SSLS )):
@@ -449,10 +459,33 @@ def create_pyopenssl_variants():
449
459
return variants
450
460
451
461
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
+
452
485
def create_versioned_api_tests ():
453
486
host = "rhel8"
454
487
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" )]
456
489
variants = []
457
490
types = ["require v1" , "accept v2" ]
458
491
0 commit comments