forked from canonical/hotsos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
97 lines (85 loc) · 3.08 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[tox]
skipsdist = True
envlist = py3-coverage,coveragereport,pep8,pylint,bashate,yamllint,functional,hotyvalidate
minversion = 3.18.0
[flake8]
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions = H106,H203,H204,H205,H904
show-source = true
exclude = ./.*,build,dist,tests/unit/fake_data_root
import-order-style = pep8
[coverage:run]
parallel = True
branch = True
source = hotsos
omit = tests/*
[coverage:report]
ignore_errors = True
skip_empty = True
precision = 2
fail_under = 84
[testenv]
basepython = {env:TOX_PYTHON:python3}
unit_tests = {toxinidir}/tests/unit/
passenv =
TESTS_LOG_LEVEL_DEBUG
TESTS_LOG_TEST_ARTIFACTS
pyfiles =
{toxinidir}/setup.py {toxinidir}/hotsos {[testenv]unit_tests} {toxinidir}/tools/validation
setenv =
HOTSOS_ROOT={toxinidir}/hotsos
PYTHONHASHSEED=0
TESTS_DIR={[testenv]unit_tests}
non-utc-tz: TZ=EST+5
# Override the default coverage output path to tox's temp directory
# so we don't pollute the root dir.
COVERAGE_FILE={temp_dir}/.coverage
# Override the default "PYTHON" when the "-coverage" is present.
# This allows us to run additional steps on top of the default
# test run, such as changing the default interpreter to "coverage run".
coverage: PYTHON=coverage run
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
coverage: coverage erase
# This environment can "optionally" gather coverage data with "-coverage"
# suffix. The gathered coverage data is consumed by the "coverage"
# environment which merges the data and then generates coverage reports in
# HTML and XML formats.
stestr run --random --slowest --test-path {[testenv]unit_tests} {posargs}
[testenv:pep8]
commands = flake8 -v --exclude=fake_data_root {posargs:{[testenv]pyfiles}}
[testenv:pylint]
commands = pylint -v --rcfile={toxinidir}/pylintrc {posargs:{[testenv]pyfiles}}
[testenv:coveragereport]
depends = py3-coverage
description =
'Generate code coverage reports from collected coverage information.
This environment depends on `py3-coverage` for generating the actual
code coverage data from the test run. To collect and generate in a
single step, run `tox -e py3-coverage,coveragereport`.'
commands =
coverage combine
coverage report
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage erase
[testenv:docs]
commands = sphinx-build -j auto -d {toxinidir}/doc/build/doctrees -b html {toxinidir}/doc/source doc/build/html
[testenv:bashate]
commands = bashate --verbose {toxinidir}/tools/test/functest.sh
[testenv:yamllint]
commands = yamllint -c yamllintrc {toxinidir}/hotsos {toxinidir}/tests {posargs}
[testenv:functional]
allowlist_externals = bash
commands = bash {toxinidir}/tools/test/functest.sh
[testenv:hotyvalidate]
setenv = PYTHONPATH={toxinidir}
{[testenv]setenv}
commands =
python3 tools/validation/hotyvalidate.py