Question

Bellow a part of my actual pom. Testng tests for integration tests have been assigned a "integration" group in the @Test annotations. To do little test I did not exclude the "integration" group during the test phase.

When building using for example mvn verify or mvn install the integration tests get executed in the test phase, but not the verify or integration-test phase. The number of tests run remains 0. Somehow they are not picked up. Anyone have an idea on what might be wrong?

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.12.1</version>
    <configuration>
      <skip>false</skip>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.12.1</version>
    <executions>
      <execution>
        <id>integration-test</id>
        <phase>integration-test</phase>
        <goals>
          <goal>integration-test</goal>
        </goals>
        <configuration>
          <skip>false</skip>
          <excludedGroups>unit</excludedGroups>
        </configuration>
      </execution>
      <execution>
        <id>verify</id>
        <phase>verify</phase>
        <goals>
          <goal>verify</goal>
        </goals>
        <configuration>
          <skip>false</skip>
          <excludedGroups>unit</excludedGroups>
        </configuration>
      </execution>
    </executions>
    <configuration>
      <skip>false</skip>
      <excludedGroups>unit</excludedGroups>
    </configuration>
  </plugin>

Update: Adding TestNG as a dependency to the failsafe plugin does not help

Was it helpful?

Solution

maven-failsafe-plugin by default includes only files matching following patterns:

<includes>
 <include>**/IT*.java</include>
 <include>**/*IT.java</include>
 <include>**/*ITCase.java</include>
</includes>

How did you name your test class(es)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top