forked from openstack/monasca-log-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
162 lines (142 loc) · 4.38 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[tox]
envlist = py{27,35},pep8,cover
minversion = 2.7
skipsdist = True
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=monasca_log_api/tests
passenv = *_proxy
*_PROXY
whitelist_externals = bash
find
rm
install_command = pip install {opts} {packages}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
find ./ -type f -name '*.pyc' -delete
rm -Rf .testrepository/times.dbm
[testenv:py27]
description = Runs unit test using Python2.7
basepython = python2.7
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:py35]
description = Runs unit test using Python3.5
basepython = python3.5
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:cover]
description = Calculates code coverage
basepython = python2.7
commands =
{[testenv]commands}
coverage erase
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_log_api
coverage report
[testenv:debug]
description = Allows to run unit-test with debug mode enabled
commands =
{[testenv]commands}
oslo_debug_helper -t {toxinidir}/monasca_log_api/tests {posargs}
[testenv:bashate]
description = Validates (pep8-like) devstack plugins
skip_install = True
usedevelop = False
commands = bash {toxinidir}/tools/bashate.sh {toxinidir}/devstack
[testenv:bandit]
description = Validates codebase with bandit
skip_install = True
usedevelop = False
commands =
# FIXME(dmllr); B101 needs to be fixed first
bandit -r monasca_log_api -n5 -s B101 -x monasca_log_api/tests
[testenv:pep8]
description = Runs set of linters against codebase (flake8, bandit, bashate, checkniceness)
commands =
{[testenv]commands}
{[testenv:flake8]commands}
{[testenv:bandit]commands}
{[testenv:bashate]commands}
{[testenv:checkniceness]commands}
[testenv:flake8]
description = Validates codebase with flake
commands =
{[testenv]commands}
flake8 monasca_log_api
[testenv:genconfig]
description = Generates sample documentation file for monasca-log-api
commands = oslo-config-generator --config-file=config-generator/monasca-log-api.conf
[testenv:docs]
description = Builds api-ref, api-guide, releasenotes and devdocs
commands =
{[testenv]commands}
{[testenv:devdocs]commands}
{[testenv:api-guide]commands}
{[testenv:api-ref]commands}
{[testenv:releasenotes]commands}
[testenv:api-guide]
description = Called from CI scripts to test and publish the API Guide
commands =
{[testenv]commands}
rm -rf api-guide/build
{[testenv:checkjson]commands}
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
[testenv:api-ref]
description = Called from CI scripts to test and publish the API Ref
commands =
{[testenv]commands}
rm -rf api-ref/build
{[testenv:checkjson]commands}
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes]
description = Called from CI script to test and publish the Release Notes
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:devdocs]
description = Builds developer documentation
commands =
{[testenv]commands}
rm -rf doc/build
rm -rf doc/source/contributor/api
{[testenv:checkjson]commands}
python setup.py build_sphinx
[testenv:checkniceness]
description = Validates (pep-like) documenation
skip_install = True
usedevelop = False
commands =
{[testenv]commands}
doc8 --file-encoding utf-8 {toxinidir}/doc
doc8 --file-encoding utf-8 {toxinidir}/api-ref
doc8 --file-encoding utf-8 {toxinidir}/api-guide
doc8 --file-encoding utf-8 {toxinidir}/releasenotes
[testenv:checkjson]
description = Validates all json samples inside doc folder
skip_install = True
usedevelop = False
deps =
whitelist_externals =
bash
python
find
rm
commands =
{[testenv]commands}
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
[testenv:venv]
commands = {posargs}
[flake8]
exclude = .git,.tox,dist,doc,api-ref,api-guide,releasenotes,documentation,*.egg,build
show-source = True
enable-extensions = H203,H106
[hacking]
import_exceptions =
six.moves