I configured cobertura code coverage in my pom:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.4</version> <configuration> <instrumentation> <excludes> <exclude>**/*Exception.class</exclude> </excludes> </instrumentation> <formats> <format>xml</format> <format>html</format> </formats> </configuration> </plugin>
And start the test by running the following command:
mvn clean cobertura:cobertura
But if one of the unit test crashes, Cobertura only logs this information and does not put a build error.
Tests run: 287, Failures: 1, Errors: 1, Skipped: 0 Flushing results... Flushing results done Cobertura: Loaded information on 139 classes. Cobertura: Saved information on 139 classes. [ERROR] There are test failures. ................................. [INFO] BUILD SUCCESS
How to configure Cobertura build error failed in one of unit test fail?
Thanks in advance.
source share