Skip to content

Commit 2faea4b

Browse files
committed
tests: isolate template-agnostic DispVM preload tests
Use default_template_only to avoid running the preload test for every template. This significantly reduces CI runtime while preserving test coverage. Fixes QubesOS/qubes-issues#10749
1 parent 53ca30f commit 2faea4b

2 files changed

Lines changed: 647 additions & 608 deletions

File tree

qubes/tests/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,9 @@ def list_templates():
16981698
return _templates
16991699

17001700

1701-
def create_testcases_for_templates(name, *bases, module, **kwds):
1701+
def create_testcases_for_templates(
1702+
name, *bases, module, default_template_only=False, **kwds
1703+
):
17021704
"""Do-it-all helper for generating per-template tests via load_tests proto
17031705
17041706
This does several things:
@@ -1731,7 +1733,13 @@ def create_testcases_for_templates(name, *bases, module, **kwds):
17311733
# possible to correctly guess frame from stack. Explicit is better than
17321734
# implicit!
17331735

1734-
for template in list_templates():
1736+
templates = list_templates()
1737+
if default_template_only and templates:
1738+
# Some tests are template-agnostic and should run only once
1739+
# to avoid slowing down the integration test suite.
1740+
templates = templates[:1]
1741+
1742+
for template in templates:
17351743
clsname = name + "_" + template
17361744
if hasattr(module, clsname):
17371745
continue

0 commit comments

Comments
 (0)