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