Skip to content

junit: Add properties to the JUnit.xml file #3704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ankita13-code
Copy link
Collaborator

@Ankita13-code Ankita13-code commented Mar 10, 2025

  • In case of CVM test cases, we need the information about vmsize and disk_encryption status in the JUnit.xml file for testing it on different combinations.
  • This PR adds these values to the JUnit.xml file in the form of system properties by extracting it from the information in the TestResultMessageBase class.
  • In future, this method can also be used to add more properties to the Junit file if required

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants