Updates for Issue #477 - JUnitFormatter does not put required name attribute #480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I updated the JUnitFormatter to add attributes
The expected JUnit report outputs have been updated accordingly to reflect this.
Notes:
Unit tests
The name and skipped counts are being tested.
I was not able to easily test the time within the unit tests. Since the test cases are intentionally "skipped" the time is 0 anyway, so the tests pass. In lieu of a unit test, I tested this by using the new version on another project to see that indeed the times add up appropriately. To unit test, I guess I would have to mock out the cucumber.runtime.Runtime class too. If you feel strongly that this is necessary, I'll try to add it.
Testsuite Name
Finally, I use the full JUnitFormatter class name as the testsuite name value. It seemed appropriate as it indicates that the test suite is composed of cucumber junit formatted results. I also considered using the name of the class that sets up the cucumber test runner or the full Cucumber test runner class name.