Add rerunFailingTests option for maven surefire to rerun failing tests i...

Add rerunFailingTests option for maven surefire to rerun failing tests immediately after they fail. Each single test method now maintains a list of its runs. DefaultReporterFactory now contains a few maps between test and the list of all its runs. If a test passes in any of its reruns, the build will be marked as successful and the test will count as flake.
For JUnitCoreProvider which supports -Dparallel, it is a bit complex to
rerun failing tests after each class. I think we need to wrap the runner
in getRunner() in ParallelComputerBuilder, such that the wrapped runner
will check the result of each run and rerun if there are any failures. Is
my understanding correct and is it the good way to go?

Thanks


On Wed, Jun 25, 2014 at 2:02 PM, Andreas Gudian <notifications@github.com>
wrote:

> In
> surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java:
>
> >          JUnitCoreWrapper.execute( testsToRun, jUnitCoreParameters, customRunListeners, filter );
> > +
> > +        // Rerun failing tests if rerunFailingTests is set to true
>
> I think it would be better to rerun the failing tests of a class
> immediately after that class finished. For once, this would help for people
> who configure their tests to run in alphabetical order. Secondly, when
> using multiple forks, it would improve the balance between the runtime of
> the individual forks, as each fork will fetch the next class to execute
> only when the former class was actually finished (including reruns).
>
> Do you think that would be possible?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/maven-surefire/pull/40/files#r14212069>.
>