Skip to content

Commit 41c0ff9

Browse files
committed
PYTHON-5372 Convert Remaining Variants to Use Common Tasks
1 parent 000391c commit 41c0ff9

File tree

3 files changed

+38
-177
lines changed

3 files changed

+38
-177
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -136,50 +136,6 @@ tasks:
136136
depends_on: [{ name: .server-version, variant: .coverage_tag, status: "*", patch_optional: true }]
137137
tags: [coverage]
138138

139-
# Enterprise auth tests
140-
- name: test-enterprise-auth-python3.9
141-
commands:
142-
- func: run server
143-
vars:
144-
TEST_NAME: enterprise_auth
145-
AUTH: auth
146-
PYTHON_VERSION: "3.9"
147-
- func: assume ec2 role
148-
- func: run tests
149-
vars:
150-
TEST_NAME: enterprise_auth
151-
AUTH: auth
152-
PYTHON_VERSION: "3.9"
153-
tags: [enterprise_auth]
154-
- name: test-enterprise-auth-python3.13
155-
commands:
156-
- func: run server
157-
vars:
158-
TEST_NAME: enterprise_auth
159-
AUTH: auth
160-
PYTHON_VERSION: "3.13"
161-
- func: assume ec2 role
162-
- func: run tests
163-
vars:
164-
TEST_NAME: enterprise_auth
165-
AUTH: auth
166-
PYTHON_VERSION: "3.13"
167-
tags: [enterprise_auth]
168-
- name: test-enterprise-auth-pypy3.10
169-
commands:
170-
- func: run server
171-
vars:
172-
TEST_NAME: enterprise_auth
173-
AUTH: auth
174-
PYTHON_VERSION: pypy3.10
175-
- func: assume ec2 role
176-
- func: run tests
177-
vars:
178-
TEST_NAME: enterprise_auth
179-
AUTH: auth
180-
PYTHON_VERSION: pypy3.10
181-
tags: [enterprise_auth, pypy]
182-
183139
# Free threading tests
184140
- name: test-free-threading
185141
commands:
@@ -243,68 +199,6 @@ tasks:
243199
TEST_NAME: kms
244200
SUB_TEST_NAME: azure-fail
245201

246-
# Mod wsgi tests
247-
- name: mod-wsgi-replica-set-python3.9
248-
commands:
249-
- func: run server
250-
vars:
251-
TOPOLOGY: replica_set
252-
PYTHON_VERSION: "3.9"
253-
- func: run tests
254-
vars:
255-
TEST_NAME: mod_wsgi
256-
SUB_TEST_NAME: standalone
257-
PYTHON_VERSION: "3.9"
258-
tags: [mod_wsgi]
259-
- name: mod-wsgi-embedded-mode-replica-set-python3.10
260-
commands:
261-
- func: run server
262-
vars:
263-
TOPOLOGY: replica_set
264-
PYTHON_VERSION: "3.10"
265-
- func: run tests
266-
vars:
267-
TEST_NAME: mod_wsgi
268-
SUB_TEST_NAME: embedded
269-
PYTHON_VERSION: "3.10"
270-
tags: [mod_wsgi]
271-
- name: mod-wsgi-replica-set-python3.11
272-
commands:
273-
- func: run server
274-
vars:
275-
TOPOLOGY: replica_set
276-
PYTHON_VERSION: "3.11"
277-
- func: run tests
278-
vars:
279-
TEST_NAME: mod_wsgi
280-
SUB_TEST_NAME: standalone
281-
PYTHON_VERSION: "3.11"
282-
tags: [mod_wsgi]
283-
- name: mod-wsgi-embedded-mode-replica-set-python3.12
284-
commands:
285-
- func: run server
286-
vars:
287-
TOPOLOGY: replica_set
288-
PYTHON_VERSION: "3.12"
289-
- func: run tests
290-
vars:
291-
TEST_NAME: mod_wsgi
292-
SUB_TEST_NAME: embedded
293-
PYTHON_VERSION: "3.12"
294-
tags: [mod_wsgi]
295-
- name: mod-wsgi-replica-set-python3.13
296-
commands:
297-
- func: run server
298-
vars:
299-
TOPOLOGY: replica_set
300-
PYTHON_VERSION: "3.13"
301-
- func: run tests
302-
vars:
303-
TEST_NAME: mod_wsgi
304-
SUB_TEST_NAME: standalone
305-
PYTHON_VERSION: "3.13"
306-
tags: [mod_wsgi]
307-
308202
# No orchestration tests
309203
- name: test-no-orchestration-python3.9
310204
commands:

.evergreen/generated_configs/variants.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -251,24 +251,6 @@ buildvariants:
251251
tags: [encryption_tag]
252252

253253
# Enterprise auth tests
254-
- name: auth-enterprise-macos
255-
tasks:
256-
- name: .enterprise_auth !.pypy
257-
display_name: Auth Enterprise macOS
258-
run_on:
259-
- macos-14
260-
- name: auth-enterprise-win64
261-
tasks:
262-
- name: .enterprise_auth !.pypy
263-
display_name: Auth Enterprise Win64
264-
run_on:
265-
- windows-64-vsMulti-small
266-
- name: auth-enterprise-rhel8
267-
tasks:
268-
- name: .enterprise_auth
269-
display_name: Auth Enterprise RHEL8
270-
run_on:
271-
- rhel87-small
272254

273255
# Free threaded tests
274256
- name: free-threaded-rhel8-python3.13t
@@ -365,14 +347,28 @@ buildvariants:
365347
TEST_NAME: mockupdb
366348

