23
23
CPYTHONS = ["3.9" , "3.10" , "3.11" , "3.12" , "3.13" ]
24
24
PYPYS = ["pypy3.9" , "pypy3.10" ]
25
25
ALL_PYTHONS = CPYTHONS + PYPYS
26
- ALL_WIN_PYTHONS = CPYTHONS .copy ()
27
- ALL_WIN_PYTHONS = ALL_WIN_PYTHONS + [f"32-bit { p } " for p in ALL_WIN_PYTHONS ]
28
- AUTHS = ["noauth" , "auth" ]
29
- SSLS = ["nossl" , "ssl" ]
30
- AUTH_SSLS = list (product (AUTHS , SSLS ))
31
- TOPOLOGIES = ["standalone" , "replica_set" , "sharded_cluster" ]
32
- C_EXTS = ["without c extensions" , "with c extensions" ]
33
26
BATCHTIME_WEEK = 10080
34
27
HOSTS = dict ()
35
28
@@ -55,6 +48,7 @@ def create_variant(
55
48
host : str | None = None ,
56
49
** kwargs : Any ,
57
50
) -> BuildVariant :
51
+ """Create a build variant for the given inputs."""
58
52
task_refs = [EvgTaskRef (name = n ) for n in task_names ]
59
53
kwargs .setdefault ("expansions" , dict ())
60
54
expansions = kwargs .pop ("expansions" )
@@ -75,6 +69,7 @@ def create_variant(
75
69
76
70
77
71
def get_python_binary (python : str , host : str ) -> str :
72
+ """Get the appropriate python binary given a python version and host"""
78
73
if host == "win64" :
79
74
is_32 = python .startswith ("32-bit" )
80
75
if is_32 :
@@ -94,7 +89,8 @@ def get_python_binary(python: str, host: str) -> str:
94
89
raise ValueError (f"no match found for python { python } on { host } " )
95
90
96
91
97
- def get_display (base : str , host : str , version : str , python : str ) -> str :
92
+ def get_display_name (base : str , host : str , version : str , python : str ) -> str :
93
+ """Get the display name of a variant."""
98
94
if version not in ["rapid" , "latest" ]:
99
95
version = f"v{ version } "
100
96
if not python .startswith ("pypy" ):
@@ -103,12 +99,18 @@ def get_display(base: str, host: str, version: str, python: str) -> str:
103
99
104
100
105
101
def get_pairs (versions : list [str ], pythons : list [str ]) -> str :
102
+ """Get pairs of versions and pythons, ensuring that we hit all of each.
103
+ The shorter list will repeat until the full length of the longer list.
104
+ """
106
105
values = []
106
+ i = 0
107
107
for version , python in zip_longest (versions , pythons ):
108
108
if version is None :
109
- values .append ((versions [0 ], python ))
109
+ values .append ((versions [i % len (versions )], python ))
110
+ i += 1
110
111
elif python is None :
111
- values .append ((version , pythons [0 ]))
112
+ values .append ((version , pythons [i % len (pythons )]))
113
+ i += 1
112
114
else :
113
115
values .append ((version , python ))
114
116
return values
@@ -137,7 +139,7 @@ def create_ocsp_variants() -> list[BuildVariant]:
137
139
host = "rhel8"
138
140
variant = create_variant (
139
141
[".ocsp" ],
140
- get_display (base_display , host , version , python ),
142
+ get_display_name (base_display , host , version , python ),
141
143
python = python ,
142
144
batchtime = batchtime ,
143
145
host = host ,
@@ -146,18 +148,17 @@ def create_ocsp_variants() -> list[BuildVariant]:
146
148
variants .append (variant )
147
149
148
150
# OCSP tests on Windows and MacOS.
151
+ # MongoDB servers on these hosts do not staple OCSP responses and only support RSA.
149
152
for host , version in product (["win64" , "macos" ], ["4.4" , "8.0" ]):
150
- # MongoDB servers do not staple OCSP responses and only support RSA.
151
- task_names = [".ocsp-rsa !.ocsp-staple" ]
152
153
expansions = base_expansions .copy ()
153
154
expansions ["VERSION" ] = version
154
155
if version == "4.4" :
155
156
python = CPYTHONS [0 ]
156
157
else :
157
158
python = CPYTHONS [- 1 ]
158
159
variant = create_variant (
159
- task_names ,
160
- get_display (base_display , host , version , python ),
160
+ [ ".ocsp-rsa !.ocsp-staple" ] ,
161
+ get_display_name (base_display , host , version , python ),
161
162
python = python ,
162
163
host = host ,
163
164
expansions = expansions ,
0 commit comments