Add no:cacheprovider by default
[functest-xtesting.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,bashate,bandit,py312,cover,perm,pre-commit
3 skipsdist = True
4
5 [testenv]
6 usedevelop = True
7 deps =
8   -c{toxinidir}/upper-constraints.txt
9   -chttps://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     xtesting/tests/unit
19
20 [testenv:docs]
21 basepython = python3.12
22 commands =
23   doc8 README.rst api --ignore-path api/build
24   sphinx-build -W -b html api/ api/build
25
26 [testenv:pep8]
27 basepython = python3.12
28 commands = flake8
29
30 [testenv:pylint]
31 basepython = python3.12
32 allowlist_externals = bash
33 commands =
34   pylint --min-similarity-lines=10 \
35     --disable=locally-disabled --ignore-imports=y --reports=n --extension-pkg-whitelist=lxml xtesting
36
37 [testenv:yamllint]
38 basepython = python3.12
39 files = .travis.yml ansible xtesting/ci
40 commands =
41   yamllint -s {[testenv:yamllint]files}
42
43 [testenv:bashate]
44 basepython = python3.12
45 files =
46   build.sh
47 commands = bashate {[testenv:bashate]files}
48
49 [testenv:bandit]
50 basepython = python3.12
51 commands = bandit -r xtesting -x tests -n 5 -ll -s B602
52
53 [testenv:cover]
54 basepython = python3.12
55 dirs = xtesting/tests/unit/ci xtesting/tests/unit/core xtesting/tests/unit/utils/test_decorators.py
56 commands =
57   pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
58     {[testenv:cover]dirs}
59
60 [testenv:perm]
61 basepython = python3.12
62 allowlist_externals = bash
63 path=. -prune -not -path './.tox' -not -path './.git' -not -path './doc/reveal.js' \
64   -not -path './elements/xtesting/install.d' -not -name '*.pyc' -not -name '__pycache__' \
65   -not -path './doc/api/build'
66 commands =
67   bash -c "\
68     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
69     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
70   bash -c "\
71     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"
72
73 [testenv:pre-commit]
74 basepython = python3.12
75 commands =
76     pre-commit run --all-files --show-diff-on-failure