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