Cobertura+Failsafe: make “mvn clean site” proceed even if an integration test fails
up vote
1
down vote
favorite
I have a Java8/Maven/Spring Boot project involving the maven-failsafe-plugin (in order to run integration tests in *IT.java, separately from unit tests in *Test.java) and cobertura-maven-plugin.
The issue is that mvn clean site fails to conclude if an integration test fails, while mvn clean site is fine if an unit test fails.
To reproduce this, I first added a src/test/java/app/FailingTest.java containing:
package app;
import org.junit.Test;
import static org.junit.Assert.fail;
public class FailingTest
@Test
public void failingTest ()
fail();
and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.063 s <<< FAILURE! - in app.FailingTest
[ERROR] failingTest(app.FailingTest) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingTest.failingTest(FailingTest.java:11)
...
[INFO] Cobertura Report generation was successful.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then I renamed that class to src/test/java/app/FailingIT.java, and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingIT
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 s <<< FAILURE! - in app.FailingIT
[ERROR] failingTest(app.FailingIT) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingIT.failingTest(FailingIT.java:11)
...
[INFO] --- maven-failsafe-plugin:2.22.1:verify (default) @ example-project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
How can one fix this?
My pom.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>example-project</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- This is needed for the failsafe plugin, cf. https://stackoverflow.com/a/42128153/9164010 -->
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<!-- This is needed to avoid a compilation error, cf. below -->
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/50661649/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/51099913/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
</project>
java maven java-8 maven-failsafe-plugin maven-cobertura-plugin
add a comment |
up vote
1
down vote
favorite
I have a Java8/Maven/Spring Boot project involving the maven-failsafe-plugin (in order to run integration tests in *IT.java, separately from unit tests in *Test.java) and cobertura-maven-plugin.
The issue is that mvn clean site fails to conclude if an integration test fails, while mvn clean site is fine if an unit test fails.
To reproduce this, I first added a src/test/java/app/FailingTest.java containing:
package app;
import org.junit.Test;
import static org.junit.Assert.fail;
public class FailingTest
@Test
public void failingTest ()
fail();
and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.063 s <<< FAILURE! - in app.FailingTest
[ERROR] failingTest(app.FailingTest) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingTest.failingTest(FailingTest.java:11)
...
[INFO] Cobertura Report generation was successful.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then I renamed that class to src/test/java/app/FailingIT.java, and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingIT
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 s <<< FAILURE! - in app.FailingIT
[ERROR] failingTest(app.FailingIT) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingIT.failingTest(FailingIT.java:11)
...
[INFO] --- maven-failsafe-plugin:2.22.1:verify (default) @ example-project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
How can one fix this?
My pom.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>example-project</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- This is needed for the failsafe plugin, cf. https://stackoverflow.com/a/42128153/9164010 -->
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<!-- This is needed to avoid a compilation error, cf. below -->
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/50661649/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/51099913/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
</project>
java maven java-8 maven-failsafe-plugin maven-cobertura-plugin
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a Java8/Maven/Spring Boot project involving the maven-failsafe-plugin (in order to run integration tests in *IT.java, separately from unit tests in *Test.java) and cobertura-maven-plugin.
The issue is that mvn clean site fails to conclude if an integration test fails, while mvn clean site is fine if an unit test fails.
To reproduce this, I first added a src/test/java/app/FailingTest.java containing:
package app;
import org.junit.Test;
import static org.junit.Assert.fail;
public class FailingTest
@Test
public void failingTest ()
fail();
and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.063 s <<< FAILURE! - in app.FailingTest
[ERROR] failingTest(app.FailingTest) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingTest.failingTest(FailingTest.java:11)
...
[INFO] Cobertura Report generation was successful.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then I renamed that class to src/test/java/app/FailingIT.java, and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingIT
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 s <<< FAILURE! - in app.FailingIT
[ERROR] failingTest(app.FailingIT) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingIT.failingTest(FailingIT.java:11)
...
[INFO] --- maven-failsafe-plugin:2.22.1:verify (default) @ example-project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
How can one fix this?
My pom.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>example-project</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- This is needed for the failsafe plugin, cf. https://stackoverflow.com/a/42128153/9164010 -->
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<!-- This is needed to avoid a compilation error, cf. below -->
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/50661649/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/51099913/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
</project>
java maven java-8 maven-failsafe-plugin maven-cobertura-plugin
I have a Java8/Maven/Spring Boot project involving the maven-failsafe-plugin (in order to run integration tests in *IT.java, separately from unit tests in *Test.java) and cobertura-maven-plugin.
The issue is that mvn clean site fails to conclude if an integration test fails, while mvn clean site is fine if an unit test fails.
To reproduce this, I first added a src/test/java/app/FailingTest.java containing:
package app;
import org.junit.Test;
import static org.junit.Assert.fail;
public class FailingTest
@Test
public void failingTest ()
fail();
and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.063 s <<< FAILURE! - in app.FailingTest
[ERROR] failingTest(app.FailingTest) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingTest.failingTest(FailingTest.java:11)
...
[INFO] Cobertura Report generation was successful.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then I renamed that class to src/test/java/app/FailingIT.java, and mvn clean site yields:
...
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running app.FailingIT
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.031 s <<< FAILURE! - in app.FailingIT
[ERROR] failingTest(app.FailingIT) Time elapsed: 0.005 s <<< FAILURE!
java.lang.AssertionError
at app.FailingIT.failingTest(FailingIT.java:11)
...
[INFO] --- maven-failsafe-plugin:2.22.1:verify (default) @ example-project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
How can one fix this?
My pom.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>example-project</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- This is needed for the failsafe plugin, cf. https://stackoverflow.com/a/42128153/9164010 -->
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<!-- This is needed to avoid a compilation error, cf. below -->
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/50661649/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- This is needed to avoid a compilation error, cf. https://stackoverflow.com/a/51099913/9164010 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
</project>
java maven java-8 maven-failsafe-plugin maven-cobertura-plugin
java maven java-8 maven-failsafe-plugin maven-cobertura-plugin
edited Nov 11 at 17:48
nullpointer
38k1073145
38k1073145
asked Nov 11 at 17:29
ErikMD
1,9921318
1,9921318
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
It's the maven-failsafe-plugin that's responsible for the build failure. The reason is clearly called out in your pom.xml as :
<goal>integration-test</goal>
If the test is really an Integration Test (IT), you must fix it or else if it is not an integration test, you can rename it to be categorized as a Unit Test(UT) but still fix it :)
Another poor way of getting rid of this error could be commenting out the failsafe plugin declaration all together in the pom.xml making it inactive. I would suggest to refrain from doing so though.
Thanks for your answer, however it does not really addresses my question: I would like thatmvn verifyfails due to theintegration-testgoal, butmvn siteproceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)
– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests withmvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just wantmvn sitenot to fail if an integration test fails (in the same way as currently,mvn sitedoes not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.
– ErikMD
Nov 11 at 21:17
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
It's the maven-failsafe-plugin that's responsible for the build failure. The reason is clearly called out in your pom.xml as :
<goal>integration-test</goal>
If the test is really an Integration Test (IT), you must fix it or else if it is not an integration test, you can rename it to be categorized as a Unit Test(UT) but still fix it :)
Another poor way of getting rid of this error could be commenting out the failsafe plugin declaration all together in the pom.xml making it inactive. I would suggest to refrain from doing so though.
Thanks for your answer, however it does not really addresses my question: I would like thatmvn verifyfails due to theintegration-testgoal, butmvn siteproceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)
– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests withmvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just wantmvn sitenot to fail if an integration test fails (in the same way as currently,mvn sitedoes not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.
– ErikMD
Nov 11 at 21:17
add a comment |
up vote
1
down vote
It's the maven-failsafe-plugin that's responsible for the build failure. The reason is clearly called out in your pom.xml as :
<goal>integration-test</goal>
If the test is really an Integration Test (IT), you must fix it or else if it is not an integration test, you can rename it to be categorized as a Unit Test(UT) but still fix it :)
Another poor way of getting rid of this error could be commenting out the failsafe plugin declaration all together in the pom.xml making it inactive. I would suggest to refrain from doing so though.
Thanks for your answer, however it does not really addresses my question: I would like thatmvn verifyfails due to theintegration-testgoal, butmvn siteproceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)
– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests withmvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just wantmvn sitenot to fail if an integration test fails (in the same way as currently,mvn sitedoes not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.
– ErikMD
Nov 11 at 21:17
add a comment |
up vote
1
down vote
up vote
1
down vote
It's the maven-failsafe-plugin that's responsible for the build failure. The reason is clearly called out in your pom.xml as :
<goal>integration-test</goal>
If the test is really an Integration Test (IT), you must fix it or else if it is not an integration test, you can rename it to be categorized as a Unit Test(UT) but still fix it :)
Another poor way of getting rid of this error could be commenting out the failsafe plugin declaration all together in the pom.xml making it inactive. I would suggest to refrain from doing so though.
It's the maven-failsafe-plugin that's responsible for the build failure. The reason is clearly called out in your pom.xml as :
<goal>integration-test</goal>
If the test is really an Integration Test (IT), you must fix it or else if it is not an integration test, you can rename it to be categorized as a Unit Test(UT) but still fix it :)
Another poor way of getting rid of this error could be commenting out the failsafe plugin declaration all together in the pom.xml making it inactive. I would suggest to refrain from doing so though.
answered Nov 11 at 17:46
nullpointer
38k1073145
38k1073145
Thanks for your answer, however it does not really addresses my question: I would like thatmvn verifyfails due to theintegration-testgoal, butmvn siteproceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)
– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests withmvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just wantmvn sitenot to fail if an integration test fails (in the same way as currently,mvn sitedoes not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.
– ErikMD
Nov 11 at 21:17
add a comment |
Thanks for your answer, however it does not really addresses my question: I would like thatmvn verifyfails due to theintegration-testgoal, butmvn siteproceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)
– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests withmvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just wantmvn sitenot to fail if an integration test fails (in the same way as currently,mvn sitedoes not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.
– ErikMD
Nov 11 at 21:17
Thanks for your answer, however it does not really addresses my question: I would like that
mvn verify fails due to the integration-test goal, but mvn site proceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)– ErikMD
Nov 11 at 18:04
Thanks for your answer, however it does not really addresses my question: I would like that
mvn verify fails due to the integration-test goal, but mvn site proceeds to generate coverage stats for unit tests and/or integration tests, even if an integration test fails. Basically, there seems to be some "asymmetry" between cobertura+surefire and cobertura+failsafe regarding the "exit status" of unit tests and integration tests. Is it possible to fix this? (unfortunately this case doesn't seem to be covered in the failsafe and cobertura documentation)– ErikMD
Nov 11 at 18:04
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
@ErikMD Are you looking out for something like skipping tests? Also to question the basic, why do you need the failsafe plugin for then?
– nullpointer
Nov 11 at 18:19
I use the failsafe plugin to run integration tests with
mvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just want mvn site not to fail if an integration test fails (in the same way as currently, mvn site does not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.– ErikMD
Nov 11 at 21:17
I use the failsafe plugin to run integration tests with
mvn verify. I've seen examples on the web showing that surefire can also be configured to run integration tests, but the failsafe doc says it's better to use failsafe than surefire for that purpose. I don't really want to skip tests, I just want mvn site not to fail if an integration test fails (in the same way as currently, mvn site does not fail if an unit test fails), to get unit+integration tests cobertura reports. It'd be great to know solutions to achieve this.– ErikMD
Nov 11 at 21:17
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53251339%2fcoberturafailsafe-make-mvn-clean-site-proceed-even-if-an-integration-test-fa%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown