提交 e0f92cc5 编写于 作者: C Cleber Rosa

Runner: remove unnecessary execution order

Now that the options are registered and are guaranteed to have a
default, let's register the default and remove the custom default
setting.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 dcfbfc7e
......@@ -24,10 +24,26 @@ from avocado.core import exit_codes, job, loader, output, parser_common_args
from avocado.core.dispatcher import JobPrePostDispatcher
from avocado.core.future.settings import settings
from avocado.core.output import LOG_UI
from avocado.core.plugin_interfaces import CLICmd
from avocado.core.plugin_interfaces import CLICmd, Init
from avocado.utils import process
class RunInit(Init):
name = 'run'
description = 'Initializes the run options'
def initialize(self):
help_msg = ('Defines the order of iterating through test suite '
'and test variants')
settings.register_option(section='run',
key='execution_order',
choices=('tests-per-variant',
'variants-per-test'),
default='variants-per-test',
help_msg=help_msg)
class Run(CLICmd):
"""
......@@ -188,16 +204,9 @@ class Run(CLICmd):
short_arg='-S',
long_arg='--sysinfo')
help_msg = ('Defines the order of iterating through test suite '
'and test variants')
settings.register_option(section='run',
key='execution_order',
choices=('tests-per-variant',
'variants-per-test'),
default=None,
help_msg=help_msg,
parser=parser,
long_arg='--execution-order')
settings.add_argparser_to_option('run.execution_order',
parser=parser,
long_arg='--execution-order')
parser.output = parser.add_argument_group('output and result format')
......
......@@ -48,10 +48,6 @@ class TestRunner(Runner):
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):
"""
Creates an instance of TestRunner class.
......@@ -365,8 +361,6 @@ class TestRunner(Runner):
for test_factory in test_suite.tests:
test_factory[1]["base_logdir"] = job.logdir
test_factory[1]["job"] = job
if execution_order is None:
execution_order = self.DEFAULT_EXECUTION_ORDER
for test_factory, variant in self._iter_suite(job,
test_suite,
execution_order):
......
......@@ -79,6 +79,7 @@ if __name__ == '__main__':
"tap = avocado.plugins.tap:TAPInit",
"jobscripts = avocado.plugins.jobscripts:JobScriptsInit",
"json_variants = avocado.plugins.json_variants:JsonVariantsInit",
"run = avocado.plugins.run:RunInit",
],
'avocado.plugins.cli': [
'wrapper = avocado.plugins.wrapper:Wrapper',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册