This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
tox.ini
122 lines (107 loc) · 4.09 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
[tox]
# Removed for now:
# py34, py35, pypy
envlist = py27, docs, pre-commit
basepython = python2.7
skipsdist = true
indexserver =
default = https://pypi.yelpcorp.com/simple/
[pytest]
norecursedirs = .* _darcs CVS docs virtualenv_run venv examples scratch tmp .tox build
addopts = --ignore=setup.py --doctest-glob=*.rst -vv
[testenv]
basepython = python2.7
envdir = virtualenv_run
setenv =
PIP_INDEX_URL = https://pypi.yelpcorp.com/simple/
venv_update = {toxinidir}/bin/venv-update venv= {envdir} install=
[testenv:pre-commit]
envdir = venv/pre-commit
commands =
{[testenv]venv_update} -r {toxinidir}/requirements.d/pre_commit.txt
pre-commit run --all-files
[testenv:docker-compose]
envdir = venv/docker_compose
setenv =
COMPOSE_PROJECT_NAME = schematizer
COMPOSE_API_VERSION = auto
PIP_INDEX_URL = https://pypi.yelpcorp.com/simple/
commands =
{[testenv]venv_update} -r {toxinidir}/requirements.d/docker_compose.txt
[testenv:py27]
whitelist_externals = docker
envdir = venv/py27
commands =
{[testenv]venv_update} \
-r {toxinidir}/requirements.txt \
-r {toxinidir}/requirements-internal.txt \
-r {toxinidir}/requirements.d/py27.txt \
-r {toxinidir}/requirements.d/py27-internal.txt
docker pull docker-dev.yelpcorp.com/mysql-testing:latest
coverage erase
coverage run --source=schematizer/ -m pytest -vv --strict {posargs:tests}
# TODO: [clin|DATAPIPE-2024] increase code test coverage
coverage report --show-missing --fail-under 86
[testenv:acceptance]
whitelist_externals =
curl
sleep
skipsdist = True
envdir = venv/acceptance
setenv = {[testenv:docker-compose]setenv}
commands =
{[testenv]venv_update} -r {toxinidir}/requirements.d/docker_compose.txt {toxinidir}
# The idea here is to try the status port with retries until one succeeds,
# or until the retries are exhaused, then to call it again with the fail
# option on. This can't be done in a single call because with fail on,
# curl will exit immediately at the first failure, completely ignoring
# the retry setting. Curl should be replaced with real acceptance tests in
# DATAPIPE-94.
docker-compose --file=docker-compose.yml pull
docker-compose --file=docker-compose.yml rm -v --force
docker-compose --file=docker-compose.yml build
docker-compose --file=docker-compose.yml up -d --no-build schematizerservice
# This has been increased drastically, which is undesirable. We should
# prioritize DATAPIPE-94 to replace it with real acceptance tests. Also it
# may be worth looking into why it starts taking much longer time. 8/30/16.
sleep 10
curl -v --max-time 10 --retry 6 -S localhost:49257/v1/namespaces
curl -v --max-time 10 -S --fail localhost:49257/v1/namespaces
docker-compose --file=docker-compose.yml kill schematizerservice
[testenv:devenv]
envdir = venv/devenv
commands =
{[testenv]venv_update} \
-r {toxinidir}/requirements.d/devenv.txt \
-r {toxinidir}/requirements.d/py27-internal.txt \
-r {toxinidir}/requirements.txt \
-r {toxinidir}/requirements-internal.txt
[testenv:devenv-command]
envdir = venv/devenv
commands =
{[testenv]venv_update} \
-r {toxinidir}/requirements.d/devenv.txt \
-r {toxinidir}/requirements.d/py27-internal.txt \
-r {toxinidir}/requirements.txt \
-r {toxinidir}/requirements-internal.txt
{posargs}
[testenv:docker-push]
envdir = venv/docker_push
setenv =
{[testenv:docker-compose]setenv}
commands =
{[testenv]venv_update} -r {toxinidir}/requirements.d/docker_push.txt
docker-compose --file=docker-compose.yml build
fig-promote -f fig-tools.yml
[testenv:docs]
envdir = venv/docs
commands =
{[testenv]venv_update} -r {toxinidir}/requirements.d/docs.txt {toxinidir}
sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html
[pep8]
# E265 deals with spacing inside of comments - breaks human formatting
# E309 puts a blank line after class declarations - doesn't work well with docstrings
# E501 reformats lines to fit in --max-line-length poorly
ignore = E265,E309,E501
[flake8]
exclude = docs