Merge "Dump the play part from katacoda scenatio too"
[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 pip_version = pip==20.2.4
7 usedevelop = True
8 deps =
9   -c{toxinidir}/upper-constraints.txt
10   -chttps://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt
11   -r{toxinidir}/requirements.txt
12   -r{toxinidir}/test-requirements.txt
13 install_command = pip install {opts} {packages}
14 commands =
15   pytest \
16     --junit-xml=junit.xml \
17     --html=report.html --self-contained-html \
18     --cov=xtesting --cov-reset --cov-report html \
19     xtesting/tests/unit
20
21 [testenv:docs]
22 basepython = python3.10
23 commands =
24   doc8 README.rst api --ignore-path api/build
25   sphinx-build -W -b html api/ api/build
26
27 [testenv:pep8]
28 basepython = python3.10
29 commands = flake8
30
31 [testenv:pylint]
32 basepython = python3.10
33 allowlist_externals = bash
34 commands =
35   pylint --min-similarity-lines=10 \
36     --disable=locally-disabled --ignore-imports=y --reports=n --extension-pkg-whitelist=lxml xtesting
37
38 [testenv:yamllint]
39 basepython = python3.10
40 files =
41   .travis.yml
42   ansible
43   xtesting/ci
44 commands =
45   yamllint -s {[testenv:yamllint]files}
46
47 [testenv:bashate]
48 basepython = python3.10
49 files =
50   build.sh
51 commands = bashate {[testenv:bashate]files}
52
53 [testenv:bandit]
54 basepython = python3.10
55 commands = bandit -r xtesting -x tests -n 5 -ll -s B602
56
57 [testenv:cover]
58 basepython = python3.10
59 dirs =
60   xtesting/tests/unit/ci
61   xtesting/tests/unit/core
62   xtesting/tests/unit/utils/test_decorators.py
63 commands =
64   pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
65     {[testenv:cover]dirs}
66
67 [testenv:perm]
68 basepython = python3.10
69 allowlist_externals = bash
70 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './doc/reveal.js/*' -not -path './elements/xtesting/install.d/*'
71 commands =
72   bash -c "\
73     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
74     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
75   bash -c "\
76     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"
77
78 [testenv:pre-commit]
79 basepython = python3.10
80 commands =
81     pre-commit run --all-files --show-diff-on-failure