[tox]
minversion = 1.6
envlist = py27,pep8,eslint,karma
skipsdist = True

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
   VIRTUAL_ENV={envdir}
   NOSE_WITH_OPENSTACK=1
   NOSE_OPENSTACK_COLOR=1
   NOSE_OPENSTACK_RED=0.05
   NOSE_OPENSTACK_YELLOW=0.025
   NOSE_OPENSTACK_SHOW_ELAPSED=1
   DJANGO_SETTINGS_MODULE=searchlight_ui.tests.settings
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
whitelist_externals = /usr/bin/npm
                      /bin/bash
commands = python manage.py test

[testenv:pep8]
commands = flake8

[testenv:venv]
commands = {posargs}

[testenv:py27integration]
basepython = python2.7
setenv =
   INTEGRATION_TESTS=1
   SELENIUM_HEADLESS=1
   HORIZON_INTEGRATION_TESTS_CONFIG_FILE=searchlight_ui/tests/integration_tests/horizon.conf
   DJANGO_SETTINGS_MODULE=searchlight_ui.tests.settings
commands = nosetests searchlight_ui/tests/integration_tests/tests {posargs}

[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'

[testenv:docs]
commands = python setup.py build_sphinx

[testenv:debug]
commands = oslo_debug_helper {posargs}

[flake8]
# E123, E125 skipped as they are invalid PEP-8.

show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
