Downgrade to setuptools_scm===5.0.1
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,ansiblelint,bashate,bandit,py27,py36,cover,perm
3
4 [testenv]
5 pip_version = pip==20.2.4
6 usedevelop = True
7 deps =
8   -c{toxinidir}/upper-constraints.txt
9   -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt}
10   -r{toxinidir}/requirements.txt
11   -r{toxinidir}/test-requirements.txt
12 install_command = pip install {opts} {packages}
13 commands = nosetests --with-xunit \
14   --with-coverage \
15   --cover-tests \
16   --cover-package=functest \
17   --cover-xml \
18   --cover-html \
19   functest/tests/unit
20
21 [testenv:docs]
22 basepython = python3.6
23 commands =
24   doc8 \
25     --ignore-path api/build \
26     --ignore-path docs/build \
27     --ignore-path docs/_build \
28     api \
29     docs
30   sphinx-build -W -b html api/ api/build
31   sphinx-build -W -n -b html docs docs/build/html
32   sphinx-build -W -n -b linkcheck docs docs/build/linkcheck
33   sphinx-build -W -b spelling -Dextensions=sphinxcontrib.spelling docs docs/build/spellcheck
34
35 [testenv:pep8]
36 basepython = python3.6
37 commands = flake8
38
39 [testenv:pylint]
40 basepython = python3.6
41 commands =
42   pylint \
43     --ignore-imports=y --min-similarity-lines=10 \
44     --disable=locally-disabled functest
45
46 [testenv:yamllint]
47 basepython = python3.6
48 files =
49   .travis.yml
50   docker
51   functest/ci
52   functest/opnfv_tests/openstack/rally/blacklist.yaml
53   functest/opnfv_tests/openstack/rally/rally_jobs.yaml
54   functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.yaml
55   functest/opnfv_tests/openstack/tempest/custom_tests/tempest_conf.yaml
56   functest/opnfv_tests/vnf
57 commands =
58   yamllint -s {[testenv:yamllint]files}
59
60 [testenv:ansiblelint]
61 basepython = python3.6
62 commands =
63   ansible-lint -x303 ansible/site.yml
64
65 [testenv:py36]
66 commands = nosetests functest/tests/unit
67
68 [testenv:bashate]
69 basepython = python3.6
70 files =
71   functest/opnfv_tests/openstack/cinder/write_data.sh
72   functest/opnfv_tests/openstack/cinder/read_data.sh
73   functest/ci/add_proxy.sh
74   functest/ci/convert_images.sh
75   functest/ci/download_images.sh
76   build.sh
77 commands = bashate -e E005,E006,E042,E043 {[testenv:bashate]files}
78
79
80 [testenv:bandit]
81 basepython = python3.6
82 commands = bandit -r functest -x tests -n 5 -ll -s B601,B602
83
84 [testenv:cover]
85 basepython = python3.6
86 dirs =
87   functest/tests/unit/odl
88   functest/tests/unit/openstack/vping
89   functest/tests/unit/openstack/cinder
90 commands = nosetests --with-coverage --cover-tests \
91   --cover-package functest.opnfv_tests.sdn.odl \
92   --cover-package functest.opnfv_tests.openstack.vping.vping_ssh \
93   --cover-package functest.opnfv_tests.openstack.cinder.cinder_test \
94   --cover-package functest.tests.unit \
95   --cover-min-percentage 100 {[testenv:cover]dirs}
96
97 [testenv:perm]
98 basepython = python3.6
99 whitelist_externals = bash
100 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
101 commands =
102   bash -c "\
103     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
104     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
105   bash -c "\
106     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"