aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2021-11-01 15:12:48 +0000
committersaul.gill <saul.gill@est.tech>2021-11-02 12:51:36 +0000
commit3ce3724d46c0c1d4d13613b1920e3da858117e23 (patch)
treeeb143b91828ec27f7a295aa70084ec4187d91ccb
parent28d5047cecd111e380fe78d2d1d7e4756b78ed12 (diff)
Adding gui-clamp coverage to sonar
Added sonar properties to pom.xml Added jest sonar properties to package.json Issue-ID: POLICY-3804 Change-Id: I1b5bc67bc5457661ed56fdfe4d7fd260282f664b Signed-off-by: saul.gill <saul.gill@est.tech>
-rw-r--r--gui-clamp/pom.xml3
-rw-r--r--gui-clamp/ui-react/package.json13
2 files changed, 14 insertions, 2 deletions
diff --git a/gui-clamp/pom.xml b/gui-clamp/pom.xml
index d9cd62c..01978fb 100644
--- a/gui-clamp/pom.xml
+++ b/gui-clamp/pom.xml
@@ -33,6 +33,9 @@
<ui.react.src>ui-react</ui.react.src>
<ui.react.lib.src>ui-react-lib</ui.react.lib.src>
<npm.publish.url>https://nexus3.onap.org/repository/npm.snapshot/</npm.publish.url>
+ <sonar.nodejs.executable>${project.build.directory}/ui-react/node/node</sonar.nodejs.executable>
+ <sonar.sources>${project.basedir}/ui-react/src</sonar.sources>
+ <sonar.exclusions>**/*.test.js</sonar.exclusions>
</properties>
<build>
<plugins>
diff --git a/gui-clamp/ui-react/package.json b/gui-clamp/ui-react/package.json
index 13d830e..a20c7f4 100644
--- a/gui-clamp/ui-react/package.json
+++ b/gui-clamp/ui-react/package.json
@@ -54,7 +54,8 @@
"history": "5.0.0",
"jest": "26.6.0",
"jest-canvas-mock": "2.3.1",
- "jest-fetch-mock": "3.0.3"
+ "jest-fetch-mock": "3.0.3",
+ "jest-sonar-reporter": "2.0.0"
},
"browserslist": [
">0.2%",
@@ -64,10 +65,12 @@
],
"jest": {
"verbose": true,
- "coverageDirectory": "${project.build.directory}/${ui.react.src}/coverage",
+ "collectCoverage": true,
+ "coverageDirectory": "${project.build.directory}/code-coverage",
"collectCoverageFrom": [
"**/*.{js,jsx}"
],
+ "testResultsProcessor": "jest-sonar-reporter",
"rootDir": "${project.build.directory}/${ui.react.src}",
"coverageReporters": [
"lcov"
@@ -83,6 +86,12 @@
"enzyme-to-json/serializer"
]
},
+ "jestSonar": {
+ "reportPath": "../../target/reports",
+ "reportFile": "test-reporter.xml",
+ "indent": 4,
+ "sonar56x": true
+ },
"babel": {
"presets": [
"@babel/preset-env",