[tox]
envlist = tests, flake8, frontend, addon

[testenv]
basepython = python3
setenv =
    DEBUG=False
    SECRET_KEY='FOO'
    ALLOWED_HOSTS=localhost
    DATABASE_URL=postgres://postgres@db/postgres

[testenv:tests]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
    pip==6.1.1
    coverage==3.7.1
    coveralls==1.1
commands =
    {toxinidir}/bin/peep.py install -r requirements.txt
    coverage run manage.py test -v2
    coveralls

[testenv:flake8]
deps = flake8
commands = flake8 testpilot

[testenv:frontend]
whitelist_externals =
    node
    npm
    sh
    sleep
setenv =
    DISPLAY=:99.0
commands =
    npm config set spin false
    npm install

    npm run lint
    npm run build
    sh -e /etc/init.d/xvfb start
    sleep 3
    npm test

[testenv:addon]
passenv = AMO_USER AMO_SECRET
changedir = addon
whitelist_externals =
    node
    npm
commands =
    npm config set spin false
    npm install
    npm run lint
    npm run sign

[tox]
envlist = tests, flake8, frontend, addon

[testenv]
basepython = python3
setenv =
    DEBUG=False
    SECRET_KEY='FOO'
    ALLOWED_HOSTS=localhost
    DATABASE_URL=postgres://postgres@db/postgres

[testenv:tests]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
    pip==6.1.1
    coverage==3.7.1
    coveralls==1.1
commands =
    {toxinidir}/bin/peep.py install -r requirements.txt
    coverage run manage.py test -v2
    coveralls

[testenv:flake8]
deps = flake8
commands = flake8 testpilot

[testenv:frontend]
whitelist_externals =
    node
    npm
    sh
    sleep
setenv =
    DISPLAY=:99.0
commands =
    npm config set spin false
    npm install

    npm run lint
    npm run build
    sh -e /etc/init.d/xvfb start
    sleep 3
    npm test

[testenv:addon]
passenv = AMO_USER AMO_SECRET
changedir = addon
whitelist_externals =
    node
    npm
commands =
    npm config set spin false
    npm install
    npm run lint
    # npm run sign

Disable npm run sign in Tox for now
Disable npm run sign in Tox for now
