X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=tox.ini;h=6dc85e0e9f9438d8c32aaf96b3615ed42b35d578;hb=555e5727d1c818108ff255a1b9fe4542b768ad5c;hp=309296d82103fef33d7de8d02fc50f8dbc0e68ef;hpb=0b855c08fd98fb8fa0f4bc40d8df430c897b4bad;p=optf%2Fosdf.git diff --git a/tox.ini b/tox.ini index 309296d..6dc85e0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,46 @@ [tox] skipsdist=True -envlist = py3 +envlist = py3, pylint, flake8diff [testenv] distribute = False +basepython=python3 +setenv = + OSDF_CONFIG_FILE={toxinidir}/test/config/osdf_config.yaml commands = - coverage run --module pytest - coverage report --omit=".tox/py3/*","test/*" + /bin/cp config/slicing_config.yaml test/config/ + /bin/bash test/functest/scripts/start-simulators.sh + coverage run --module pytest --junitxml xunit-results.xml + coverage xml --omit=".tox/py3/*","test/*" + coverage report -m --omit=".tox/py3/*","test/*" + /bin/bash test/functest/scripts/stop-simulators.sh + /bin/rm test/config/slicing_config.yaml # TODO: need to update the above "omit" when we package osdf as pip-installable - # coverage html --omit=.tox/py3/* -d htmlcov -deps = -r{toxinidir}/requirements.txt +deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test/test-requirements.txt + -r{toxinidir}/requirements-osdf.txt + -r{toxinidir}/requirements-opteng.txt + +[run] +source=./apps/,./osdf/,osdfapp.py,./runtime/,solverapp.py + +[testenv:pylint] +whitelist_externals=bash +commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out" [testenv:py3] -basepython=python3.6 +basepython=python3 + +[testenv:flake8diff] +basepython=python3 +whitelist_externals=bash +deps = hacking>=2.0.0 +commands = + bash -c "files=$(git diff HEAD^ HEAD --diff-filter=d --name-only | grep -E '(^apps\/|osdf\/|runtime\/)'| grep -E '*\.py$'); if [[ -z $files ]]; then exit 0; else flake8 $files; fi" + +[flake8] +select = E,H,W,F +max-line-length = 119 +ignore = W503 #conflict with W504 +per-file-ignores=