forked from Yelp/paasta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
144 lines (133 loc) · 4.47 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
[tox]
skipsdist=True
envlist = py36
# The Makefile and .travis.yml override the indexserver to the public one when
# running outside of Yelp.
indexserver =
default = https://pypi.yelpcorp.com/simple
tox_pip_extensions_ext_pip_custom_platform = true
tox_pip_extensions_ext_venv_update = true
[testenv]
basepython = python3.6
setenv =
TZ = UTC
deps =
--requirement={toxinidir}/requirements-dev.txt
--editable={toxinidir}
commands =
py.test {posargs:tests}
[testenv:coverage]
commands =
coverage run -m pytest {posargs:tests}
coverage report
coverage html
# tests should always have 100% coverage, this protects against accidental
# dead code or never-called assertions
coverage report --include 'tests*' --fail-under 100
[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:manpages]
commands = ./build-manpages.sh
[testenv:paasta_itests]
changedir=paasta_itests/
passenv = DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH
deps =
docker-compose==1.18.0
commands =
docker-compose down
docker-compose --verbose build
# Fire up the marathon cluster in background
docker-compose up -d mesosmaster mesosslave marathon marathon1 marathon2 chronos hacheck 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 tox -i {env:PIP_INDEX_URL:https://pypi.python.org/simple} -e paasta_itests_inside_container -- --no-capture {posargs}
docker-compose stop
docker-compose rm --force
[testenv:example_cluster]
changedir=example_cluster/
passenv = DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH
deps =
docker-compose==1.17.1
commands =
docker-compose down
docker-compose --verbose build
# 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/
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.521
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_long_running_service_tools.py
tests/test_marathon_tools.py
tests/test_setup_marathon_job.py
tests/test_secret_tools.py
tests/test_utils.py
commands =
mypy {posargs:{[testenv:mypy]mypy_paths}}
[flake8]
max-line-length = 120
[pep8]
ignore = E265,E309,E501