Skip to content

Commit d0b0dc3

Browse files
authored
PYTHON-5339 Clean up GitHub PR definitions in Evergreen Project (#2331)
1 parent 12b4fe3 commit d0b0dc3

File tree

2 files changed

+44
-15
lines changed

2 files changed

+44
-15
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ tasks:
134134
commands:
135135
- func: download and merge coverage
136136
depends_on: [{ name: .server-version, variant: .coverage_tag, status: "*", patch_optional: true }]
137-
tags: [coverage]
137+
tags: [coverage, pr]
138138

139139
# Free threading tests
140140
- name: test-free-threading
@@ -211,7 +211,7 @@ tasks:
211211
TEST_NAME: mod_wsgi
212212
SUB_TEST_NAME: standalone
213213
PYTHON_VERSION: "3.9"
214-
tags: [mod_wsgi]
214+
tags: [mod_wsgi, pr]
215215
- name: mod-wsgi-embedded-mode-replica-set-python3.10
216216
commands:
217217
- func: run server
@@ -223,7 +223,7 @@ tasks:
223223
TEST_NAME: mod_wsgi
224224
SUB_TEST_NAME: embedded
225225
PYTHON_VERSION: "3.10"
226-
tags: [mod_wsgi]
226+
tags: [mod_wsgi, pr]
227227
- name: mod-wsgi-replica-set-python3.11
228228
commands:
229229
- func: run server
@@ -235,7 +235,7 @@ tasks:
235235
TEST_NAME: mod_wsgi
236236
SUB_TEST_NAME: standalone
237237
PYTHON_VERSION: "3.11"
238-
tags: [mod_wsgi]
238+
tags: [mod_wsgi, pr]
239239
- name: mod-wsgi-embedded-mode-replica-set-python3.12
240240
commands:
241241
- func: run server
@@ -247,7 +247,7 @@ tasks:
247247
TEST_NAME: mod_wsgi
248248
SUB_TEST_NAME: embedded
249249
PYTHON_VERSION: "3.12"
250-
tags: [mod_wsgi]
250+
tags: [mod_wsgi, pr]
251251
- name: mod-wsgi-replica-set-python3.13
252252
commands:
253253
- func: run server
@@ -259,7 +259,7 @@ tasks:
259259
TEST_NAME: mod_wsgi
260260
SUB_TEST_NAME: standalone
261261
PYTHON_VERSION: "3.13"
262-
tags: [mod_wsgi]
262+
tags: [mod_wsgi, pr]
263263

264264
# No orchestration tests
265265
- name: test-no-orchestration-python3.9
@@ -2490,6 +2490,7 @@ tasks:
24902490
- python-3.9
24912491
- standalone-noauth-nossl
24922492
- sync
2493+
- pr
24932494
- name: test-server-version-python3.10-async-noauth-nossl-standalone-cov
24942495
commands:
24952496
- func: run server
@@ -2511,6 +2512,7 @@ tasks:
25112512
- python-3.10
25122513
- standalone-noauth-nossl
25132514
- async
2515+
- pr
25142516
- name: test-server-version-python3.11-sync-auth-ssl-replica-set-cov
25152517
commands:
25162518
- func: run server
@@ -2656,6 +2658,7 @@ tasks:
26562658
- python-3.11
26572659
- replica_set-noauth-nossl
26582660
- sync
2661+
- pr
26592662
- name: test-server-version-python3.12-async-noauth-nossl-replica-set-cov
26602663
commands:
26612664
- func: run server
@@ -2677,6 +2680,7 @@ tasks:
26772680
- python-3.12
26782681
- replica_set-noauth-nossl
26792682
- async
2683+
- pr
26802684
- name: test-server-version-python3.13-sync-auth-ssl-sharded-cluster-cov
26812685
commands:
26822686
- func: run server
@@ -2698,6 +2702,7 @@ tasks:
26982702
- python-3.13
26992703
- sharded_cluster-auth-ssl
27002704
- sync
2705+
- pr
27012706
- name: test-server-version-pypy3.10-async-auth-ssl-sharded-cluster
27022707
commands:
27032708
- func: run server
@@ -2717,6 +2722,7 @@ tasks:
27172722
- python-pypy3.10
27182723
- sharded_cluster-auth-ssl
27192724
- async
2725+
- pr
27202726
- name: test-server-version-python3.9-sync-auth-nossl-sharded-cluster-cov
27212727
commands:
27222728
- func: run server
@@ -3611,6 +3617,7 @@ tasks:
36113617
- python-3.13
36123618
- standalone-noauth-nossl
36133619
- sync
3620+
- pr
36143621
- name: test-standard-latest-python3.9-async-noauth-ssl-replica-set
36153622
commands:
36163623
- func: run server
@@ -3633,6 +3640,7 @@ tasks:
36333640
- python-3.9
36343641
- replica_set-noauth-ssl
36353642
- async
3643+
- pr
36363644
- name: test-standard-latest-python3.10-sync-auth-ssl-sharded-cluster
36373645
commands:
36383646
- func: run server
@@ -3655,6 +3663,7 @@ tasks:
36553663
- python-3.10
36563664
- sharded_cluster-auth-ssl
36573665
- sync
3666+
- pr
36583667
- name: test-standard-v4.0-pypy3.10-sync-noauth-nossl-standalone
36593668
commands:
36603669
- func: run server
@@ -4389,6 +4398,7 @@ tasks:
43894398
- python-3.13
43904399
- standalone-noauth-nossl
43914400
- noauth
4401+
- pr
43924402
- name: test-non-standard-latest-python3.9-noauth-ssl-replica-set
43934403
commands:
43944404
- func: run server
@@ -4410,6 +4420,7 @@ tasks:
44104420
- python-3.9
44114421
- replica_set-noauth-ssl
44124422
- noauth
4423+
- pr
44134424
- name: test-non-standard-latest-python3.10-auth-ssl-sharded-cluster
44144425
commands:
44154426
- func: run server
@@ -4431,6 +4442,7 @@ tasks:
44314442
- python-3.10
44324443
- sharded_cluster-auth-ssl
44334444
- auth
4445+
- pr
44344446
- name: test-non-standard-v4.0-pypy3.10-noauth-nossl-standalone
44354447
commands:
44364448
- func: run server

.evergreen/scripts/generate_config.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,19 @@ def create_server_version_tasks():
552552
task_inputs.append(task_input)
553553

554554
# Assemble the tasks.
555+
seen = set()
555556
for topology, auth, ssl, sync, python in task_inputs:
556-
tags = ["server-version", f"python-{python}", f"{topology}-{auth}-{ssl}", sync]
557+
combo = f"{topology}-{auth}-{ssl}"
558+
tags = ["server-version", f"python-{python}", combo, sync]
559+
if combo in [
560+
"standalone-noauth-nossl",
561+
"replica_set-noauth-nossl",
562+
"sharded_cluster-auth-ssl",
563+
]:
564+
combo = f"{combo}-{sync}"
565+
if combo not in seen:
566+
seen.add(combo)
567+
tags.append("pr")
557568
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology)
558569
if python not in PYPYS:
559570
expansions["COVERAGE"] = "1"
@@ -592,11 +603,12 @@ def create_test_non_standard_tasks():
592603
task_combos = []
593604
# For each version and topology, rotate through the CPythons.
594605
for (version, topology), python in zip_cycle(list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS):
595-
task_combos.append((version, topology, python))
606+
pr = version == "latest"
607+
task_combos.append((version, topology, python, pr))
596608
# For each PyPy and topology, rotate through the the versions.
597609
for (python, topology), version in zip_cycle(list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS):
598-
task_combos.append((version, topology, python))
599-
for version, topology, python in task_combos:
610+
task_combos.append((version, topology, python, False))
611+
for version, topology, python, pr in task_combos:
600612
auth, ssl = get_standard_auth_ssl(topology)
601613
tags = [
602614
"test-non-standard",
@@ -607,6 +619,8 @@ def create_test_non_standard_tasks():
607619
]
608620
if python in PYPYS:
609621
tags.append("pypy")
622+
if pr:
623+
tags.append("pr")
610624
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
611625
name = get_task_name("test-non-standard", python=python, **expansions)
612626
server_func = FunctionCall(func="run server", vars=expansions)
@@ -625,14 +639,15 @@ def create_standard_tasks():
625639
for (version, topology), python, sync in zip_cycle(
626640
list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS, SYNCS
627641
):
628-
task_combos.append((version, topology, python, sync))
642+
pr = version == "latest"
643+
task_combos.append((version, topology, python, sync, pr))
629644
# For each PyPy and topology, rotate through the the versions and sync/async.
630645
for (python, topology), version, sync in zip_cycle(
631646
list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS, SYNCS
632647
):
633-
task_combos.append((version, topology, python, sync))
648+
task_combos.append((version, topology, python, sync, False))
634649

