提交 24fc1421 编写于 作者: L Lukáš Doktor

avocado.multiplexer: Add support to override params entry points

This patch adds support for --mux-entry xxx.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 ac425613
......@@ -465,7 +465,9 @@ class Mux(object):
self.pools = parse_yamls(mux_files, filter_only, filter_out)
else: # no variants
self.pools = None
self._mux_entry = getattr(args, 'mux_entry_point', ['/test/*'])
self._mux_entry = getattr(args, 'mux_entry', None)
if self._mux_entry is None:
self._mux_entry = ['/test/*']
def get_number_of_tests(self, test_suite):
# Currently number of tests is symetrical
......@@ -480,7 +482,7 @@ class Mux(object):
i = None
for i, variant in enumerate(multiplex_pools(self.pools)):
test_factory = [template[0], template[1].copy()]
test_factory[1]['params'] = variant
test_factory[1]['params'] = (variant, self._mux_entry)
yield test_factory
if i is None: # No variants, use template
yield template
......
......@@ -116,6 +116,8 @@ class TestRunner(plugin.Plugin):
help='Filter only path(s) from multiplexing')
mux.add_argument('--filter-out', nargs='*', default=[],
help='Filter out path(s) from multiplexing')
mux.add_argument('--mux-entry', nargs='*', default=None,
help="Multiplex entry point(s)")
super(TestRunner, self).configure(self.parser)
# Export the test runner parser back to the main parser
......
......@@ -130,14 +130,17 @@ class Test(unittest.TestCase):
self.stdout_log = logging.getLogger("avocado.test.stdout")
self.stderr_log = logging.getLogger("avocado.test.stderr")
mux_entry = ['/test/*']
if isinstance(params, dict):
self.default_params = self.default_params.copy()
self.default_params.update(params)
params = []
elif params is None:
params = []
elif isinstance(params, tuple):
params, mux_entry = params[0], params[1]
self.params = multiplexer.AvocadoParams(params, self.name, self.tag,
['/test/*'],
mux_entry,
self.default_params)
self.log.info('START %s', self.tagged_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册