aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/ci
diff options
context:
space:
mode:
Diffstat (limited to 'xtesting/ci')
-rw-r--r--xtesting/ci/run_tests.py10
-rw-r--r--xtesting/ci/testcases.yaml12
2 files changed, 10 insertions, 12 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:
diff --git a/xtesting/ci/testcases.yaml b/xtesting/ci/testcases.yaml
index 6ab5927f..7c621fd0 100644
--- a/xtesting/ci/testcases.yaml
+++ b/xtesting/ci/testcases.yaml
@@ -13,8 +13,7 @@ tiers:
clean_flag: false
description: ''
run:
- module: 'xtesting.samples.first'
- class: 'Test'
+ name: 'first'
-
case_name: second
@@ -24,8 +23,7 @@ tiers:
clean_flag: false
description: ''
run:
- module: 'xtesting.samples.second'
- class: 'Test'
+ name: 'second'
-
case_name: third
@@ -35,8 +33,7 @@ tiers:
clean_flag: false
description: ''
run:
- module: 'xtesting.core.feature'
- class: 'BashFeature'
+ name: 'bashfeature'
args:
cmd: 'echo -n Hello World; exit 0'
@@ -48,8 +45,7 @@ tiers:
clean_flag: false
description: ''
run:
- module: 'xtesting.core.unit'
- class: 'Suite'
+ name: 'unit'
args:
name: 'xtesting.samples.fourth'