forked from arachnys/cabot
-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
86 lines (78 loc) · 2.57 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
# tox.ini
# Runs docker-compose tests. Also creates a development virtualenv.
# Usage:
# tox # runs the test suite
# tox -e develop # create the dev virtualenv
[tox]
envlist = test-mysql, test-psql, flake8
minversion = 2.3
# skip setup.py
skipsdist = True
[testenv]
basepython = python2.7
setenv =
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:build-app]
commands =
# build cabotapp for testing
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_psql"
bash -euc "docker-compose run wait_rabbitmq"
bash -euc "docker-compose run --rm web bash bin/build-app"
[testenv:destroy-app]
commands =
bash -euc "docker-compose down -v"
# expose but don't publish port 5001 so we can run multiple tests at once
[testenv:test-psql]
setenv =
{[testenv]setenv}
CABOT_PORT_MAPPING = 5001
commands =
# xml test results files go here
rm -rf build/test-psql
mkdir -p build/test-psql
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_psql"
bash -euc "docker-compose run wait_rabbitmq"
bash -euc "docker-compose run --rm web python manage.py test cabot || (docker-compose down -v && exit 1)"
bash -euc "docker-compose down -v"
# expose but don't publish port 5001 so we can run multiple tests at once
[testenv:test-mysql]
setenv =
{[testenv]setenv}
CABOT_PORT_MAPPING = 5001
commands =
# xml test results files go here
rm -rf build/test-mysql
mkdir -p build/test-mysql
cp conf/mysql.env.example conf/development.env
bash -euc "docker-compose build"
bash -euc "docker-compose up -d"
bash -euc "docker-compose run wait_mysql"
bash -euc "docker-compose run wait_rabbitmq"
bash -euc "docker-compose run --rm web python manage.py test cabot || (docker-compose down -v && exit 1)"
bash -euc "docker-compose down -v"
[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"
bash -euc -o pipefail '(("$(wc -l < build/flake8/flake8.txt)" == 0))'