summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael JEZEQUEL <mickael.jezequel@orange.com>2018-03-08 16:18:04 +0100
committerMickael JEZEQUEL <mickael.jezequel@orange.com>2018-03-08 16:59:06 +0100
commitdd79a38607c40db86de950b4c1ecdff443fe68f4 (patch)
tree8c21a18c1aa365b1ea8fbe779e7be331ab56550d
parentb2727af1d234bae3e64cf31a0af3dfee2d1c91f8 (diff)
fix sonar job configuration
Change-Id: I437da70e82fe970f8455bb45e9454959ec6cfc3c Issue-ID: VNFSDK-39 Signed-off-by: Mickael JEZEQUEL <mickael.jezequel@orange.com>
-rw-r--r--.gitignore1
-rw-r--r--ice-server/heat_test/app.py20
-rw-r--r--ice-server/heat_test/test/test_api.py2
-rw-r--r--ice-server/pom.xml11
-rw-r--r--ice-server/setup.py4
-rw-r--r--ice-server/tox.ini10
-rw-r--r--validation-scripts/pom.xml10
-rw-r--r--validation-scripts/tox.ini13
8 files changed, 25 insertions, 46 deletions
diff --git a/.gitignore b/.gitignore
index 1a479f6..252574b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
# Byte-compiled / optimized / DLL files
__pycache__/
+.pytest_cache/
*.py[cod]
*$py.class
diff --git a/ice-server/heat_test/app.py b/ice-server/heat_test/app.py
index e982c68..c61150a 100644
--- a/ice-server/heat_test/app.py
+++ b/ice-server/heat_test/app.py
@@ -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')
diff --git a/ice-server/heat_test/test/test_api.py b/ice-server/heat_test/test/test_api.py
index 259a43b..25f017b 100644
--- a/ice-server/heat_test/test/test_api.py
+++ b/ice-server/heat_test/test/test_api.py
@@ -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()
diff --git a/ice-server/pom.xml b/ice-server/pom.xml
index 3e6d2a5..26f8495 100644
--- a/ice-server/pom.xml
+++ b/ice-server/pom.xml
@@ -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>
diff --git a/ice-server/setup.py b/ice-server/setup.py
index b4c5aea..eacf048 100644
--- a/ice-server/setup.py
+++ b/ice-server/setup.py
@@ -20,8 +20,8 @@ import os
from setuptools import setup, find_packages
import sys
-if sys.version_info < (2, 7):
- sys.exit('VNF SDK requires Python 2.7+')
+if sys.version_info < (3, 0):
+ sys.exit('VNF SDK requires Python 3.0+')
root_dir = os.path.dirname(__file__)
install_requires = []
diff --git a/ice-server/tox.ini b/ice-server/tox.ini
index 8da170d..afae937 100644
--- a/ice-server/tox.ini
+++ b/ice-server/tox.ini
@@ -40,14 +40,14 @@
[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
diff --git a/validation-scripts/pom.xml b/validation-scripts/pom.xml
index a08f8af..3b13708 100644
--- a/validation-scripts/pom.xml
+++ b/validation-scripts/pom.xml
@@ -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>
diff --git a/validation-scripts/tox.ini b/validation-scripts/tox.ini
index 882140f..62964eb 100644
--- a/validation-scripts/tox.ini
+++ b/validation-scripts/tox.ini
@@ -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