forked from learningequality/kolibri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
59 lines (57 loc) · 1.78 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]
envlist = py{3.6,3.7,3.8,3.9,3.10,3.11,3.12}, postgres
[testenv]
usedevelop = True
allowlist_externals=
rm
make
sh
passenv = INTEGRATION_TEST
setenv =
KOLIBRI_HOME = {envtmpdir}/.kolibri
DJANGO_SETTINGS_MODULE = kolibri.deployment.default.settings.test
KOLIBRI_RUN_MODE = tox
SKIP_PY_CHECK = 1
basepython =
py3.6: python3.6
py3.7: python3.7
py3.8: python3.8
py3.9: python3.9
py3.10: python3.10
py3.11: python3.11
py3.12: python3.12
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/cext.txt
commands =
sh -c 'kolibri manage makemigrations --check'
# Run the actual tests
python -O -m pytest {posargs:kolibri --color=no}
python -O -m pytest --color=no -p no:django test
# Fail if the log is longer than 200 lines (something erroring or very noisy got added)
sh -c "if [ `cat {env:KOLIBRI_HOME}/logs/kolibri.txt | wc -l` -gt 200 ] ; then echo 'Log too long' && echo '' && tail -n 20 {env:KOLIBRI_HOME}/logs/kolibri.txt && exit 1 ; fi"
[testenv:postgres]
passenv =
TOX_ENV
INTEGRATION_TEST
setenv =
PYTHONPATH = {toxinidir}
KOLIBRI_HOME = {envtmpdir}/.kolibri
KOLIBRI_DATABASE_ENGINE = postgres
KOLIBRI_DATABASE_USER = postgres
KOLIBRI_DATABASE_NAME = {env:POSTGRES_DB:test}
KOLIBRI_DATABASE_HOST = localhost
KOLIBRI_DATABASE_PASSWORD = postgres
KOLIBRI_DATABASE_PORT = 5432
KOLIBRI_RUN_MODE = tox
basepython =
postgres: python3.9
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/cext.txt
-r{toxinidir}/requirements/postgres.txt
commands =
python -O -m pytest {posargs:kolibri --color=no}
python -O -m pytest --color=no -p no:django test