maven-surefire-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <>
Subject Re: Running suite() twice
Date Sun, 25 Nov 2007 08:31:06 GMT
Sounds ok to me. I was trying to maintain it since it existed before,  
but it's clearly not used in a useful way.

On 24/11/2007, at 10:29 AM, Dan Fabulich wrote:

> SUREFIRE-47 points out, correctly, that we're running the suite()  
> method twice: once to count the tests, and then again when the  
> tests actually run.
> This happens in JUnitTestSet; what's strange is that we don't do  
> this in TestNGTestSet.  "getTestCount()" simply returns 1 in that  
> case, with a TODO "need to get this from TestNG somehow".  This is  
> filed as SUREFIRE-94; it's minor, because "this isn't required for  
> correct operation of the tests, but may be if a reporter relies on  
> the correct number in the runStarting method (currently, it is  
> unused)."
> If so, why do we count the tests initially at all?  I just tried  
> ripping out all implementations of getTestCount() and just adding 1  
> to totalTests whenever we would have called it.  It doesn't seem to  
> have done any harm; the only difference I can see is that in the  
> case where you've got some classes that look like tests, we do  
> "execute" the test run, but when we find no tests, the summary  
> banner says:
>   Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> ... instead of:
>   No tests to run.
> (It still says "No tests to run" when there are no JUnit classes at  
> all.)
> Therefore, I'm inclined to fix SUREFIRE-47 by ripping out  
> getTestCount() from the SurefireTestSet interface and removing its  
> implementation from JUnitTestSet, PojoTestSet and TestNGTestSet.
> Does anyone object to this?
> -Dan

Brett Porter -

View raw message