635-
for version, topology, python, sync in task_combos:
650+
for version, topology, python, sync, pr in task_combos:
636651
auth, ssl = get_standard_auth_ssl(topology)
637652
tags = [
638653
"test-standard",
@@ -643,6 +658,8 @@ def create_standard_tasks():
643658
]
644659
if python in PYPYS:
645660
tags.append("pypy")
661+
if pr:
662+
tags.append("pr")
646663
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
647664
name = get_task_name("test-standard", python=python, sync=sync, **expansions)
648665
server_func = FunctionCall(func="run server", vars=expansions)
@@ -757,7 +774,7 @@ def create_mod_wsgi_tasks():
757774
server_func = FunctionCall(func="run server", vars=server_vars)
758775
vars = dict(TEST_NAME="mod_wsgi", SUB_TEST_NAME=test.split("-")[0], PYTHON_VERSION=python)
759776
test_func = FunctionCall(func="run tests", vars=vars)
760-
tags = ["mod_wsgi"]
777+
tags = ["mod_wsgi", "pr"]
761778
commands = [server_func, test_func]
762779
tasks.append(EvgTask(name=task_name, tags=tags, commands=commands))
763780
return tasks
@@ -842,7 +859,7 @@ def create_getdata_tasks():
842859

843860

844861
def create_coverage_report_tasks():
845-
tags = ["coverage"]
862+
tags = ["coverage", "pr"]
846863
task_name = "coverage-report"
847864
# BUILD-3165: We can't use "*" (all tasks) and specify "variant".
848865
# Instead list out all coverage tasks using tags.

0 commit comments

Comments
 (0)