Return-Path: Delivered-To: apmail-maven-surefire-dev-archive@www.apache.org Received: (qmail 86904 invoked from network); 24 Nov 2007 02:30:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Nov 2007 02:30:29 -0000 Received: (qmail 90186 invoked by uid 500); 24 Nov 2007 02:30:17 -0000 Delivered-To: apmail-maven-surefire-dev-archive@maven.apache.org Received: (qmail 90163 invoked by uid 500); 24 Nov 2007 02:30:17 -0000 Mailing-List: contact surefire-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: surefire-dev@maven.apache.org Delivered-To: mailing list surefire-dev@maven.apache.org Received: (qmail 90154 invoked by uid 99); 24 Nov 2007 02:30:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2007 18:30:17 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.111.4.25] (HELO out1.smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Nov 2007 02:30:17 +0000 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 6FA40515DD for ; Fri, 23 Nov 2007 21:29:56 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Fri, 23 Nov 2007 21:29:56 -0500 X-Sasl-enc: CYGeq6XAkk8fZWcWAHs61OvZRZ6JQh2WdJlPO3YlvgkK 1195871396 Received: from sfeng02.rf.lan (pool-71-105-77-198.lsanca.dsl-w.verizon.net [71.105.77.198]) by mail.messagingengine.com (Postfix) with ESMTP id DA255245FB for ; Fri, 23 Nov 2007 21:29:55 -0500 (EST) Date: Fri, 23 Nov 2007 18:29:38 -0800 (Pacific Standard Time) From: Dan Fabulich To: surefire-dev@maven.apache.org Subject: Running suite() twice Message-ID: X-X-Sender: dfabulich@warpmail.net@mail.messagingengine.com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org 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. http://jira.codehaus.org/browse/SUREFIRE-47 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