forked from learningequality/kolibri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
189 lines (170 loc) · 5.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
[tox]
envlist = py{2.7,3.4,3.5,3.6,3.7,3.8,pypy}, pythonlint2, lint, node10.x, docs, node, postgres, pythonbuild{2.7,3.4,3.5,3.6,3.7}, cext, nocext
[testenv]
usedevelop = True
whitelist_externals=
rm
make
sh
setenv =
KOLIBRI_HOME = {envtmpdir}/.kolibri
DJANGO_SETTINGS_MODULE = kolibri.deployment.default.settings.test
KOLIBRI_RUN_MODE = tox
SKIP_PY_CHECK = 1
basepython =
pythonbuild2.7: python2.7
pythonbuild3.4: python3.4
pythonbuild3.5: python3.5
pythonbuild3.6: python3.6
pythonbuild3.7: python3.7
licenses: python2.7
py2.7: python2.7
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
py3.7: python3.7
py3.8: python3.8
pypy: pypy
docs: python3.5
pythonlint2: python2.7
lint: python3.6
node10.x: python2.7
nocext: python2.7
cext: python2.7
timely_shutdown_no_zombies: python3.6
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
py.test {posargs:--cov=kolibri --cov-report= --cov-append --color=no}
# 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"
# Running w/o C extensions is slow, so we just do a
# limited amount of testing
# This briefly tests our static deps etc w/o cexts
[testenv:nocext]
passenv = TOX_ENV
setenv =
PYTHONPATH = "{toxinidir}:{toxinidir}/kolibri/dist"
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/build.txt
commands =
# Ensure that for this Python version, we can actually compile ALL files
# in the kolibri directory
python -m compileall -q kolibri -x py2only
# Until we have staged builds, we will be running this in each and every
# environment even though builds should be done in Py 2.7
make staticdeps
# Start and stop kolibri
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --color=no test/
# This briefly tests our static deps etc WITH cexts
[testenv:cext]
passenv = TOX_ENV
setenv =
PYTHONPATH = "{toxinidir}:{toxinidir}/kolibri/dist"
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/build.txt
commands =
# Ensure that for this Python version, we can actually compile ALL files
# in the kolibri directory
python -m compileall -q kolibri -x py2only
# Until we have staged builds, we will be running this in each and every
# environment even though builds should be done in Py 2.7
make staticdeps
make staticdeps-cext
# Start and stop kolibri
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --color=no test/
[testenv:timely_shutdown_no_zombies]
passenv = TOX_ENV
whitelist_externals =
fuser
sleep
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/base.txt
commands =
- fuser 8082/tcp -k
# ensure kolibri stops within 20 seconds 10 times in a row
{toxinidir}/test/ensure_kolibri_stops_within_time.sh 20 10 8082
{toxinidir}/test/ensure_no_kolibris_running_on_port.sh 8082
[testenv:postgres]
passenv = TOX_ENV
setenv =
PYTHONPATH = {toxinidir}
KOLIBRI_HOME = {envtmpdir}/.kolibri
DJANGO_SETTINGS_MODULE = kolibri.deployment.default.settings.postgres_test
KOLIBRI_RUN_MODE = tox
basepython =
postgres: python3.5
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/cext.txt
-r{toxinidir}/requirements/postgres.txt
commands =
py.test {posargs:--cov=kolibri --color=no}
# rm -rf {env:KOLIBRI_HOME}
[testenv:pythonlint2]
deps = flake8
commands =
# Ensure we didn't put py3-only syntax
flake8 kolibri
[testenv:lint]
deps = pre-commit
commands =
# Install yarn dependencies
yarn
# Node-sass gets mardy if we don't do this.
npm rebuild node-sass
pre-commit install -f --install-hooks
pre-commit run --all-files
[testenv:docs]
deps =
-r{toxinidir}/requirements/docs.txt
commands =
make docs
[node_base]
whitelist_externals =
yarn
npm
commands =
yarn
# Node-sass gets mardy if we don't do this.
npm rebuild node-sass
yarn run coverage
[testenv:node10.x]
whitelist_externals = {[node_base]whitelist_externals}
commands = {[node_base]commands}
[conditional_testing_base]
whitelist_externals =
{toxinidir}/test/if.sh
[python_build_base]
commands =
{toxinidir}/test/if.sh "setup_changed"
[testenv:pythonbuild2.7]
whitelist_externals = {[conditional_testing_base]whitelist_externals}
commands = {[python_build_base]commands}
[testenv:pythonbuild3.4]
whitelist_externals = {[conditional_testing_base]whitelist_externals}
commands = {[python_build_base]commands}
[testenv:pythonbuild3.5]
whitelist_externals = {[conditional_testing_base]whitelist_externals}
commands = {[python_build_base]commands}
[testenv:pythonbuild3.6]
whitelist_externals = {[conditional_testing_base]whitelist_externals}
commands = {[python_build_base]commands}
[testenv:licenses]
whitelist_externals = {[conditional_testing_base]whitelist_externals}
commands =
{toxinidir}/test/if.sh "requirements_changed"