summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 77778e86cfcbc5b39460f3990f43291f003df357 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
[tox]
minversion = 3.1.0
skipsdist = True
envlist = py3,pep8
ignore_basepython_conflict=true

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
basepython = python3
setenv = VIRTUAL_ENV={envdir}
         PYTHONDONTWRITEBYTECODE = 1
         LANGUAGE=en_US
         LC_ALL=en_US.UTF-8
         PYTHONWARNINGS=default::DeprecationWarning
         TESTS_DIR=./ironic/tests/unit/
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/test-requirements.txt
commands =
    stestr run {posargs}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY

[testenv:unit-with-driver-libs-python3]
deps = {[testenv]deps}
    -r{toxinidir}/driver-requirements.txt

[testenv:genstates]
deps = {[testenv]deps}
    pydot2
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg

[testenv:pep8]
whitelist_externals = bash
commands =
  bash tools/flake8wrap.sh {posargs}
  # Run bashate during pep8 runs to ensure violations are caught by
  # the check and gate queues.
  {toxinidir}/tools/run_bashate.sh {toxinidir}
  # Check the *.rst files
  doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
  # Check to make sure reno releasenotes created with 'reno new'
  {toxinidir}/tools/check-releasenotes.py

[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
         LANGUAGE=en_US
         PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
commands =
  coverage erase
  stestr run {posargs}
  coverage combine
  coverage report --omit='*tests*'
  coverage html -d ./cover --omit='*tests*'

[testenv:genconfig]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
  oslo-config-generator --config-file=tools/config/ironic-config-generator.conf

[testenv:genpolicy]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
  oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf

[testenv:debug]
commands = oslo_debug_helper -t ironic/tests/unit {posargs}

[testenv:docs]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
  -r{toxinidir}/driver-requirements.txt
commands = sphinx-build -b html -W doc/source doc/build/html

[testenv:pdf-docs]
whitelist_externals = make
deps = {[testenv:docs]deps}
commands =
  sphinx-build -W -b latex doc/source doc/build/pdf
  make -C doc/build/pdf


[testenv:api-ref]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
whitelist_externals = bash
commands =
  bash -c 'rm -rf api-ref/build'
  sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html

[testenv:releasenotes]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:venv]
setenv = PYTHONHASHSEED=0
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands = {posargs}

[flake8]
# [W503] Line break before binary operator.
# NOTE(TheJulia): Adding W606 to the ignore list
# until we are able to remove them due to deprecation
# period passing. Patch merged in March 2018 to rename
# method arguments from reserved keywords.
ignore = E129,W503,W606
filename = *.py,app.wsgi
exclude =  .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
application-import-names = ironic
max-complexity=18
# [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

[hacking]
local-check-factory = ironic.hacking.checks.factory
import_exceptions = testtools.matchers, ironic.common.i18n

[testenv:lower-constraints]
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt

[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml