From 7ccb34ecddc674ad23ed1f0e607fd12b6d5954b9 Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Fri, 1 Mar 2024 00:05:45 +0100 Subject: Error reason added to the test reports Error reason added to the test reports Issue-ID: TEST-402 Signed-off-by: Lukasz Rajewski Change-Id: I024626764b134d9fe7607988cf46918414f1deb3 --- src/onaptests/scenario/scenario_base.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/onaptests/scenario') 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") -- cgit 1.2.3-korg