Added sonar coverage report 83/36883/1
authorLianhao Lu <lianhao.lu@intel.com>
Tue, 20 Mar 2018 01:26:54 +0000 (09:26 +0800)
committerLianhao Lu <lianhao.lu@intel.com>
Tue, 20 Mar 2018 01:26:54 +0000 (09:26 +0800)
Adjusted the tox settings to generate the unit test coverage report to
be used by sonar.

Change-Id: I825b1770f1a27ceaafde181ce9d7cd44882e70c6
Issue-ID: VNFSDK-210
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
pom.xml
tox.ini

diff --git a/pom.xml b/pom.xml
index d6cfc3d..7e7fa24 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -27,11 +27,13 @@ under the License.
     </parent>
 
     <groupId>org.onap.vnfsdk.pkgtools</groupId>
-    <artifactId>vnf-sdk-pkgtools</artifactId>
+    <artifactId>vnfsdk-pkgtools</artifactId>
 
     <name>vnfsdk-pkgtools</name>
     <description>CSAR manipulation shared library with CLI</description>
     <properties>
+        <sonar.junit.reportsPath>xunit-results.xml</sonar.junit.reportsPath>
+        <sonar.python.coverage.reportPath>coverage.xml</sonar.python.coverage.reportPath>
         <sonar.language>py</sonar.language>
         <sonar.pluginName>Python</sonar.pluginName>
         <sonar.inclusions>**/*.py</sonar.inclusions>
diff --git a/tox.ini b/tox.ini
index 6e0b55c..393ea42 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -32,6 +32,9 @@ basepython =
   py27: python2.7
 
 [testenv:py27]
-commands = 
-       pytest tests --cov-report term-missing --cov packager --cov cli
+commands =
+        coverage run --module pytest --junitxml xunit-results.xml
+        coverage xml --omit=".tox/py27/*","tests/*"
+        coverage report --omit=".tox/py27/*","tests/*"
+       #pytest tests --cov-report term-missing --cov packager --cov cli