Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,9 @@ def list_templates():
return _templates


def create_testcases_for_templates(name, *bases, module, **kwds):
def create_testcases_for_templates(
name, *bases, module, default_template_only=False, **kwds
):
"""Do-it-all helper for generating per-template tests via load_tests proto

This does several things:
Expand Down Expand Up @@ -1731,7 +1733,13 @@ def create_testcases_for_templates(name, *bases, module, **kwds):
# possible to correctly guess frame from stack. Explicit is better than
# implicit!

for template in list_templates():
templates = list_templates()
if default_template_only and templates:
# Some tests are template-agnostic and should run only once
# to avoid slowing down the integration test suite.
templates = templates[:1]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't get the default template. But in case someone set QUBES_TEST_TEMPLATES for openqa, it may not match the app.default_template. Get the first template in that list if the variable is set, else, use self.app.default_template (self is not passed to that function, so it needs to be passed another way).


for template in templates:
clsname = name + "_" + template
if hasattr(module, clsname):
continue
Expand Down
Loading