Add static code analysis tool for smo/ves repository 46/7446/2
authorMahesh Jethanandani <mjethanandani@gmail.com>
Tue, 21 Dec 2021 21:38:50 +0000 (13:38 -0800)
committerMahesh Jethanandani <mjethanandani@gmail.com>
Tue, 11 Jan 2022 17:29:39 +0000 (17:29 +0000)
Issue-ID: SMO-42

Change-Id: I4d4cdeca57476265e34bd22f92d18160a4036b7d
Signed-off-by: Mahesh Jethanandani <mjethanandani@gmail.com>
tox.ini

diff --git a/tox.ini b/tox.ini
index 72742cf..60ef6b2 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
-# documentation only
 [tox]
 minversion = 2.0
 envlist =
+    code,
     docs,
     docs-linkcheck,
 skipsdist = true
@@ -28,3 +28,20 @@ deps = sphinx
        recommonmark
        lfdocs-conf
 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
+
+[testenv:code]
+basepython = python3
+deps=
+  pytest
+  coverage
+  pytest-cov
+# Add any environment variables to run this code coverage test
+# setenv =
+# Note, before this will work, for the first time on that machine,
+# run ./install_deps.sh
+# sometimes the -s flag is helpful; add -s after pytest;
+# which streams the logs as they come in, rather than saving them
+# all for the end of tests
+commands =
+  pytest --cov dir-name --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml
+  coverage xml -i
\ No newline at end of file