JUnit run notifier will fire test finished as well after test failure… #909
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 created a patch for issue #908 to help out.
In summary the FitNesseRunner doesn't work properly with the Gradle build tool. Reason for this is they expect an invocation of fireTestFinished for every fireTestStarted even if you already invoked fireTestFailure.
They do this as suggested by the Javadoc of RunNotifier.fireTestFinished (http://junit.sourceforge.net/javadoc/org/junit/runner/notification/RunNotifier.html#fireTestFinished%28org.junit.runner.Description%29)
The effect is that any failures or errors observed in a fitnesse run are ignored by Gradle's test result listener.
I added tests to JUnitRunNotifierResultsListenerTest to cover this behavior.
Finally, I'd like to bring your attention to the fact I modified the 2 existing tests slightly to illustrate the summaries passed into testComplete don't matter. They only matter when the test result succeeds and the summary still insists there were failures or errors of some kind.
I don't know if this use case makes sense so I made sure to cover both approaches when adding my own tests.