Skip to content
Open
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
12 changes: 12 additions & 0 deletions lisa/notifiers/junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,18 @@ def _add_test_case_result(
testcase.attrib["classname"] = class_name
testcase.attrib["time"] = self._get_elapsed_str(elapsed)

# Add a standard system-properties element for all test cases
if hasattr(message, "information") and isinstance(message.information, dict):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure it works within Azure DevOps test results. A few teams tried to add it, but found it either not working or breaking the test results. Please make sure no regression on ADO test results.

# Create a system-properties element
system_props = ET.SubElement(testcase, "system-properties")

# Add VM size and encrypt_disk if they exist
for key in ["vmsize", "encrypt_disk"]:
if key in message.information:
prop = ET.SubElement(system_props, "property")
prop.attrib["name"] = key
prop.attrib["value"] = str(message.information[key])

if message.status == TestStatus.FAILED:
failure = ET.SubElement(testcase, "failure")
failure.attrib["message"] = message.message
Expand Down
Loading