Fix 1473 and add vca_model_config_* to lcm charm
[osm/devops.git] / installers / charm / pla / tox.ini
index 1f9442e..30e0ea8 100644 (file)
 #######################################################################################
 
 [tox]
-envlist = flake8, cover, pylint, safety, yamllint
-skipsdist = True
+envlist = black, cover, flake8, pylint, yamllint, safety
+skipsdist = true
+
+[tox:jenkins]
+toxworkdir = /tmp/.tox
 
 [testenv]
 basepython = python3.8
-setenv =
-  VIRTUAL_ENV={envdir}
-  PYTHONHASHSEED=0
-  PYTHONPATH = {toxinidir}/src
+setenv = VIRTUAL_ENV={envdir}
+         PYTHONDONTWRITEBYTECODE = 1
 deps =  -r{toxinidir}/requirements.txt
 
+
+#######################################################################################
+[testenv:black]
+deps = black
+commands =
+        black --check --diff src/ tests/
+
+
 #######################################################################################
 [testenv:cover]
 deps =  {[testenv]deps}
         -r{toxinidir}/requirements-test.txt
+        coverage
+        nose2
 commands =
         sh -c 'rm -f nosetests.xml'
         coverage erase
@@ -45,36 +56,34 @@ commands =
         coverage xml -o coverage.xml --omit=*tests*
 whitelist_externals = sh
 
-#######################################################################################
-[testenv:safety]
-setenv =
-        LC_ALL=C.UTF-8
-        LANG=C.UTF-8
-deps =  {[testenv]deps}
-        -r{toxinidir}/requirements-test.txt
-commands =
-        - safety check --full-report
 
 #######################################################################################
 [testenv:flake8]
-deps = flake8
+deps =  flake8
+        flake8-import-order
 commands =
         flake8 src/ tests/
 
+
 #######################################################################################
 [testenv:pylint]
 deps =  {[testenv]deps}
         -r{toxinidir}/requirements-test.txt
         pylint
 commands =
-    pylint -E src
+    pylint -E src/ tests/
+
 
 #######################################################################################
-[testenv:black]
+[testenv:safety]
+setenv =
+        LC_ALL=C.UTF-8
+        LANG=C.UTF-8
 deps =  {[testenv]deps}
-        -r{toxinidir}/requirements-test.txt
-        black
-commands =  black --check --diff . --exclude "build/|.tox/|mod/|lib/"
+        safety
+commands =
+        - safety check --full-report
+
 
 #######################################################################################
 [testenv:yamllint]
@@ -86,9 +95,7 @@ commands = yamllint .
 #######################################################################################
 [testenv:build]
 passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY
-deps =  {[testenv]deps}
-        -r{toxinidir}/requirements-test.txt
-        charmcraft
+deps = charmcraft
 whitelist_externals =
   charmcraft
   cp
@@ -112,4 +119,5 @@ exclude =
 max-line-length = 120
 show-source = True
 builtins = _
-
+max-complexity = 10
+import-order-style = google