summaryrefslogtreecommitdiff
path: root/tox.ini
blob: ee9be480bdbf35be26c2d2004c5d9c391f167a6b (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
[tox]
minversion = 1.6
envlist = py26,py27,py33,pep8,pylint
skipsdist = True

[testenv]
sitepackages = False
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands =
  # Use the lockutils wrapper to ensure that external locking works correctly
  # NOTE(bnemec): Due to dependencies between tests in the rpc module, those
  # tests cannot currently be run in parallel.  Because that module is
  # deprecated, spending a lot of time fixing them would not be useful.
  # Since we want to test everything else in parallel, however, we need
  # to do two test runs: one in parallel with everything but rpc, and one
  # serialized for the rpc module.
  python -m openstack.common.lockutils python setup.py test --slowest --testr-args='(?!tests.unit.rpc)tests {posargs}'
  python -m openstack.common.lockutils python setup.py test --slowest --testr-args='tests.unit.rpc --concurrency=1 {posargs}'
  {toxinidir}/tools/config/generate_sample.sh -p openstack

# As long as we are filtering tests based on whether they run in parallel or
# not, it will not be possible to specify tests for tox to run by using the
# normal "tox -e py27 -- test_name".  The "all" target allows that behavior
# to be used again: tox -e all -- test_name
[testenv:all]
setenv = VIRTUAL_ENV={envdir}
commands = python -m openstack.common.lockutils python setup.py test --slowest --testr-args='{posargs}'

[flake8]
show-source = True
ignore = E123,E126,H405,H904
exclude = .venv,.tox,dist,doc,*.egg,.update-venv

[testenv:pep8]
commands = flake8 {posargs}
           python ./tools/check_maintainers.py

[testenv:pylint]
deps = pylint>=0.26.0
commands = python ./tools/lint.py ./openstack
           python ./tools/lint.py ./tests

[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
commands =
  # due to dependencies between tests (bug 1192207) we use `--concurrency=1` option
  # Use the lockutils wrapper to ensure that external locking works correctly
  python -m openstack.common.lockutils python setup.py test --coverage --testr-args='--concurrency=1 {posargs}'

[testenv:docs]
commands = python setup.py build_sphinx

[testenv:venv]
commands = {posargs}

[testenv:py33]
deps = -r{toxinidir}/requirements-py3.txt
       -r{toxinidir}/test-requirements-py3.txt
setenv = PYTHONHASHSEED=0
commands =
  python -m openstack.common.lockutils \
      python -m testtools.run \
            tests.unit.apiclient.test_auth \
            tests.unit.apiclient.test_base \
            tests.unit.apiclient.test_client \
            tests.unit.apiclient.test_exceptions \
            tests.unit.cache.test_cache \
            tests.unit.cache.test_memory \
            tests.unit.config.test_generator \
            tests.unit.crypto.test_utils \
            tests.unit.db.sqlalchemy.test_models \
            tests.unit.db.sqlalchemy.test_options \
            tests.unit.db.test_api \
            tests.unit.fixture.test_config \
            tests.unit.fixture.test_logging \
            tests.unit.fixture.test_mockpatch \
            tests.unit.middleware.test_catch_errors \
            tests.unit.middleware.test_correlation_id \
            tests.unit.middleware.test_notifier \
            tests.unit.middleware.test_request_id \
            tests.unit.middleware.test_sizelimit \
            tests.unit.reports.test_base_report \
            tests.unit.reports.test_guru_meditation_report \
            tests.unit.reports.test_openstack_generators \
            tests.unit.reports.test_views \
            tests.unit.rpc.test_dispatcher \
            tests.unit.scheduler.test_base_filter \
            tests.unit.scheduler.test_host_filters \
            tests.unit.scheduler.test_weights \
            tests.unit.test_cfgfilter \
            tests.unit.test_cliutils \
            tests.unit.test_context \
            tests.unit.test_deprecated \
            tests.unit.test_excutils \
            tests.unit.test_fileutils \
            tests.unit.test_funcutils \
            tests.unit.test_hooks \
            tests.unit.test_imageutils \
            tests.unit.test_importutils \
            tests.unit.test_jsonutils \
            tests.unit.test_local \
            tests.unit.test_memorycache \
            tests.unit.test_network_utils \
            tests.unit.test_notifier \
            tests.unit.test_periodic \
            tests.unit.test_policy \
            tests.unit.test_quota \
            tests.unit.test_request_utils \
            tests.unit.test_sslutils \
            tests.unit.test_strutils \
            tests.unit.test_systemd \
            tests.unit.test_timeutils \
            tests.unit.test_units \
            tests.unit.test_uuidutils \
            tests.unit.test_versionutils \
            tests.unit.test_xmlutils

[testenv:pyflakes]
commands = flake8


[hacking]
import_exceptions =
  openstack.common.gettextutils
  six.moves.mox