I'm using Hudson to build a Java project w/ Maven. The project includes two different sets of unit tests: (1) a plain-old Surefire plugin execution that includes unit & database integration tests, and (2) a profile-activated suite of tests that are necessarily invoked using the JUnit ant task*.
I can understand why Hudson does not recognize my JUnit ant task tests (it doesn't, but if there's a way to do this that you know of, please let me know!), but what I don't understand is why it's failing to see my Surefire test execution as well. This was previously working fine, but now every build reports "0 tests in total."
My surefire plugin declaration in my POM looks something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<disableXmlReport>true</disableXmlReport>
<includes>
<include>**/something/**/*Test.java</include>
</includes>
<excludes>
<exclude>**/somethingelse/**/*.java</exclude>
</excludes> 开发者_Python百科
</configuration>
</plugin>
*I need to run the second group of tests under IBM JVM9 and with numerous other JCE/JAAS configurations that I could never get to properly launch under Surefire
Edit: I swear it was only after I removed XML comments that I saw I was disabling XML reports, it would make sense that this alone could prevent Hudson from seeing test results. I'll re-enable those first to try and resolve this.
As far as I know Hudson depends on the XML reports to generate its statistics and you explicitly disabled those:
<disableXmlReport>true</disableXmlReport>
精彩评论