summaryrefslogtreecommitdiffstats
path: root/keystone-moon/tox.ini
blob: 13ca0d84707e68e2ebf89c37b857bdcb740ba1b4 (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
[tox]
minversion = 1.6
skipsdist = True
envlist = py34,py27,pep8,docs,genconfig,releasenotes

[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
       .[ldap,memcache,mongodb]
commands =
  find keystone -type f -name "*.pyc" -delete
  bash tools/pretty_tox.sh '{posargs}'
whitelist_externals =
  bash
  find
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION

[testenv:py34]
commands =
  find keystone -type f -name "*.pyc" -delete
  bash tools/pretty_tox_py3.sh

[testenv:legacy_drivers]
deps = -r{toxinidir}/test-requirements.txt
       nose
       .[ldap,memcache,mongodb]
commands =
  # Run each legacy test separately, to avoid SQL model redefinitions
  find keystone -type f -name "*.pyc" -delete
  nosetests -v \
      keystone/tests/unit/backend/legacy_drivers/assignment/V8/sql.py
  nosetests -v \
      keystone/tests/unit/backend/legacy_drivers/role/V8/sql.py
  nosetests -v \
      keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py
  nosetests -v \
      keystone/tests/unit/backend/legacy_drivers/resource/V8/sql.py

[testenv:pep8]
deps =
     .[bandit]
     {[testenv]deps}
commands =
  flake8
  # Run bash8 during pep8 runs to ensure violations are caught by
  # the check and gate queues
  bashate examples/pki/gen_pki.sh
  # Check that .po and .pot files are valid.
  bash -c "find keystone -type f -regex '.*\.pot?' -print0| \
           xargs -0 -n 1 msgfmt --check-format -o /dev/null"
  # Run security linter
  bandit -r keystone -x tests

[testenv:bandit]
# NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove.
deps = .[bandit]
commands = bandit -r keystone -x tests

[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
# NOTE(sdague): this target does not use constraints because
# upstream infra does not yet support it. Once that's fixed, we can
# drop the install_command.
install_command = pip install -U --force-reinstall {opts} {packages}
commands =
  find keystone -type f -name "*.pyc" -delete
  python setup.py testr --coverage --testr-args='{posargs}'

[testenv:venv]
# NOTE(jaegerandi): this target does not use constraints because
# upstream infra does not yet support it. Once that's fixed, we can
# drop the install_command.
install_command = pip install -U --force-reinstall {opts} {packages}
commands = {posargs}

[testenv:debug]
commands =
  find keystone -type f -name "*.pyc" -delete
  oslo_debug_helper {posargs}
passenv =
    KSTEST_ADMIN_URL
    KSTEST_ADMIN_USERNAME
    KSTEST_ADMIN_PASSWORD
    KSTEST_ADMIN_DOMAIN_ID
    KSTEST_PUBLIC_URL
    KSTEST_USER_USERNAME
    KSTEST_USER_PASSWORD
    KSTEST_USER_DOMAIN_ID
    KSTEST_PROJECT_ID

[testenv:functional]
basepython = python3.4
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH=./keystone/tests/functional
commands =
  find keystone -type f -name "*.pyc" -delete
  python setup.py testr --slowest --testr-args='{posargs}'
passenv =
    KSTEST_ADMIN_URL
    KSTEST_ADMIN_USERNAME
    KSTEST_ADMIN_PASSWORD
    KSTEST_ADMIN_DOMAIN_ID
    KSTEST_PUBLIC_URL
    KSTEST_USER_USERNAME
    KSTEST_USER_PASSWORD
    KSTEST_USER_DOMAIN_ID
    KSTEST_PROJECT_ID

[flake8]
filename= *.py,keystone-all,keystone-manage
show-source = true

# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D105: Missing docstring in magic method
# D202: No blank lines allowed after docstring.
# D203: 1 blank required before class docstring.
# D205: Blank line required between one-line summary and description.
# D400: First line should end with a period.
# D401: First line should be in imperative mood.
ignore = D100,D101,D102,D103,D104,D105,D203,D205,D400,D401

exclude=.venv,.git,.tox,build,dist,doc,*openstack/common*,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity=24

[testenv:docs]
commands=
    bash -c "rm -rf doc/build"
    bash -c "rm -rf doc/source/api"
    python setup.py build_sphinx

[testenv:releasenotes]
# NOTE(sdague): this target does not use constraints because
# upstream infra does not yet support it. Once that's fixed, we can
# drop the install_command.
install_command = pip install -U --force-reinstall {opts} {packages}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

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

[hacking]
import_exceptions =
  keystone.i18n
  six.moves
local-check-factory = keystone.tests.hacking.checks.factory