Skip to content
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

Add a way to set global properties in the JUnit output #1889

Open
sunshowers opened this issue Nov 22, 2024 · 1 comment
Open

Add a way to set global properties in the JUnit output #1889

sunshowers opened this issue Nov 22, 2024 · 1 comment

Comments

@sunshowers
Copy link
Member

sunshowers commented Nov 22, 2024

  • Define a way to set arbitrary global properties. For example, a NEXTEST_JUNIT_PROPERTY_foo = bar environment variable that becomes a property foo = bar.
  • Make the root element a <testsuite>, not a <testsuites>. Nest <testsuite> elements for each binary within the parent <testsuite>. This is allowed by the XSD https://llg.cubic.org/docs/junit/ but some parsers might not like it so we might need to be careful.
@sunshowers
Copy link
Member Author

sunshowers commented Nov 24, 2024

Unfortunately the nested <testsuite> approach might not work because most tooling can't handle it -- they expect the <testsuites>/<testsuite>/<testcase> pattern. For example, see sebastianbergmann/phpunit#2964.

So the options are:

  • Duplicate the global <properties> across all <testsuite> instances.
  • Add <properties> to the global <testsuites>, going against the XSD.
  • Put all test cases across all binaries within a single large <testsuite>.

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

No branches or pull requests

1 participant