aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/ci/run_tests.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-08-07 05:06:23 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-08-07 05:36:44 +0200
commit0b69c9ee6ca5188045a5927b41fa2666555631d9 (patch)
tree2cf85f3684156d52c57ced195066c18172b14497 /xtesting/ci/run_tests.py
parent12217df35b64528f786d3548ca2353907b2b6ebb (diff)
Allow calling a skip test
run_tests shouldn't return an incorrect value if the test is skipped. Else it simply forbids running tests in parallel (one test per thread). Change-Id: I07efca28dbf6cf1c29ec8e5c999e38cfe3ad0aad 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.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py
index c8983b46..61482d98 100644
--- a/xtesting/ci/run_tests.py
+++ b/xtesting/ci/run_tests.py
@@ -49,11 +49,6 @@ class BlockingTestFailed(Exception):
pass
-class TestNotEnabled(Exception):
- """Exception when the test is not enabled"""
- pass
-
-
class RunTestsParser(object):
"""Parser to run tests"""
# pylint: disable=too-few-public-methods
@@ -144,8 +139,13 @@ class Runner(object):
def run_test(self, test):
"""Run one test case"""
if not test.is_enabled():
- raise TestNotEnabled(
- "The test case {} is not enabled".format(test.get_name()))
+ msg = prettytable.PrettyTable(
+ header_style='upper', padding_width=5,
+ field_names=['test case', 'project', 'duration',
+ 'result'])
+ msg.add_row([test.get_name(), test.get_project(), "00:00", "SKIP"])
+ LOGGER.info("Test result:\n\n%s\n", msg)
+ return testcase.TestCase.EX_TESTCASE_SKIPPED
result = testcase.TestCase.EX_RUN_ERROR
run_dict = self.get_run_dict(test.get_name())
if run_dict: