diff --git a/avocado/core/runner.py b/avocado/core/runner.py index 01fde575b630afdfd215eae0f2d626a14f901469..d018d958aaff91f7d5c6a0fae30da0066d605569 100644 --- a/avocado/core/runner.py +++ b/avocado/core/runner.py @@ -274,6 +274,10 @@ class TestRunner(object): """ DEFAULT_TIMEOUT = 86400 + #: Mode in which this runner should iterate through tests and variants. + #: The allowed values are "variants-per-test" or "tests-per-variant" + DEFAULT_EXECUTION_ORDER = "variants-per-test" + def __init__(self, job, result): """ Creates an instance of TestRunner class. @@ -545,7 +549,7 @@ class TestRunner(object): :param execution_order: way of iterating through tests/variants :return: generator yielding tuple(test_factory, variant) """ - if execution_order in ("variants-per-test", None): + if execution_order == "variants-per-test": return (self._template_to_factory(template, variant) for template in test_suite for variant in variants.itertests()) @@ -568,7 +572,8 @@ class TestRunner(object): :param replay_map: optional list to override test class based on test index. :param execution_order: Mode in which we should iterate through tests - resp. variants. + and variants. If not provided, will default to + :attr:`DEFAULT_EXECUTION_ORDER`. :return: a set with types of test failures. """ summary = set() @@ -595,6 +600,8 @@ class TestRunner(object): for test_template in test_suite: test_template[1]["base_logdir"] = self.job.logdir test_template[1]["job"] = self.job + if execution_order is None: + execution_order = self.DEFAULT_EXECUTION_ORDER for test_factory, variant in self._iter_suite(test_suite, variants, execution_order): index += 1