-
Notifications
You must be signed in to change notification settings - Fork 5
/
tox.ini
113 lines (99 loc) · 4.03 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
## Resources ##
# tox - https://tox.readthedocs.io/en/latest/config.html
# stestr - https://stestr.readthedocs.io/en/latest/MANUAL.html
[tox]
envlist = unit,functional,pep8,pip-missing-reqs
skipsdist = True
requires = virtualenv > v20.8.0
setuptools > 58.0.0
[testenv]
basepython = python3
usedevelop = True
allowlist_externals = bash
find
rm
env
install_command = python -m pip install {opts} {packages}
minversion = 3.18.10
ignore_basepython_conflict = True
setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:720}
DEBUG={env:NSXV3_LOGIN_HOSTNAME:False}
NSXV3_LOGIN_HOSTNAME={env:NSXV3_LOGIN_HOSTNAME:}
NSXV3_LOGIN_PORT={env:NSXV3_LOGIN_PORT:}
NSXV3_LOGIN_USER={env:NSXV3_LOGIN_USER:}
NSXV3_LOGIN_PASSWORD={env:NSXV3_LOGIN_PASSWORD:}
NSXV3_TRANSPORT_ZONE_NAME={env:NSXV3_TRANSPORT_ZONE_NAME:}
OS_USERNAME={env:OS_USERNAME:}
OS_PASSWORD={env:OS_PASSWORD:}
OS_PROJECT_NAME={env:OS_PROJECT_NAME:}
OS_PROJECT_DOMAIN_ID={env:OS_PROJECT_DOMAIN_ID:}
OS_USER_DOMAIN_ID={env:OS_USER_DOMAIN_ID:}
OS_HOSTNAME={env:OS_HOSTNAME:}
OS_HTTPS={env:OS_HTTPS:1}
E2E_NETWORK_NAME={env:E2E_NETWORK_NAME:}
E2E_SERVER_NAME={env:E2E_SERVER_NAME:}
E2E_CREATE_SERVER_NAME_PREFIX={env:E2E_CREATE_SERVER_NAME_PREFIX:}
E2E_CREATE_SERVER_IMAGE_NAME={env:E2E_CREATE_SERVER_IMAGE_NAME:}
E2E_CREATE_SERVER_FLAVOR_NAME={env:E2E_CREATE_SERVER_FLAVOR_NAME:}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://raw.githubusercontent.com/sapcc/requirements/stable/yoga-m3/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:unit]
commands =
env TEST_OSPROFILER=1 stestr run 'networking_nsxv3.tests.unit'
[testenv:realization]
basepython = python3.8
commands =
env TEST_OSPROFILER=1 stestr run 'networking_nsxv3.tests.unit.realization'
[testenv:db]
commands =
env TEST_OSPROFILER=1 stestr run 'networking_nsxv3.tests.unit.db'
[testenv:coverage]
basepython = python3.8
setenv =
{[testenv]setenv}
commands =
coverage erase
coverage run --source=networking_nsxv3 --omit=networking_nsxv3/tests/*,**/__init__.py -m pytest networking_nsxv3/tests/unit
coverage report -m
bash -c "echo \# :+1: Coverage report, $(date) > pytest-coverage.txt"
bash -c "echo '```' >> pytest-coverage.txt"
bash -c "coverage report --omit='networking_nsxv3/tests/*,**/__init__.py' >> pytest-coverage.txt"
bash -c "echo '```' >> pytest-coverage.txt"
[testenv:functional]
basepython = python3.8
commands = env TEST_OSPROFILER=1 pytest networking_nsxv3/tests/functional/
[testenv:e2e]
basepython = python3.8
commands = env TEST_OSPROFILER=1 pytest -s networking_nsxv3/tests/e2e/
[testenv:pep8]
basepython = python3.8
deps = {[testenv]deps}
commands =
bash tools/flake8wrap.sh {posargs}
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line
# N530 direct neutron imports not allowed
# N534 Untranslated exception message
# E731 do not assign a lambda expression, use a def
ignore = E125,E126,E128,E731,H404,H405,N530,N534
# 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
show-source = True
builtins = _
exclude = ./.*,build,dist,doc,*openstack/common*,*lib/python*,*egg
max-line-length = 119