Merge "Fix osdf csit failure by fixing logging"
[optf/osdf.git] / tox.ini
1
2 [tox]
3 skipsdist=True
4 envlist = py3, pylint, flake8diff
5
6 [testenv]
7 distribute = False
8 basepython=python3
9 setenv   =
10     OSDF_CONFIG_FILE={toxinidir}/test/config/osdf_config.yaml
11 commands =
12     /bin/cp config/slicing_config.yaml test/config/
13     /bin/cp config/slicing_config.yaml test/functest/simulators/simulated-config/
14     /bin/bash test/functest/scripts/start-simulators.sh
15     coverage run --module pytest --junitxml xunit-results.xml
16     coverage xml --omit=".tox/py3/*","test/*"
17     coverage report -m --omit=".tox/py3/*","test/*"
18     /bin/bash test/functest/scripts/stop-simulators.sh
19     /bin/rm test/config/slicing_config.yaml
20     /bin/rm test/functest/simulators/simulated-config/slicing_config.yaml
21     # TODO: need to update the above "omit" when we package osdf as pip-installable
22 deps = -r{toxinidir}/requirements.txt
23     -r{toxinidir}/test/test-requirements.txt
24     -r{toxinidir}/requirements-osdf.txt
25     -r{toxinidir}/requirements-opteng.txt
26
27 [run]
28 source=./apps/,./osdf/,osdfapp.py,./runtime/,solverapp.py
29
30 [testenv:pylint]
31 whitelist_externals=bash
32 commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out"
33
34 [testenv:py3]
35 basepython=python3.6
36
37 [testenv:flake8diff]
38 basepython=python3.6
39 whitelist_externals=bash
40 deps = hacking>=2.0.0
41 commands =
42   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"
43
44 [flake8]
45 select = E,H,W,F
46 max-line-length = 119
47 ignore = W503   #conflict with W504
48 per-file-ignores=