summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkooper <sergey.sachkov@est.tech>2019-05-07 08:44:41 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-05-08 07:30:27 +0000
commitfaaad99b7304d2d0901c282e7597acc453a77655 (patch)
treed8cec5c7ca91dd00f3ee6089949129afab85a0cb
parent51411acd1d4b06fc9bbc40338a27dd061dba425f (diff)
Jacoco doesn't show coverage for tests that use PowerMock
Change-Id: I28ff85e10dc449bf41b7ce6657ecdf455e9360d4 Issue-ID: SDC-2260 Signed-off-by: kooper <sergey.sachkov@est.tech>
-rw-r--r--openecomp-be/pom.xml33
-rw-r--r--pom.xml29
2 files changed, 27 insertions, 35 deletions
diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml
index 8d7de5c15f..7474467b88 100644
--- a/openecomp-be/pom.xml
+++ b/openecomp-be/pom.xml
@@ -57,39 +57,6 @@
<artifactId>maven-jar-plugin</artifactId>
<version>${mvn.jar.version}</version>
</plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>default-prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>report</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>report</goal>
- </goals>
- </execution>
- <execution>
- <id>post-unit-test</id>
- <phase>test</phase>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <!-- Sets the path to the file which contains the execution data. -->
- <dataFile>target/jacoco.exec</dataFile>
- <!-- Sets the output directory for the code coverage report. -->
- <outputDirectory>target/jacoco-ut</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
</plugins>
</build>
diff --git a/pom.xml b/pom.xml
index 7f11a549a5..04d4a24746 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,6 +139,8 @@ Modifications copyright (c) 2018 Nokia
<joda.time.version>2.9.9</joda.time.version>
+ <!--jacoco-->
+ <jacoco.version>0.8.1</jacoco.version>
</properties>
@@ -232,6 +234,17 @@ Modifications copyright (c) 2018 Nokia
</dependencies>
</dependencyManagement>
+ <dependencies>
+ <dependency>
+ <!-- must be on the classpath -->
+ <groupId>org.jacoco</groupId>
+ <artifactId>org.jacoco.agent</artifactId>
+ <classifier>runtime</classifier>
+ <version>${jacoco.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
<reporting>
<plugins>
<plugin>
@@ -389,9 +402,15 @@ Modifications copyright (c) 2018 Nokia
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
- <id>default-prepare-agent</id>
+ <id>default-instrument</id>
<goals>
- <goal>prepare-agent</goal>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-restore-instrumented-classes</id>
+ <goals>
+ <goal>restore-instrumented-classes</goal>
</goals>
</execution>
<execution>
@@ -399,6 +418,9 @@ Modifications copyright (c) 2018 Nokia
<goals>
<goal>report</goal>
</goals>
+ <configuration>
+ <dataFile>${project.build.directory}/jacoco.exec</dataFile>
+ </configuration>
</execution>
</executions>
</plugin>
@@ -454,6 +476,9 @@ Modifications copyright (c) 2018 Nokia
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<printSummary>false</printSummary>
+ <systemPropertyVariables>
+ <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
+ </systemPropertyVariables>
</configuration>
</plugin>
<plugin>