From 3645dd98e8e1c32f2ca3dd958c8aa04a8701050e Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Fri, 16 May 2025 19:48:09 +0200 Subject: [PATCH 1/3] Add details feild to the test case result --- framework/python/src/core/session.py | 3 +++ framework/python/src/test_orc/test_case.py | 5 +++++ framework/python/src/test_orc/test_orchestrator.py | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/framework/python/src/core/session.py b/framework/python/src/core/session.py index 16c8f056b..22da5145a 100644 --- a/framework/python/src/core/session.py +++ b/framework/python/src/core/session.py @@ -453,6 +453,9 @@ def add_test_result(self, result): if len(result.description) != 0: test_result.description = result.description + # Add details to test result + test_result.details = result.details + # Add recommendations if provided if result.recommendations is not None: test_result.recommendations = result.recommendations diff --git a/framework/python/src/test_orc/test_case.py b/framework/python/src/test_orc/test_case.py index 6f4e3434b..942b41288 100644 --- a/framework/python/src/test_orc/test_case.py +++ b/framework/python/src/test_orc/test_case.py @@ -28,12 +28,14 @@ class TestCase: # pylint: disable=too-few-public-methods,too-many-instance-attr result: str = TestResult.NON_COMPLIANT recommendations: list = field(default_factory=lambda: []) optional_recommendations: list = field(default_factory=lambda: []) + details: str = "" def to_dict(self): test_dict = { "name": self.name, "description": self.description, + "details": self.details, "expected_behavior": self.expected_behavior, "required_result": self.required_result, "result": self.result @@ -47,3 +49,6 @@ def to_dict(self): test_dict["optional_recommendations"] = self.optional_recommendations return test_dict + + def __post_init__(self): + self.details = self.details.replace("\n", "", 1) diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 58512893e..1047755f5 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -611,7 +611,9 @@ def _run_test_module(self, module): # Convert dict from json into TestCase object test_case = TestCase(name=test_result["name"], result=test_result["result"], - description=test_result["description"]) + description=test_result["description"], + details=test_result['details'] + ) # Add steps to resolve if test is non-compliant if (test_case.result == TestResult.NON_COMPLIANT From b2349e34b7a7766c10c4d90740b34242e1648590 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Mon, 19 May 2025 14:38:21 +0200 Subject: [PATCH 2/3] pylint --- framework/python/src/test_orc/test_orchestrator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 1047755f5..8a4c22411 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -612,7 +612,7 @@ def _run_test_module(self, module): test_case = TestCase(name=test_result["name"], result=test_result["result"], description=test_result["description"], - details=test_result['details'] + details=test_result["details"] ) # Add steps to resolve if test is non-compliant From 080e64802c8815be24c3e3f4eea46f23767398f2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Tue, 20 May 2025 14:03:25 +0200 Subject: [PATCH 3/3] fix "details" key error --- framework/python/src/test_orc/test_orchestrator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 8a4c22411..66a6c7c86 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -611,8 +611,7 @@ def _run_test_module(self, module): # Convert dict from json into TestCase object test_case = TestCase(name=test_result["name"], result=test_result["result"], - description=test_result["description"], - details=test_result["details"] + description=test_result["description"] ) # Add steps to resolve if test is non-compliant @@ -621,6 +620,9 @@ def _run_test_module(self, module): test_case.recommendations = test_result["recommendations"] else: test_case.recommendations = [] + # Add details to the test case if presented + if "details" in test_result: + test_case.details = test_result["details"] self.get_session().add_test_result(test_case)