forked from Yelp/paasta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
187 lines (175 loc) · 5.74 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
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
[tox]
skipsdist=True
envlist=py36-linux
tox_pip_extensions_ext_pip_custom_platform = true
tox_pip_extensions_ext_venv_update = true
docker_compose_version = 1.26.2
[testenv]
# The Makefile and .travis.yml override the indexserver to the public one when
# running outside of Yelp.
indexserver = https://pypi.yelpcorp.com/simple
basepython = python3.6
passenv = SSH_AUTH_SOCK
setenv =
TZ = UTC
PIP_INDEX_URL = {env:PIP_INDEX_URL:https://pypi.yelpcorp.com/simple}
deps =
--requirement={toxinidir}/requirements.txt
--requirement={toxinidir}/requirements-dev.txt
--editable={toxinidir}
pre=check-requirements
[testenv:tests]
envdir = .tox/py36-linux/
commands =
py.test {posargs:tests}
[testenv:docs]
commands =
/bin/rm -rf docs/source/generated/
# The last arg to apidoc is a list of excluded paths
sphinx-apidoc -f -e -o docs/source/generated/ paasta_tools
sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html
[testenv:paasta_itests]
changedir=paasta_itests/
passenv = DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH
deps =
docker-compose=={[tox]docker_compose_version}
commands =
docker-compose down
docker-compose --verbose build --build-arg PIP_INDEX_URL={env:PIP_INDEX_URL:https://pypi.yelpcorp.com/simple}
# Fire up the marathon cluster in background
docker-compose up -d mesosmaster mesosslave marathon marathon1 marathon2 hacheck httpdrain mesosslave2 mesosslave3 mesosslave4 mesosslave5
docker-compose scale mesosslave=3
# Run the paastatools container in foreground to catch the output
# the `docker-compose run` vs `docker-compose up` is important here, as docker-compose run will
# exit with the right code.
#
# dnephin says we need the --rm otherwise these containers won't be cleaned
# up. I guess we only need this for run'd containers, not up'd containers?
# IDK, the docs don't really specify.
docker-compose run --rm paastatools /venv/bin/tox -i {env:PIP_INDEX_URL:https://pypi.yelpcorp.com/simple} -e paasta_itests_inside_container -- --no-capture {posargs}
docker-compose stop
docker-compose rm --force
[testenv:k8s_itests]
basepython = python3.6
whitelist_externals = bash
deps =
docker-compose=={[tox]docker_compose_version}
setenv =
passenv =
KIND_CLUSTER
KUBECONFIG
KUBECONTEXT
PAASTA_SYSTEM_CONFIG_DIR
SOA_DIR
PAASTA_API_PORT
KUBE_RESOURCE_DIR
USER
PAASTA_CONFIG_DIR
DOCKER_TLS_VERIFY
DOCKER_HOST
DOCKER_CERT_PATH
changedir=k8s_itests/
commands =
# Build /etc/paasta used by docker-compose
{toxinidir}/k8s_itests/scripts/setup.sh
# Run paasta-tools k8s_itests in docker
docker-compose down
docker-compose --verbose build --build-arg PIP_INDEX_URL={env:PIP_INDEX_URL:https://pypi.yelpcorp.com/simple}
docker-compose up \
--abort-on-container-exit
[testenv:example_cluster]
changedir=example_cluster/
passenv = DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH
deps =
docker-compose=={[tox]docker_compose_version}
commands =
docker-compose down
docker-compose --verbose build --build-arg PIP_INDEX_URL={env:PIP_INDEX_URL:https://pypi.yelpcorp.com/simple}
# Fire up the marathon cluster in background
# Run the paastatools container in foreground to catch the output
# the `docker-compose run` vs `docker-compose up` is important here, as docker-compose run will
# exit with the right code.
#
# dnephin says we need the --rm otherwise these containers won't be cleaned
# up. I guess we only need this for run'd containers, not up'd containers?
# IDK, the docs don't really specify.
docker-compose run --rm playground ./example_cluster/example-cluster-test.sh
docker-compose stop
docker-compose rm --force
[testenv:paasta_itests_inside_container]
basepython = python3.6
envdir=/tmp/
setenv =
DOCKER_COMPOSE_PROJECT_NAME = paastatools_inside_container
changedir=paasta_itests/
passenv =
API_PORT
HTTPDRAIN_PORT
HACHECK_PORT
MARATHON1_PORT
MARATHON2_PORT
MARATHON_PORT
MESOSMASTER_PORT
ZOOKEEPER_PORT
deps =
{[testenv]deps}
--requirement={toxinidir}/extra-linux-requirements.txt
behave==1.2.5
whitelist_externals =
/bin/mkdir
commands =
mkdir -p /nail/etc
# TODO: upgrade behave if they ever take this reasonable PR
pip install git+git://github.com/asottile/behave@issue_533
behave {posargs}
[testenv:general_itests]
basepython = python3.6
setenv =
PAASTA_SYSTEM_CONFIG_DIR = {toxinidir}/general_itests/fake_etc_paasta
changedir=general_itests/
passenv = DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH
deps =
{[testenv]deps}
behave==1.2.5
commands =
# TODO: upgrade behave if they ever take this reasonable PR
pip install git+git://github.com/asottile/behave@issue_533
pre-commit install -f --install-hooks
pre-commit run --all-files
pylint -E paasta_tools/mesos/ --ignore master.py,task.py
behave {posargs}
[testenv:mypy]
basepython = python3.6
deps =
{[testenv]deps}
mypy==0.720
setenv =
MYPYPATH = {toxinidir}
ignore_errors = True
whitelist_externals =
/bin/sh
mypy_paths =
paasta_tools
tests/deployd/test_common.py
tests/deployd/test_watchers.py
tests/frameworks
tests/test_kubernetes_tools.py
tests/test_long_running_service_tools.py
tests/test_marathon_tools.py
tests/test_setup_kubernetes_job.py
tests/test_setup_marathon_job.py
tests/test_secret_tools.py
tests/secret_providers/test_secret_providers.py
tests/secret_providers/test_vault.py
tests/test_utils.py
commands =
mypy {posargs:{[testenv:mypy]mypy_paths}}
[testenv:install-hooks]
basepython = python3.6
deps = pre-commit
commands = pre-commit install -f --install-hooks
[flake8]
max-line-length = 120
extend-ignore = E501,E203,W503
[pep8]
ignore = E265,E501