Open naXa777 opened 12 months ago
I believe it is happening because by default Apache Maven Surefire plugin executes only *Test
classes but not *IT
. There are two approaches on how to solve the issue:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
I noticed that
main
branch contains broken tests, while all GitHub action runs are successful.When I run
mvn package
ormvn test
the result is SUCCESS:When I run tests via IntelliJ IDEA runner the result is FAILURE:
And GitHub Actions result is SUCCESS: See this build for example.
The result in IntelliJ IDEA is the correct one here, and it's expected that Maven should produce the same result.
I think the root of this problem is in test file names: tests that end with "IT" are skipped by Maven, only tests that end with "Test" are executed.