aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci/run_tests.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-18 20:19:45 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-19 07:09:52 +0200
commit771b18dec2d3d637d1e989e4ce2cc3147ecd9c47 (patch)
tree4d17478e8493972105b362dadfdf7fd533fb8774 /functest/ci/run_tests.py
parent4c1e2c2b35ef2474d26e0cd6ce3977d24dc93553 (diff)
Print stack when catching exceptions in run_tests.py
Change-Id: Id94475dd519ce04b87da470f6e6bb5a1c1aa2d75 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/ci/run_tests.py')
-rwxr-xr-xfunctest/ci/run_tests.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index f973b616c..95353c87a 100755
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -122,10 +122,9 @@ class Runner(object):
if not test.is_enabled():
raise TestNotEnabled(
"The test case {} is not enabled".format(test.get_name()))
- test_name = test.get_name()
logger.info("\n") # blank line
self.print_separator("=")
- logger.info("Running test case '%s'..." % test_name)
+ logger.info("Running test case '%s'..." % test.get_name())
self.print_separator("=")
logger.debug("\n%s" % test)
self.source_rc_file()
@@ -133,17 +132,17 @@ class Runner(object):
if test.needs_clean() and self.clean_flag:
self.generate_os_snapshot()
- flags = (" -t %s" % (test_name))
+ flags = " -t %s" % test.get_name()
if self.report_flag:
flags += " -r"
result = testcase.TestCase.EX_RUN_ERROR
- run_dict = self.get_run_dict(test_name)
+ run_dict = self.get_run_dict(test.get_name())
if run_dict:
try:
module = importlib.import_module(run_dict['module'])
cls = getattr(module, run_dict['class'])
- test_dict = ft_utils.get_dict_by_test(test_name)
+ test_dict = ft_utils.get_dict_by_test(test.get_name())
test_case = cls(**test_dict)
self.executed_test_cases.append(test_case)
try:
@@ -168,7 +167,7 @@ class Runner(object):
if test.needs_clean() and self.clean_flag:
self.cleanup()
if result != testcase.TestCase.EX_OK:
- logger.error("The test case '%s' failed. " % test_name)
+ logger.error("The test case '%s' failed. " % test.get_name())
self.overall_result = Result.EX_ERROR
if test.is_blocking():
raise BlockingTestFailed(
@@ -242,8 +241,10 @@ class Runner(object):
return Result.EX_ERROR
else:
self.run_all(_tiers)
+ except BlockingTestFailed:
+ pass
except Exception:
- logger.exception("Runner failed")
+ logger.exception("Failures when running testcase(s)")
self.overall_result = Result.EX_ERROR
msg = prettytable.PrettyTable(