Skip to content

Commit 1215d2f

Browse files
authored
PYTHON-5879 Skip coverage on macOS/Win64 encryption tests (#2882)
1 parent 5319a1b commit 1215d2f

3 files changed

Lines changed: 61 additions & 14 deletions

File tree

.evergreen/generated_configs/tasks.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4802,22 +4802,20 @@ tasks:
48024802
- python-3.13
48034803
- standalone-noauth-nossl
48044804
- noauth
4805-
- name: test-non-standard-latest-python3.14t-noauth-ssl-replica-set-cov
4805+
- name: test-non-standard-latest-python3.14t-noauth-ssl-replica-set
48064806
commands:
48074807
- func: run server
48084808
vars:
48094809
AUTH: noauth
48104810
SSL: ssl
48114811
TOPOLOGY: replica_set
48124812
VERSION: latest
4813-
COVERAGE: "1"
48144813
- func: run tests
48154814
vars:
48164815
AUTH: noauth
48174816
SSL: ssl
48184817
TOPOLOGY: replica_set
48194818
VERSION: latest
4820-
COVERAGE: "1"
48214819
TOOLCHAIN_VERSION: 3.14t
48224820
tags:
48234821
- test-non-standard
@@ -4826,7 +4824,6 @@ tasks:
48264824
- replica_set-noauth-ssl
48274825
- noauth
48284826
- free-threaded
4829-
- pr
48304827
- name: test-non-standard-latest-pypy3.11-noauth-ssl-replica-set
48314828
commands:
48324829
- func: run server
@@ -4873,30 +4870,50 @@ tasks:
48734870
- sharded_cluster-auth-ssl
48744871
- auth
48754872
- pr
4876-
- name: test-non-standard-latest-python3.13-noauth-nossl-standalone-cov
4873+
- cov
4874+
- name: test-non-standard-latest-python3.14-auth-ssl-sharded-cluster
4875+
commands:
4876+
- func: run server
4877+
vars:
4878+
AUTH: auth
4879+
SSL: ssl
4880+
TOPOLOGY: sharded_cluster
4881+
VERSION: latest
4882+
- func: run tests
4883+
vars:
4884+
AUTH: auth
4885+
SSL: ssl
4886+
TOPOLOGY: sharded_cluster
4887+
VERSION: latest
4888+
TOOLCHAIN_VERSION: "3.14"
4889+
tags:
4890+
- test-non-standard-no-cov
4891+
- server-latest
4892+
- python-3.14
4893+
- sharded_cluster-auth-ssl
4894+
- auth
4895+
- pr
4896+
- name: test-non-standard-latest-python3.13-noauth-nossl-standalone
48774897
commands:
48784898
- func: run server
48794899
vars:
48804900
AUTH: noauth
48814901
SSL: nossl
48824902
TOPOLOGY: standalone
48834903
VERSION: latest
4884-
COVERAGE: "1"
48854904
- func: run tests
48864905
vars:
48874906
AUTH: noauth
48884907
SSL: nossl
48894908
TOPOLOGY: standalone
48904909
VERSION: latest
4891-
COVERAGE: "1"
48924910
TOOLCHAIN_VERSION: "3.13"
48934911
tags:
48944912
- test-non-standard
48954913
- server-latest
48964914
- python-3.13
48974915
- standalone-noauth-nossl
48984916
- noauth
4899-
- pr
49004917
- name: test-non-standard-rapid-python3.11-noauth-ssl-replica-set
49014918
commands:
49024919
- func: run server

.evergreen/generated_configs/variants.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ buildvariants:
193193
tags: [encryption_tag]
194194
- name: encryption-macos
195195
tasks:
196-
- name: .test-non-standard !.pypy
196+
- name: .test-non-standard !.pypy !.cov
197+
- name: .test-non-standard-no-cov !.pypy
197198
display_name: Encryption macOS
198199
run_on:
199200
- macos-14
@@ -203,7 +204,8 @@ buildvariants:
203204
tags: [encryption_tag]
204205
- name: encryption-win64
205206
tasks:
206-
- name: .test-non-standard !.pypy
207+
- name: .test-non-standard !.pypy !.cov
208+
- name: .test-non-standard-no-cov !.pypy
207209
display_name: Encryption Win64
208210
run_on:
209211
- windows-2022-latest-small
@@ -224,7 +226,8 @@ buildvariants:
224226
tags: [encryption_tag]
225227
- name: encryption-crypt_shared-macos
226228
tasks:
227-
- name: .test-non-standard !.pypy
229+
- name: .test-non-standard !.pypy !.cov
230+
- name: .test-non-standard-no-cov !.pypy
228231
display_name: Encryption crypt_shared macOS
229232
run_on:
230233
- macos-14
@@ -235,7 +238,8 @@ buildvariants:
235238
tags: [encryption_tag]
236239
- name: encryption-crypt_shared-win64
237240
tasks:
238-
- name: .test-non-standard !.pypy
241+
- name: .test-non-standard !.pypy !.cov
242+
- name: .test-non-standard-no-cov !.pypy
239243
display_name: Encryption crypt_shared Win64
240244
run_on:
241245
- windows-2022-latest-small

.evergreen/scripts/generate_config.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ def get_encryption_expansions(encryption):
132132
display_name = get_variant_name(encryption, host, **expansions)
133133
tasks = [".test-non-standard"]
134134
if host != "rhel8":
135-
tasks = [".test-non-standard !.pypy"]
135+
# Exclude PyPy (not tested with encryption on macOS/win64) and coverage tasks
136+
# (encryption suites exceed the 60-min timeout with coverage overhead on macOS/win64).
137+
# Also include the non-coverage companion tasks (test-non-standard-no-cov) which
138+
# carry the "latest" server tasks without COVERAGE=1.
139+
tasks = [".test-non-standard !.pypy !.cov", ".test-non-standard-no-cov !.pypy"]
136140
variant = create_variant(
137141
tasks,
138142
display_name,
@@ -644,8 +648,9 @@ def create_test_non_standard_tasks():
644648
tasks = []
645649
task_combos = set()
646650
# For each version and topology, rotate through the CPythons.
651+
# Only the sharded_cluster topology runs on PRs to keep patch build size manageable.
647652
for (version, topology), python in zip_cycle(list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS):
648-
pr = version == "latest"
653+
pr = version == "latest" and topology == "sharded_cluster"
649654
task_combos.add((version, topology, python, pr))
650655
# For each PyPy and topology, rotate through the MongoDB versions.
651656
for (python, topology), version in zip_cycle(list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS):
@@ -670,12 +675,33 @@ def create_test_non_standard_tasks():
670675
expansions["TEST_MIN_DEPS"] = "1"
671676
elif pr:
672677
expansions["COVERAGE"] = "1"
678+
tags.append("cov")
673679
name = get_task_name("test-non-standard", python=python, **expansions)
674680
server_func = FunctionCall(func="run server", vars=expansions)
675681
test_vars = expansions.copy()
676682
test_vars["TOOLCHAIN_VERSION"] = python
677683
test_func = FunctionCall(func="run tests", vars=test_vars)
678684
tasks.append(EvgTask(name=name, tags=tags, commands=[server_func, test_func]))
685+
# For each coverage task, also emit a non-coverage companion so that
686+
# macOS/Win64 encryption variants (which filter out .cov due to timeout
687+
# constraints) still have a "latest" task to activate in patch builds.
688+
if pr and "cov" in tags:
689+
nc_expansions = {k: v for k, v in expansions.items() if k != "COVERAGE"}
690+
# Use a distinct primary tag so companions are not selected by existing
691+
# ".test-non-standard" selectors (e.g. load-balancer, PyOpenSSL variants).
692+
nc_tags = [
693+
"test-non-standard-no-cov" if t == "test-non-standard" else t
694+
for t in tags
695+
if t != "cov"
696+
]
697+
nc_name = get_task_name("test-non-standard", python=python, **nc_expansions)
698+
nc_server_func = FunctionCall(func="run server", vars=nc_expansions)
699+
nc_test_vars = nc_expansions.copy()
700+
nc_test_vars["TOOLCHAIN_VERSION"] = python
701+
nc_test_func = FunctionCall(func="run tests", vars=nc_test_vars)
702+
tasks.append(
703+
EvgTask(name=nc_name, tags=nc_tags, commands=[nc_server_func, nc_test_func])
704+
)
679705
return tasks
680706

681707

0 commit comments

Comments
 (0)