Make SONAR code coverage work 09/32609/1
authorAndrew Gauld <ag1282@att.com>
Thu, 22 Feb 2018 19:55:37 +0000 (14:55 -0500)
committerAndrew Gauld <ag1282@att.com>
Thu, 22 Feb 2018 19:56:35 +0000 (14:56 -0500)
Change-Id: Id54f9199d4ac7a1a501a875743fa35aecbe60ac4
Issue-ID: DCAEGEN2-355
Signed-off-by: Andrew Gauld <ag1282@att.com>
dmaap/tox.ini
dnsdesig/pom.xml
dnsdesig/tox.ini
pgaas/pom.xml
pgaas/tox.ini
pom.xml
sshkeyshare/pom.xml
sshkeyshare/tox.ini

index 9498c82..9a23f83 100644 (file)
 envlist = py27
 [testenv]
 deps=
-    pytest
-    cloudify==3.4
     requests
-commands=pytest
+    cloudify==3.4
+    pytest
+    coverage
+    pytest-cov
+setenv =
+    PYTHONPATH={toxinidir}
+commands=
+    pytest --junitxml xunit-results.xml --cov dmaapcontrollerif --cov consulif --cov dmaapplugin --cov-report xml
+    coverage xml
index 9306540..2d96e81 100644 (file)
@@ -44,19 +44,12 @@ limitations under the License.
     <typefile.dest>type_files/dnsdesig/dns_types.yaml</typefile.dest>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <sonar.sources>.</sonar.sources>
-    <!-- customize the SONARQUBE URL -->
-    <sonar.host.url>http://localhost:9000</sonar.host.url>
-    <!-- below are language dependent -->
-    <!-- for Python -->
+    <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>
-    <!-- for JavaScaript -->
-    <!--
-    <sonar.language>js</sonar.language>
-    <sonar.pluginName>JS</sonar.pluginName>
-    <sonar.inclusions>**/*.js</sonar.inclusions>
-    -->
+    <sonar.exclusions>tests/*,setup.py</sonar.exclusions>
   </properties>
 
   <build>
index 9498c82..0b0f114 100644 (file)
 envlist = py27
 [testenv]
 deps=
-    pytest
-    cloudify==3.4
     requests
-commands=pytest
+    cloudify==3.4
+    pytest
+    coverage
+    pytest-cov
+setenv=
+    PYTHONPATH={toxinidir}
+commands=
+    pytest --junitxml xunit-results.xml --cov dnsdesig --cov-report xml
+    coverage xml
index 6fcebdd..d9504e7 100644 (file)
@@ -43,24 +43,13 @@ limitations under the License.
     <!-- path, in repo, to store type file -->
     <typefile.dest>type_files/pgaas/pgaas_types.yaml</typefile.dest>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <sonar.skip>true</sonar.skip>
     <sonar.sources>.</sonar.sources>
-    <!-- customize the SONARQUBE URL -->
-    <sonar.host.url>http://localhost:9000</sonar.host.url>
-    <sonar.junit.reportsPath>**/xunit-results.xml</sonar.junit.reportsPath>
-    <sonar.python.coverage.reportPath>**/coverage.xml</sonar.python.coverage.reportPath>
-    <sonar.exclusions>tests/*</sonar.exclusions>
-    <!-- below are language dependent -->
-    <!-- for Python -->
+    <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>
-    <!-- for JavaScaript -->
-    <!--
-    <sonar.language>js</sonar.language>
-    <sonar.pluginName>JS</sonar.pluginName>
-    <sonar.inclusions>**/*.js</sonar.inclusions>
-    -->
+    <sonar.exclusions>tests/*,setup.py</sonar.exclusions>
   </properties>
 
   <build>
index 28f1f3f..76daae0 100644 (file)
 envlist = py27
 [testenv]
 deps=
-    pytest
-    cloudify==3.4
     requests
+    cloudify==3.4
+    pytest
     coverage
     pytest-cov
-commands=pytest --junitxml xunit-results.xml --cov {envsitepackagesdir}/pgaas --cov-report xml --cov-report html
+setenv=
+    PYTHONPATH={toxinidir}
+commands=
+    pytest --junitxml xunit-results.xml --cov pgaas --cov-report xml
+    coverage xml
diff --git a/pom.xml b/pom.xml
index 5551520..acebb69 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -36,5 +36,10 @@ limitations under the License.
      <module>pgaas</module>
      <module>dnsdesig</module>
   </modules>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <sonar.host.url>http://localhost:9000</sonar.host.url>
+    <sonar.exclusions>**/*.py</sonar.exclusions>
+  </properties>
 
 </project>
index 06fc8df..c3e6b6b 100644 (file)
@@ -44,19 +44,12 @@ limitations under the License.
     <typefile.dest>type_files/sshkeyshare/sshkey_types.yaml</typefile.dest>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <sonar.sources>.</sonar.sources>
-    <!-- customize the SONARQUBE URL -->
-    <sonar.host.url>http://localhost:9000</sonar.host.url>
-    <!-- below are language dependent -->
-    <!-- for Python -->
+    <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>
-    <!-- for JavaScaript -->
-    <!--
-    <sonar.language>js</sonar.language>
-    <sonar.pluginName>JS</sonar.pluginName>
-    <sonar.inclusions>**/*.js</sonar.inclusions>
-    -->
+    <sonar.exclusions>tests/*,setup.py</sonar.exclusions>
   </properties>
 
   <build>
index 3a6c714..29b7a45 100644 (file)
@@ -2,6 +2,12 @@
 envlist = py27
 [testenv]
 deps=
-    pytest
     cloudify==3.4
-commands=pytest
+    pytest
+    coverage
+    pytest-cov
+setenv=
+    PYTHONPATH={toxinidir}
+commands=
+    pytest --junitxml xunit-results.xml --cov sshkeyshare --cov-report xml
+    coverage xml