views:

141

answers:

1

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>             
    </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.

+1  A: 

As far as I know Hudson depends on the XML reports to generate its statistics and you explicitly disabled those:

<disableXmlReport>true</disableXmlReport>
Joachim Sauer
As I indicated in my edit, this is what I suspected as well. Rebuilding now with the presumption that you're right. Thanks for confirming.
Justin Searls
This did work... sort of. Hudson doesn't do a terrific job of handling multiple aggregate test results on a single module. Most of the screens will ignore one test suite or the other, but at least now it recognizes all of the tests.
Justin Searls