I did send this to the users list, but got no response in over a week. I know dev lists are not a magical escalation path, but this might be a better venue for this email.
I have an example project at https://gist.github.com/1090223 This project has both a JUnit test and a TestNG test. Following some instructions online to get surefire be able to run both I added lines 19-45 in the pom. This works fine when running "mvn test", except it runs the TestNG tests twice. I can fix that by commenting out lines 34-43. Now when I run "mvn cobertura:cobertura", this is where things get weird. In Maven 2.2.1, it runs both TestNG and JUnit just fine, and produces the correct coverage. Now in Maven 3.0.3 it just runs the JUnit tests. (With lines 34-43 still commented out). When I bring those back, this is the output: ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.company.JUnitTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Running com.company.TestNGTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec There are no tests to run. Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 So it appears to try to run both tests, but fails to actually run any tests, and gets 0% coverage. It appears there is something odd between Maven 2.2.1 and Maven 3.0.3 when the cobertura plugin runs, and its reading of the Surefire plugin configuration. Ideally I would only use JUnit or TestNG, and this would not be a problem. However, we are using TestNG exclusively, and wanted to introduce a tool that currently only is executed as a JUnit test (Spock). I wanted to avoid changing all our tests from TestNG to JUnit unless absolutely necessary. It appears to be a regression from Maven 2.2.1 to Maven 3.0.3, unless it was a bug in Maven 2 that was fixed. -- Larry --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
