tox.ini 1.77 KB
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1
2
3
4
5
6
7
8
9
[tox]
envlist = py27,qa,docs

[testenv]
setenv =
    CI=True
    DJANGO_DEBUG=True
    DJANGO_SETTINGS_MODULE=memopol.settings

okhin's avatar
okhin committed
10
passenv = *
Jamesie Pic's avatar
Jamesie Pic committed
11
12
usedevelop = true
commands =
13
14
    pip install -U pip
    pip install -U setuptools
Jamesie Pic's avatar
Jamesie Pic committed
15
16
    pip install -Ue {toxinidir}[testing]
    {toxinidir}/src/memopol/bin/install_client_deps.sh
okhin's avatar
okhin committed
17
    cp {toxinidir}/src/memopol/tests/local_settings.py {toxinidir}/src/memopol/local_settings.py
Jamesie Pic's avatar
Jamesie Pic committed
18
    py.test src/
okhin's avatar
okhin committed
19
    bash -c 'createdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
20
    memopol migrate
21
22
23
24
25
26
27
    bash -c 'cat src/representatives/contrib/francedata/tests/representatives_input.json | francedata_import_representatives'
    bash -c 'cat src/representatives/contrib/parltrack/tests/representatives_fixture.json | parltrack_import_representatives'
    bash -c 'cat src/representatives_votes/contrib/francedata/tests/dossiers_input.json | francedata_import_dossiers'
    bash -c 'cat src/representatives_votes/contrib/francedata/tests/scrutins_input.json | francedata_import_scrutins'
    bash -c 'cat src/representatives_votes/contrib/francedata/tests/votes_input.json | francedata_import_votes'
    bash -c 'cat src/representatives_votes/contrib/parltrack/tests/dossiers_fixture.json | parltrack_import_dossiers'
    bash -c 'cat src/representatives_votes/contrib/parltrack/tests/votes_fixture.json | parltrack_import_votes'
okhin's avatar
okhin committed
28
    bash -c 'dropdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
Jamesie Pic's avatar
Jamesie Pic committed
29
30
31

whitelist_externals =
    psql
32
33
34
    cp
    createdb
    dropdb
Jamesie Pic's avatar
Jamesie Pic committed
35
36
37
38
39

[testenv:qa]
skipsdist=True
changedir = {toxinidir}
basepython = python2.7
okhin's avatar
okhin committed
40
passenv = *
Jamesie Pic's avatar
Jamesie Pic committed
41
42
43
44
45
46
47
48
49
50
51
52
53
commands =
    pip install -Ue {toxinidir}[testing]
    flake8 src --exclude '*/migrations,docs,static' --ignore E128

[testenv:docs]
skipsdist=True
changedir = {toxinidir}/docs
deps =
    sphinx
commands =
    make html
whitelist_externals =
    make