forked from learningequality/kolibri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
176 lines (160 loc) · 5.25 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
[tox]
envlist = py{2.7,3.4,3.5,3.6,pypy}, pythonlint, npmbuild, node6.x, docs, node, postgres, pythonbuild{2.7, 3.4, 3.5, 3.6}, 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
licenses: python2.7
py2.7: python2.7
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
pypy: pypy
docs: python3.5
pythonlint: python2.7
node6.x: python2.7
npmbuild: python2.7
nocext: python2.7
cext: python2.7
deps =
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/cext.txt
commands =
# Enable the plugins to ensure the configuration is read without error
coverage run -p kolibri plugin kolibri.plugins.learn enable
coverage run -p kolibri plugin kolibri.plugins.facility_management enable
coverage run -p kolibri plugin kolibri.plugins.device_management enable
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
sh -c 'kolibri manage makemigrations --check'
# Run the actual tests
py.test {posargs:--cov=kolibri --cov-report= --cov-append --color=no}
# This is currently disabled because some process seems to be locking
# the directory:
# /bin/rm: cannot remove `/home/travis/build/learningequality/kolibri/.tox/py3.5/tmp/.kolibri': Directory not empty
# rm -rf {env:KOLIBRI_HOME}
# 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: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:pythonlint]
deps =
-r{toxinidir}/requirements/dev.txt
commands =
flake8 kolibri
[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:node6.x]
whitelist_externals = {[node_base]whitelist_externals}
commands = {[node_base]commands}
[testenv:npmbuild]
whitelist_externals = {[node_base]whitelist_externals}
commands =
yarn
# Node-sass gets mardy if we don't do this.
npm rebuild node-sass
yarn run build
yarn run test-build
[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"