Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions framework/python/src/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions framework/python/src/test_orc/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
6 changes: 5 additions & 1 deletion framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,18 @@ 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"]
)

# Add steps to resolve if test is non-compliant
if (test_case.result == TestResult.NON_COMPLIANT
and "recommendations" in test_result):
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)

Expand Down