diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-10 12:55:10 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-12 18:32:59 +0200 |
commit | 95092b511dbacac412dbe5b8ff3a28abb3d3f664 (patch) | |
tree | 24a547cf1a687af0d4db184375abcc03aef998ba /xtesting/ci/run_tests.py | |
parent | a9491ef0948f8fe3eb3772b6b6ae44d86bde7e9b (diff) |
Leverage on abc and stevedore
Change-Id: I7b3c4c0c5dd0c9e6fb3e52c3fff5221d4b831b02
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/ci/run_tests.py')
-rw-r--r-- | xtesting/ci/run_tests.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py index 59ed5617..3a3e6858 100644 --- a/xtesting/ci/run_tests.py +++ b/xtesting/ci/run_tests.py @@ -15,7 +15,6 @@ import argparse import errno -import importlib import logging import logging.config import os @@ -27,6 +26,7 @@ import enum import pkg_resources import prettytable import six +from stevedore import driver import yaml from xtesting.ci import tier_builder @@ -151,10 +151,12 @@ class Runner(object): if run_dict: try: LOGGER.info("Loading test case '%s'...", test.get_name()) - module = importlib.import_module(run_dict['module']) - cls = getattr(module, run_dict['class']) test_dict = Runner.get_dict_by_test(test.get_name()) - test_case = cls(**test_dict) + test_case = driver.DriverManager( + namespace='xtesting.testcase', + name=run_dict['name'], + invoke_on_load=True, + invoke_kwds=test_dict).driver self.executed_test_cases[test.get_name()] = test_case test_case.check_requirements() if test_case.is_skipped: |