Skip to content

[junit] Fix JUnit generated XML report.#123

Open
jstourac wants to merge 1 commit intosummerwind:masterfrom
jstourac:fixJunitReport
Open

[junit] Fix JUnit generated XML report.#123
jstourac wants to merge 1 commit intosummerwind:masterfrom
jstourac:fixJunitReport

Conversation

@jstourac
Copy link
Contributor

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
Copy link
Contributor Author

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.

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
Copy link
Contributor Author

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?

@fasterthanlime
Copy link

fasterthanlime commented Jan 6, 2023

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

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