forked from Affirm/cabot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
60 lines (53 loc) · 1.67 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
# tox.ini
# Runs docker-compose tests. Also creates a development virtualenv.
# Usage:
# tox # runs the test suite
# tox -e develop $ create the dev virutalenv
[pypi]
# Use internal pypi with pre-build wheels for ubuntu
index = https://registry.affirm-stage.com/artifactory/api/pypi/pypi/simple
[tox]
envlist = docker-compose, flake8
minversion = 2.3
indexserver =
default = {[pypi]index}
# skip setup.py
skipsdist = True
[testenv]
basepython = python2.7
setenv =
PIP_INDEX_URL = {[pypi]index}
PYTHONIOENCODING = utf-8
deps =
-rtox-requirements.txt
# for consistency across installations
sitepackages = False
whitelist_externals =
bin/rm
bin/mkdir
bin/cp
bash
[testenv:develop]
envdir = .venv
usedevelop = True
commands =
{envpython} --version # tox >= 2.5 https://github.com/tox-dev/tox/issues/316 made empty command sections illegal
[testenv:docker-compose]
commands =
# xml test results files go here
rm -rf build/docker-compose
mkdir -p build/docker-compose
cp conf/development.env.example conf/development.env
bash -euc "docker-compose build"
bash -euc "docker-compose up -d"
bash -euc "docker-compose run wait"
bash -euc "docker-compose run --rm web python manage.py test cabot || (docker-compose down && exit 1)"
bash -euc "docker-compose down"
[testenv:flake8]
commands =
rm -rf build/flake8/
mkdir -p build/flake8
bash -euc -o pipefail "flake8 --config=setup.cfg -j 2 --exit-zero {posargs:} | tee build/flake8/flake8.txt"
# Fail if there are more than 125 flake8 issues (there were 124 as of 12/3)
# We should lower this number!
bash -euc -o pipefail '(("$(wc -l < build/flake8/flake8.txt)" < 125))'