Update Xtesting to 0.98
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,bashate,bandit,py310,cover,perm,pre-commit
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/master/upper-constraints.txt}
9   -r{toxinidir}/requirements.txt
10   -r{toxinidir}/test-requirements.txt
11 install_command = pip install --use-deprecated=legacy-resolver {opts} {packages}
12 commands =
13   pytest \
14     --junit-xml=junit.xml \
15     --html=report.html --self-contained-html \
16     --cov=xtesting --cov-reset --cov-report html \
17     functest/tests/unit
18
19 [testenv:docs]
20 basepython = python3.10
21 commands =
22   doc8 \
23     --ignore-path api/build \
24     --ignore-path docs/build \
25     --ignore-path docs/_build \
26     api \
27     docs
28   sphinx-build -W -b html api/ api/build
29   sphinx-build -W -n -b html docs docs/build/html
30   sphinx-build -W -n -b linkcheck docs docs/build/linkcheck
31   sphinx-build -W -b spelling -Dextensions=sphinxcontrib.spelling docs docs/build/spellcheck
32
33 [testenv:pep8]
34 basepython = python3.10
35 commands = flake8
36
37 [testenv:pylint]
38 basepython = python3.10
39 commands =
40   pylint \
41     --ignore-imports=y --min-similarity-lines=15 \
42     --generated-members=os.* \
43     --disable=locally-disabled functest
44
45 [testenv:yamllint]
46 basepython = python3.10
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:bashate]
60 basepython = python3.10
61 files =
62   functest/opnfv_tests/openstack/cinder/write_data.sh
63   functest/opnfv_tests/openstack/cinder/read_data.sh
64   functest/ci/add_proxy.sh
65   functest/ci/convert_images.sh
66   functest/ci/download_images.sh
67   build.sh
68 commands = bashate -e E005,E006,E042,E043 {[testenv:bashate]files}
69
70 [testenv:bandit]
71 basepython = python3.10
72 commands = bandit -r functest -x tests -n 5 -ll -s B601,B602
73
74 [testenv:cover]
75 basepython = python3.10
76 dirs =
77   functest/tests/unit/odl
78   functest/tests/unit/openstack/vping
79   functest/tests/unit/openstack/cinder
80 commands =
81   pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
82     {[testenv:cover]dirs}
83
84 [testenv:perm]
85 basepython = python3.10
86 allowlist_externals = sh
87 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*' -not -path './elements/functest/install.d/*'
88 commands =
89   sh -c "\
90     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
91     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
92   sh -c "\
93     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"
94
95 [testenv:pre-commit]
96 basepython = python3.10
97 commands =
98     pre-commit run --all-files --show-diff-on-failure