aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/scenario
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-03-01 00:05:45 +0100
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-03-03 15:23:25 +0100
commit7ccb34ecddc674ad23ed1f0e607fd12b6d5954b9 (patch)
treeb2be46a4bc3b216de9aaad0844a869df064b3698 /src/onaptests/scenario
parentf81e846d07ae7676494d90756411fe898afd92fb (diff)
Error reason added to the test reports
Error reason added to the test reports Issue-ID: TEST-402 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: I024626764b134d9fe7607988cf46918414f1deb3
Diffstat (limited to 'src/onaptests/scenario')
-rw-r--r--src/onaptests/scenario/scenario_base.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/onaptests/scenario/scenario_base.py b/src/onaptests/scenario/scenario_base.py
index ca6d898..f1b4455 100644
--- a/src/onaptests/scenario/scenario_base.py
+++ b/src/onaptests/scenario/scenario_base.py
@@ -47,14 +47,18 @@ class ScenarioBase(testcase.TestCase):
test_phase()
self.result += 50
except OnapTestException as exc:
- self.__logger.exception("%s on %s", exc.error_message, phase_name)
- except SDKException:
- self.__logger.exception("SDK Exception on %s", phase_name)
- except Exception as e:
- self.__logger.exception("General Exception on %s", phase_name)
+ self.__logger.exception("Test Exception %s on %s", str(exc), phase_name)
+ self.__logger.info("ROOT CAUSE")
+ self.__logger.info(exc.root_cause)
+ except SDKException as exc:
+ self.__logger.exception("SDK Exception %s on %s", str(exc), phase_name)
+ self.__logger.info("ROOT CAUSE")
+ self.__logger.info(str(exc))
+ except Exception as exc:
+ self.__logger.exception("General Exception %s on %s", str(exc), phase_name)
if self.general_exception:
- e = ExceptionGroup("General Exceptions", [self.general_exception, e]) # noqa
- self.general_exception = e
+ exc = ExceptionGroup("General Exceptions", [self.general_exception, exc]) # noqa
+ self.general_exception = exc
finally:
self.stop_time = time.time()
self.__logger.info(f"{self.scenario_name} Execution {self.result}% Completed")