nextest icon indicating copy to clipboard operation
nextest copied to clipboard

Add a way to set global properties in the JUnit output

Open sunshowers opened this issue 1 year ago • 1 comments

  • 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 avatar Nov 22 '24 00:11 sunshowers

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 https://github.com/sebastianbergmann/phpunit/issues/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>.

sunshowers avatar Nov 24 '24 04:11 sunshowers