Hudson で Maven2プロジェクトから作成したジョブで integration-test を行うと、test の結果が重複する

タイトルの通り。
Maven2 初めて使ってるので、設定が悪いのかな?

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>hoge</groupId>
  <artifactId>hoge</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>hoge</name>
  <url>http://maven.apache.org</url>
  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testOutputDirectory>target/test-classes</testOutputDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <defaultGoal>validate</defaultGoal>
    <finalName>hoge</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>source-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1-beta-1</version>
        <configuration>
          <warSourceExcludes>WEB-INF/classes/**/*.*,WEB-INF/lib/*.jar</warSourceExcludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/main/webapp/WEB-INF/classes</directory>
            </fileset>
            <fileset>
              <directory>src/main/webapp/WEB-INF/lib</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <configuration>
         <excludes>
           <exclude>**/integration/**/*Test.java</exclude>
         </excludes>
       </configuration>
       <executions>
         <execution>
           <id>surefire-it</id>
           <phase>integration-test</phase>
           <goals>
             <goal>test</goal>
           </goals>
           <configuration>
             <skip>false</skip>
             <excludes>
               <exclude>none</exclude>
             </excludes>
             <includes>
               <include>**/integration/**/*Test.java</include>
             </includes>
           </configuration>
         </execution>
       </executions>
     </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

integration ってフォルダ以下にあるテストは、Maven2 の test では行わずに、integration-test で行う様に設定しました。
で Hudson の実行結果がこちら。


ってこのブログを書いてる最中に、@ssogabe さんが教えてくれました。ありがとうございます。

http://twitter.com/ssogabe/status/10217415502

@shinsukeoda Hudsonは今のところテストフェースが2回起動すると、2回とカウントしてしまいます。ジョブを分けてテストフェーズが2回起動しないようにしないとだめです。

Maven2 プロジェクトではなく、フリースタイル・プロジェクト を選択し、JUnitテスト結果の集計で指定した場合は、integration-test で実行しても、test の結果が重複しませんでした。
これは、ビルド後に JUnit の結果の xml を見に行ってるからなんですかね?