h2spec icon indicating copy to clipboard operation
h2spec copied to clipboard

[junit] Fix JUnit generated XML report.

Open jstourac opened this issue 5 years ago • 3 comments

Based on the Maven surefire-plugin JUnit XSD schema [1], name attribute in testcase is required. Let's use description value that is currently used as classname attribute for this purpose.

This issue may lead to errors with JUnit plugin 1.32 for Jenkins.

[1] https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd

jstourac avatar Feb 23 '21 17:02 jstourac

Update: actually version 1.33 of the Jenkins JUnit plugin has fixed the occurring NPE which was present during the plugin execution in version before. So even though there is no working issue now, still formally the XSD schema requires the name attribute.

I'll keep on your decision whether you feel more to merge/update or close this.

jstourac avatar Mar 30 '21 18:03 jstourac

Hi there :) Is there any chance this gets merged? Even though this doesn't make problem to the Jenkins plugin anymore, it still violates the XSD format expected by the Maven surefire plugin. Or shall we follow some different XSD instead that one?

jstourac avatar Dec 20 '22 16:12 jstourac

I'm also running into this as I'm attempting to show h2spec results from CI using a GitHub action like test-reporter - I suspect that's where it's choking:

  Error: Processing test results from h2spec-junit.xml failed
Error: TypeError: Cannot read properties of undefined (reading 'trim')

https://github.com/dorny/test-reporter/blob/e9fa2f582c0ebbe2e263fd18fad744d52e0b0203/src/parsers/java-junit/java-junit-parser.ts#L100


edit: that was it, this patch fixes it for me: https://github.com/hapsoc/hring/actions/runs/3856947194/jobs/6573802085

fasterthanlime avatar Jan 06 '23 16:01 fasterthanlime