-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
JUnitFormatter does not put required name attribute in testsuite root element #477
Comments
This one seems highly related to my issue, #468, my issue also boils down to the fact that the JUnitReporter/Formater behaves in that particular way. I'm not part of the team but I'm curious about your patch, can I try it out and see if it solves my issues as well? |
@ericmaxwell2003 sounds good. Looking forward to your pull request. |
… name attribute in testsuite root element.
@karaaie Sure, I don't mind. It is here: https://github.com/ericmaxwell2003/cucumber-jvm/tree/cucumber-jvm-junitformatter-name-attribute. |
…n sumTimes and rethrow
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Unless I'm mistaken, the name attribute inside of the root element, testsuite, is required by the maven surefire-report-plugin and this is not being supplied by the cucumber-jvm core cucumber.runtime.formatter.JUnitFormatter class.
The problem is that the surefire-report-plugin cannot build the surefire report site off the generated Cucumber JUnit report, because an NPE is thrown inside of
org.apache.maven.plugins.surefire.report.ReportTestSuite.setFullClassName(...) when it is passed a null value for the attribute.
I encountered this issue when running mvn:site, using the JUnit report created by the Cucumber test runner.
Example:
Here is my test runner class.
Notice, I put the output of the Cucumber JUnit report to the same place as the original surefire version. This causes the original to be replaced so that only the prettier Cucumber JUnit report is reported on. This works because the Cucumber version is generated after the original surefire one is generated. Not sure if there is a better way to do this.
...
// It generates something like the following
TEST-foo.pack.age.CucumberBddTest.xml
Notice that the testsuite element contains no name attribute. This is the issue.
I am new to cucumber and cucumber-jvm, so perhaps I'm using this incorrectly, but if this is a valid issue, I do already have a patch that I made and tested locally. My patch will add the name and it also rolls up the total testsuite time and number of skipped tests. The later two aren't required, but they weren't hard to add so I threw them in. I could send them to the cucumber-jvm team for review if interested.
The text was updated successfully, but these errors were encountered: