summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 21696eb5116ff791837b0b2dd93c296bb71e17d3 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
[tox]
envlist = pep8,py35,py27,pip-check-reqs
minversion = 2.3.1
skipsdist = True

[tempestenv]
sitepackages = False
setenv =
    VIRTUAL_ENV={envdir}
    OS_TEST_PATH=./tempest/test_discover
    BRANCH_NAME=master
    CLIENT_NAME=tempest
deps =
    -r{toxinidir}/requirements.txt

[testenv]
setenv =
    VIRTUAL_ENV={envdir}
    OS_LOG_CAPTURE=1
    PYTHONWARNINGS=default::DeprecationWarning
    BRANCH_NAME=master
    CLIENT_NAME=tempest
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH TEMPEST_CONFIG TEMPEST_CONFIG_DIR http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY ZUUL_CACHE_DIR REQUIREMENTS_PIP_LOCATION GENERATE_TEMPEST_PLUGIN_LIST
usedevelop = True
install_command =
    {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
whitelist_externals = *
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt
commands =
    find . -type f -name "*.pyc" -delete
    stestr --test-path ./tempest/tests run {posargs}

[testenv:genconfig]
commands = oslo-config-generator --config-file tempest/cmd/config-generator.tempest.conf

[testenv:cover]
commands = python setup.py testr --coverage --testr-arg='tempest\.tests {posargs}'

[testenv:all]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
# 'all' includes slow tests
setenv =
    {[tempestenv]setenv}
    OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
deps = {[tempestenv]deps}
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --regex {posargs}

[testenv:ostestr]
sitepackages = {[tempestenv]sitepackages}
# 'all' includes slow tests
setenv =
    {[tempestenv]setenv}
    OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
deps = {[tempestenv]deps}
commands =
    find . -type f -name "*.pyc" -delete
    ostestr {posargs}

[testenv:all-plugin]
sitepackages = True
# 'all' includes slow tests
setenv =
    {[tempestenv]setenv}
    OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
deps = {[tempestenv]deps}
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --regex {posargs}

[testenv:full]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select which tests to run and exclude the slow tag:
# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
    tempest run --combine --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)' {posargs}

[testenv:full-serial]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select which tests to run and exclude the slow tag:
# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))' {posargs}

[testenv:scenario]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select all scenario tests
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --serial --regex '(^tempest\.scenario)' {posargs}

[testenv:smoke]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --regex '\[.*\bsmoke\b.*\]' {posargs}

[testenv:smoke-serial]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# This is still serial because neutron doesn't work with parallel. See:
# https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
# job would fail if we moved it to parallel.
commands =
    find . -type f -name "*.pyc" -delete
    tempest run --serial --regex '\[.*\bsmoke\b.*\]' {posargs}

[testenv:venv]
commands = {posargs}

[testenv:venv-tempest]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
commands = {posargs}

[testenv:docs]
commands =
    rm -rf doc/build
    python setup.py build_sphinx {posargs}

[testenv:pep8]
commands =
    flake8 {posargs}
    check-uuid

[testenv:uuidgen]
commands =
    check-uuid --fix

[hacking]
local-check-factory = tempest.hacking.checks.factory
import_exceptions = tempest.services

[flake8]
# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved.  For further detail see https://review.openstack.org/#/c/36788/
# E123 skipped because it is ignored by default in the default pep8
# E129 skipped because it is too limiting when combined with other rules
ignore = E125,E123,E129
show-source = True
exclude = .git,.venv,.tox,dist,doc,*egg,build
enable-extensions = H106,H203,H904
import-order-style = pep8

[testenv:releasenotes]
commands =
    rm -rf releasenotes/build
    sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:pip-check-reqs]
# Do not install test-requirements as that will pollute the virtualenv for
# determining missing packages.
# This also means that pip-check-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_check_reqs
       -r{toxinidir}/requirements.txt
commands=
    pip-extra-reqs -d --ignore-file=tempest/tests/* tempest
    pip-missing-reqs -d --ignore-file=tempest/tests/* tempest


[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test

[testenv:plugin-sanity-check]
# perform tempest plugin sanity
whitelist_externals = bash
commands =
  bash tools/tempest-plugin-sanity.sh