From: Mahesh Jethanandani Date: Tue, 21 Dec 2021 21:38:50 +0000 (-0800) Subject: Add static code analysis tool for smo/ves repository X-Git-Tag: 6.0.2~26 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F7446%2F2;p=smo%2Fves.git Add static code analysis tool for smo/ves repository Issue-ID: SMO-42 Change-Id: I4d4cdeca57476265e34bd22f92d18160a4036b7d Signed-off-by: Mahesh Jethanandani --- diff --git a/tox.ini b/tox.ini index 72742cf..60ef6b2 100644 --- 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