-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
119 lines (108 loc) · 2.9 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
[tox]
minversion = 3.1
skipdist = True
envlist = pep8,py38
# Automatic envs (pyXX) will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set
# ignore_basepython_conflict.
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command = bash {toxinidir}/tox_install.sh {opts} {packages}
allowlist_externals =
find
kubectl
bash
mkdocs
deps =
.[test]
setenv =
# TODO(vsaienko): figure out why not working with default
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
NODE_IP="127.0.0.1"
OSCTL_LOGGING_CONF_FILE={toxinidir}/etc/rockoon/logging.conf
commands =
pytest {posargs:tests rockoon/osctl/tests/unit -vv -n auto}
[testenv:coverage]
commands =
pytest --cov=rockoon tests {posargs}
[testenv:pep8]
# using black for code style, so ignore pycodestyle violations from flake8
commands =
flake8 rockoon tests
black --check --diff rockoon tests
[testenv:black]
envdir={toxworkdir}/pep8
# actually format code with black
# run flake8 just in case afterwards
commands =
black rockoon tests
flake8 rockoon tests
[testenv:docs]
envdir = {toxworkdir}/docs
deps =
-r{toxinidir}/docs/requirements.txt
commands = mkdocs build -d docs_build
[testenv:dev-docs]
envdir = {toxworkdir}/docs
deps =
-r{toxinidir}/docs/requirements.txt
commands = mkdocs serve
[testenv:releasenotes]
envdir = {toxworkdir}/docs
deps=
-r{toxinidir}/requirements.txt
-r{toxinidir}/docs/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:dev]
deps =
.
setenv =
PYTHONWARNINGS=ignore:Unverified HTTPS request
OSCTL_LOGGING_CONF_FILE={toxinidir}/etc/rockoon/logging.conf
HELM_CHARTS_DIR={toxinidir}/charts/
passenv =
HOME
KOPF_*
KUBECONFIG
PYTHONASYNCIODEBUG
OSCTL_*
OSDPL_*
NODE_IP
HELM_CHARTS_DIR
allowlist_externals =
find
bash
kubectl
helm
commands =
# TODO(vsaienko): run in the same way as in production.
find {toxinidir}/rockoon -type f -name '*.pyc' -delete
bash {toxinidir}/tools/run_with_service_account.sh
[testenv:network-policies-update]
deps =
.
commands =
{basepython} {toxinidir}/tools/regenerate_policy_outputs.py
[testenv:functional]
# NOTE(vsaienko): Running tests require
# - kubeconfig
# - clouds.yaml will be filled automatically
# - access to kubernetes services internal IPs
# - resolution for DNS names of kubernetes services
changedir = {toxinidir}/rockoon/tests
passenv =
KUBECONFIG
setenv =
OSCTL_LOGGING_CONF_FILE={toxinidir}/etc/rockoon/logging.conf
OS_CLIENT_CONFIG_FILE=/tmp/clouds_functional.yaml
OS_CLOUD=admin
commands =
bash {toxinidir}/tools/get_service_account.sh
bash {toxinidir}/tools/fill_internal_svc_ips.sh
bash {toxinidir}/tools/get_os_clouds.sh
pytest {posargs}
[flake8]
extend-ignore = E,W