fix sonar job configuration 01/34801/2
authorMickael JEZEQUEL <mickael.jezequel@orange.com>
Thu, 8 Mar 2018 15:18:04 +0000 (16:18 +0100)
committerMickael JEZEQUEL <mickael.jezequel@orange.com>
Thu, 8 Mar 2018 15:59:06 +0000 (16:59 +0100)
Change-Id: I437da70e82fe970f8455bb45e9454959ec6cfc3c
Issue-ID: VNFSDK-39
Signed-off-by: Mickael JEZEQUEL <mickael.jezequel@orange.com>
.gitignore
ice-server/heat_test/app.py
ice-server/heat_test/test/test_api.py
ice-server/pom.xml
ice-server/setup.py
ice-server/tox.ini
validation-scripts/pom.xml
validation-scripts/tox.ini

index 1a479f6..252574b 100644 (file)
@@ -1,5 +1,6 @@
 # Byte-compiled / optimized / DLL files
 __pycache__/
+.pytest_cache/
 *.py[cod]
 *$py.class
 
index e982c68..c61150a 100644 (file)
@@ -7,25 +7,6 @@ import connexion
 from connexion.resolver import RestyResolver
 
 
-def parse_args():
-    """
-    parse argument parameters
-    """
-    parser = argparse.ArgumentParser(description='start the heat validation rest server')
-    parser.add_argument("--debug", help="increase output verbosity")
-    parser.add_argument("-p", "--port", type=int, help="listen port (default 5000)", default=5000)
-    args = parser.parse_args()
-    if args.debug:
-        logging.info("debug mode")
-        debug = True
-    else:
-        debug = False
-    if args.port:
-        port = args.port
-    else:
-        port = 5000
-
-
 def create_app():
     logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
     app = connexion.App(__name__, specification_dir='swagger/')
@@ -37,6 +18,7 @@ def create_app():
 
     return app
 
+
 def create_test_app():
     print("create_test_app")
     logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
index 259a43b..25f017b 100644 (file)
@@ -15,7 +15,7 @@ print(sys.path)
 
 import app as myapp
 
-ICE_URL = '/ice/'
+ICE_URL = '/onapapi/ice/v1/'
 
 flask_app = myapp.create_test_app()
 
index 3e6d2a5..26f8495 100644 (file)
@@ -30,9 +30,12 @@ under the License.
     <name>ice rest API</name>
     <description>rest API for HEAT template validation</description>
     <properties>
-      <sonar.language>py</sonar.language>
-      <sonar.pluginName>Python</sonar.pluginName>
-      <sonar.inclusions>**/*.py</sonar.inclusions>
-      <sonar.skip>false</sonar.skip>
+        <sonar.sources>.</sonar.sources>
+        <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>
+        <sonar.exclusions>version.py,setup.py</sonar.exclusions>
     </properties>
+
 </project>
index b4c5aea..eacf048 100644 (file)
@@ -20,8 +20,8 @@ import os
 from setuptools import setup, find_packages\r
 import sys\r
 \r
-if sys.version_info < (2, 7):\r
-    sys.exit('VNF SDK requires Python 2.7+')\r
+if sys.version_info < (3, 0):\r
+    sys.exit('VNF SDK requires Python 3.0+')\r
 \r
 root_dir = os.path.dirname(__file__)\r
 install_requires = []\r
index 8da170d..afae937 100644 (file)
 
 [tox]
 skipsdist=True
-envlist = py3
+envlist = py35
 
 [testenv]
 distribute = False
 commands =
    {envpython} --version
-   pytest
+   coverage run --module pytest heat_test
+   coverage xml
 deps = -rrequirements.txt
-
-[testenv:py3]
-basepython=python3.5
+    coverage
+    pytest-cov
index a08f8af..3b13708 100644 (file)
@@ -30,10 +30,12 @@ under the License.
     <name>vnfsdk-ice-scripts</name>
     <description>python scripts for HEAT template validation</description>
     <properties>
-      <sonar.language>py</sonar.language>
-      <sonar.pluginName>Python</sonar.pluginName>
-      <sonar.inclusions>**/*.py</sonar.inclusions>
-      <sonar.skip>false</sonar.skip>
+        <sonar.sources>.</sonar.sources>
+        <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>
+        <sonar.exclusions>version.py,setup.py</sonar.exclusions>
     </properties>
     <build>
       <plugins>
index 882140f..62964eb 100644 (file)
@@ -40,7 +40,7 @@
 
 [tox]
 skipsdist=True
-envlist = py27,py3,style
+envlist = py27,py35
 
 [testenv]
 distribute = False
@@ -48,16 +48,7 @@ commands =
    {envpython} --version
     pytest --version
     coverage run --module pytest ice_validator --self-test -rxXs
-    coverage report
+    coverage xml
 deps = -rrequirements.txt
-    flake8
     coverage
 
-[testenv:style]
-commands = flake8 ice_validator
-
-[testenv:py27]
-basepython=python2.7
-
-[testenv:py3]
-basepython=python3.6