367349
# Mod wsgi tests
368-
- name: mod_wsgi-ubuntu-22
350+
- name: mod_wsgi-standalone-ubuntu-22
351+
tasks:
352+
- name: .test-non-standard .replica_set
353+
- name: .test-non-standard .standalone
354+
display_name: mod_wsgi standalone Ubuntu-22
355+
run_on:
356+
- ubuntu2204-small
357+
expansions:
358+
MOD_WSGI_VERSION: "4"
359+
TEST_NAME: mode_wsgi
360+
SUB_TEST_NAME: standalone
361+
- name: mod_wsgi-embedded-mode-ubuntu-22
369362
tasks:
370-
- name: .mod_wsgi
371-
display_name: mod_wsgi Ubuntu-22
363+
- name: .test-non-standard .replica_set
364+
- name: .test-non-standard .standalone
365+
display_name: mod_wsgi embedded-mode Ubuntu-22
372366
run_on:
373367
- ubuntu2204-small
374368
expansions:
375369
MOD_WSGI_VERSION: "4"
370+
TEST_NAME: mode_wsgi
371+
SUB_TEST_NAME: embedded
376372

377373
# No c ext tests
378374
- name: no-c-ext-rhel8

.evergreen/scripts/generate_config.py

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,15 @@ def create_compression_variants():
211211

212212
def create_enterprise_auth_variants():
213213
variants = []
214-
for host in [HOSTS["macos"], HOSTS["win64"], DEFAULT_HOST]:
214+
for host in ["rhel8", "macos", "win64"]:
215+
expansions = dict(TEST_NAME="enterprise_auth", AUTH="auth")
215216
display_name = get_variant_name("Auth Enterprise", host)
216-
if host == DEFAULT_HOST:
217-
tags = [".enterprise_auth"]
218-
else:
219-
tags = [".enterprise_auth !.pypy"]
220-
variant = create_variant(tags, display_name, host=host)
217+
tasks = [".test-non-standard"]
218+
if host != "rhel8":
219+
tasks = [".test-non-standard !.pypy"]
220+
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
221221
variants.append(variant)
222222

223-
return variants
224-
225223

226224
def create_pyopenssl_variants():
227225
base_name = "PyOpenSSL"
@@ -336,10 +334,21 @@ def create_atlas_data_lake_variants():
336334

337335
def create_mod_wsgi_variants():
338336
host = HOSTS["ubuntu22"]
339-
tasks = [".mod_wsgi"]
340-
expansions = dict(MOD_WSGI_VERSION="4")
341-
display_name = get_variant_name("mod_wsgi", host)
342-
return [create_variant(tasks, display_name, host=host, expansions=expansions)]
337+
variants = []
338+
for test_type in ["standalone", "embedded-mode"]:
339+
expansions = dict(
340+
MOD_WSGI_VERSION="4", TEST_NAME="mode_wsgi", SUB_TEST_NAME=test_type.split("-")[0]
341+
)
342+
display_name = get_variant_name(f"mod_wsgi {test_type}", host)
343+
variants.append(
344+
create_variant(
345+
[".test-non-standard .replica_set", ".test-non-standard .standalone"],
346+
display_name,
347+
host=host,
348+
expansions=expansions,
349+
)
350+
)
351+
return variants
343352

344353

345354
def create_disable_test_commands_variants():
@@ -743,27 +752,6 @@ def create_oidc_tasks():
743752
return tasks
744753

745754

746-
def create_mod_wsgi_tasks():
747-
tasks = []
748-
for (test, topology), python in zip_cycle(
749-
product(["standalone", "embedded-mode"], ["standalone", "replica_set"]), CPYTHONS
750-
):
751-
if test == "standalone":
752-
task_name = "mod-wsgi-"
753-
else:
754-
task_name = "mod-wsgi-embedded-mode-"
755-
task_name += topology.replace("_", "-")
756-
task_name = get_task_name(task_name, python=python)
757-
server_vars = dict(TOPOLOGY=topology, PYTHON_VERSION=python)
758-
server_func = FunctionCall(func="run server", vars=server_vars)
759-
vars = dict(TEST_NAME="mod_wsgi", SUB_TEST_NAME=test.split("-")[0], PYTHON_VERSION=python)
760-
test_func = FunctionCall(func="run tests", vars=vars)
761-
tags = ["mod_wsgi"]
762-
commands = [server_func, test_func]
763-
tasks.append(EvgTask(name=task_name, tags=tags, commands=commands))
764-
return tasks
765-
766-
767755
def _create_ocsp_tasks(algo, variant, server_type, base_task_name):
768756
tasks = []
769757
file_name = f"{algo}-basic-tls-ocsp-{variant}.json"
@@ -815,23 +803,6 @@ def create_search_index_tasks():
815803
return [EvgTask(name=task_name, tags=tags, commands=commands)]
816804

817805

818-
def create_enterprise_auth_tasks():
819-
tasks = []
820-
for python in [*MIN_MAX_PYTHON, PYPYS[-1]]:
821-
vars = dict(TEST_NAME="enterprise_auth", AUTH="auth", PYTHON_VERSION=python)
822-
server_func = FunctionCall(func="run server", vars=vars)
823-
assume_func = FunctionCall(func="assume ec2 role")
824-
test_func = FunctionCall(func="run tests", vars=vars)
825-
task_name = get_task_name("test-enterprise-auth", python=python)
826-
tags = ["enterprise_auth"]
827-
if python in PYPYS:
828-
tags += ["pypy"]
829-
tasks.append(
830-
EvgTask(name=task_name, tags=tags, commands=[server_func, assume_func, test_func])
831-
)
832-
return tasks
833-
834-
835806
def create_perf_tasks():
836807
tasks = []
837808
for version, ssl, sync in product(["8.0"], ["ssl", "nossl"], ["sync", "async"]):

0 commit comments

Comments
 (0)