From a2481ab45f356782b6fd171c04fcbc2cf2f0f3df Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Tue, 21 Dec 2021 13:38:50 -0800 Subject: [PATCH] Add static code analysis tool for smo/ves repository Issue-ID: SMO-42 Change-Id: I4d4cdeca57476265e34bd22f92d18160a4036b7d Signed-off-by: Mahesh Jethanandani --- tox.ini | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 -- 2.16.6