tox.ini 1.84 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

10
passenv = *
Jamesie Pic's avatar
Jamesie Pic committed
11 12
usedevelop = true
commands =
13 14 15
    pip install -U pip
    pip install -U setuptools
    pip install -Ue {toxinidir}[testing]
Jamesie Pic's avatar
Jamesie Pic committed
16
    {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
    codecov
okhin's avatar
okhin committed
20
    bash -c 'createdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
21
    memopol migrate
22 23 24 25 26 27 28
    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
29
    bash -c 'dropdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
Jamesie Pic's avatar
Jamesie Pic committed
30 31 32

whitelist_externals =
    psql
33 34 35
    cp
    createdb
    dropdb
okhin's avatar
okhin committed
36
    bash
Jamesie Pic's avatar
Jamesie Pic committed
37 38 39 40 41

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

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