Merge "Enforce self.details as a collection" into stable/2023.1
[functest-xtesting.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,bashate,py310,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/stable/2023.1/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.10
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.10
28 commands = flake8
29
30 [testenv:pylint]
31 basepython = python3.10
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.10
39 files =
40   .travis.yml
41   ansible
42   xtesting/ci
43 commands =
44   yamllint -s {[testenv:yamllint]files}
45
46 [testenv:bashate]
47 basepython = python3.10
48 files =
49   build.sh
50 commands = bashate {[testenv:bashate]files}
51
52 [testenv:bandit]
53 basepython = python3.10
54 commands = bandit -r xtesting -x tests -n 5 -ll -s B602
55
56 [testenv:cover]
57 basepython = python3.10
58 dirs =
59   xtesting/tests/unit/ci
60   xtesting/tests/unit/core
61   xtesting/tests/unit/utils/test_decorators.py
62 commands =
63   pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
64     {[testenv:cover]dirs}
65
66 [testenv:perm]
67 basepython = python3.10
68 allowlist_externals = bash
69 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './doc/reveal.js/*' -not -path './elements/xtesting/install.d/*'
70 commands =
71   bash -c "\
72     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
73     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
74   bash -c "\
75     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"
76
77 [testenv:pre-commit]
78 basepython = python3.10
79 commands =
80     pre-commit run --all-files --show-diff-on-failure