pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Add name property to testsuites element in generated JUnit XML

Open joseph-sentry opened this issue 1 year ago • 5 comments

What's the problem this feature will solve?

Jest and Vitest JUnit Reporters do this, they include: jest tests and vitest tests as the value of the testsuites element's name property.

Describe the solution you'd like

The JUnit XML generated by pytest should always include pytest tests as the value of the name property of the testsuites element.

It's my opinion that this property should not be customizable., there should be some static information in the JUnit that represents the fact that pytest generated this file.

Alternative Solutions

There isn't any way to set or customize that property right now.

joseph-sentry avatar Aug 23 '24 18:08 joseph-sentry

Please reference a junitxml spec defining this attribute

RonnyPfannschmidt avatar Aug 23 '24 21:08 RonnyPfannschmidt

Here's what I found:

  • link this spec doesn't even include the field
  • link this spec defines it as "the name of the entire test run"
  • link this spec defines it as "The label of the scan"

Further here's an example JUnit file from the Jenkins JUnit plugin that is used in their tests that makes use of the property, which means that it's supported by Jenkins: link

It doesn't seem well defined, however as i mentioned the jest and vitest reporters make the default of that property: "jest tests" and "vitest tests" but they allow it to be customizable.

joseph-sentry avatar Aug 27 '24 16:08 joseph-sentry

This issue is stale because it has the status: needs information label and requested follow-up information was not provided for 14 days.

github-actions[bot] avatar Sep 11 '24 01:09 github-actions[bot]

This issue was closed because it has the status: needs information label and follow-up information has not been provided for 7 days since being marked as stale.

github-actions[bot] avatar Sep 18 '24 02:09 github-actions[bot]

Reopening as it was closed by the stalebot erroneously (more information was provided after all).

nicoddemus avatar Sep 18 '24 20:09 nicoddemus