JavaScript Sonar Coverage setup
Sonar properties added to apex-pdp in order to pick up JavaScript
coverage in SonarCloud
Issue-ID: POLICY-2611
Change-Id: Ia9c5837bc18a34722437b2b299e85c6a8a67088d
Signed-off-by: waynedunican <wayne.dunican@est.tech>
diff --git a/client/client-deployment/pom.xml b/client/client-deployment/pom.xml
index ab7d22f..0818b30 100644
--- a/client/client-deployment/pom.xml
+++ b/client/client-deployment/pom.xml
@@ -32,6 +32,13 @@
<name>${project.artifactId}</name>
<description>Web client for deploying models in Apex engine</description>
+ <properties>
+ <webapp.dir>src/main/resources/webapp</webapp.dir>
+ <sonar.nodejs.executable>${project.basedir}/src/main/resources/webapp/node/node</sonar.nodejs.executable>
+ <sonar.sources>${project.basedir}/src/main,${project.basedir}/src/main/resources/webapp/js</sonar.sources>
+ <sonar.exclusions>src/main/resources/webapp/js/__test__/**</sonar.exclusions>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.onap.policy.common</groupId>
diff --git a/client/client-full/pom.xml b/client/client-full/pom.xml
index 2bd8e14..57ab778 100644
--- a/client/client-full/pom.xml
+++ b/client/client-full/pom.xml
@@ -32,6 +32,13 @@
<name>${project.artifactId}</name>
<description>Web clients for managing Apex engines</description>
+ <properties>
+ <webapp.dir>src/main/resources/webapp</webapp.dir>
+ <sonar.nodejs.executable>${project.basedir}/src/main/resources/webapp/node/node</sonar.nodejs.executable>
+ <sonar.sources>${project.basedir}/src/main,${project.basedir}/src/main/resources/webapp/js</sonar.sources>
+ <sonar.exclusions>src/main/resources/webapp/js/__test__/**,src/main/resources/webapp/js/jquery</sonar.exclusions>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.onap.policy.apex-pdp.client</groupId>
diff --git a/client/client-monitoring/pom.xml b/client/client-monitoring/pom.xml
index 91c1363..c493810 100644
--- a/client/client-monitoring/pom.xml
+++ b/client/client-monitoring/pom.xml
@@ -32,6 +32,13 @@
<name>${project.artifactId}</name>
<description>Web client for monitoring Apex engines</description>
+ <properties>
+ <webapp.dir>src/main/resources/webapp</webapp.dir>
+ <sonar.nodejs.executable>${project.basedir}/src/main/resources/webapp/node/node</sonar.nodejs.executable>
+ <sonar.sources>${project.basedir}/src/main,${project.basedir}/src/main/resources/webapp/js</sonar.sources>
+ <sonar.exclusions>src/main/resources/webapp/js/__test__/**,src/main/resources/webapp/js/avsc,src/main/resources/webapp/js/d3</sonar.exclusions>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.onap.policy.common</groupId>
diff --git a/pom.xml b/pom.xml
index d7dff80..4878a0a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,6 +50,7 @@
<version.jgroups>4.1.5.Final</version.jgroups>
<version.commons-codec>20041127.091804</version.commons-codec>
<version.caffeine>2.8.0</version.caffeine>
+ <sonar.javascript.lcov.reportPaths>${project.basedir}/target/code-coverage/lcov.info</sonar.javascript.lcov.reportPaths>
</properties>
<distributionManagement>