[tox] minversion = 1.6 skipsdist = True setupdir = {toxinidir}/nailgun envlist = py27,py34,pep8 [base] ARTS = {toxinidir}/artifacts TOOLS = {toxinidir}/nailgun/tools [common] setenv = DB_ROOT={env:NAILGUN_DB_ROOT:postgres} DB_ROOTPW={env:NAILGUN_DB_ROOTPW:insecure_slave} DB_ROOTPGPASS={[base]ARTS}/pgpass NAILGUN_DB={env:NAILGUN_DB:openstack_citest} NAILGUN_DB_HOST={env:NAILGUN_DB_HOST:127.0.0.1} NAILGUN_DB_PORT={env:NAILGUN_DB_PORT:5432} NAILGUN_DB_USER={env:NAILGUN_DB_USER:openstack_citest} NAILGUN_DB_PW={env:NAILGUN_DB_PW:openstack_citest} NAILGUN_ROOT={toxinidir}/nailgun NAILGUN_STATIC={toxinidir}/nailgun/static NAILGUN_TEMPLATES={toxinidir}/nailgun/static NAILGUN_FIXTURE_FILES={env:NAILGUN_FIXTURE_FILES:} NAILGUN_CONFIG={[base]ARTS}/test.yaml NAILGUN_LOGS={[base]ARTS} NAILGUN_PORT={env:NAILGUN_PORT:8000} NAILGUN_START_MAX_WAIT_TIME=20 NAILGUN_CHECK_URL=/api/version [prepare] commands = bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env" bash -c "{[base]TOOLS}/env.sh prepare_nailgun_database" [testenv] usedevelop = True install_command = pip install --allow-external -U {opts} {packages} whitelist_externals = bash python changedir={toxinidir}/nailgun setenv = VIRTUAL_ENV={envdir} {[common]setenv} passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY deps = -r{toxinidir}/nailgun/test-requirements.txt commands = {[prepare]commands} py.test -vv --cleandb --junit-xml {toxinidir}/nailgun/nailgun.xml -m 'not performance' -n 4 {posargs:nailgun/test} py.test -vv --junit-xml {toxinidir}/nailgun/extensions.xml {posargs:nailgun/extensions} [testenv:cleanup] usedevelop = False setenv = VIRTUAL_ENV={envdir} {[common]setenv} deps = commands = bash -c "{[base]TOOLS}/env.sh cleanup_nailgun_database" bash -c "{[base]TOOLS}/env.sh cleanup_nailgun_env" [testenv:start] setenv = VIRTUAL_ENV={envdir} {[common]setenv} deps = -r{toxinidir}/nailgun/requirements.txt commands = {[prepare]commands} bash -c "{[base]TOOLS}/env.sh prepare_nailgun_server" [testenv:stop] usedevelop = False setenv = VIRTUAL_ENV={envdir} {[common]setenv} deps = commands = bash -c "{[base]TOOLS}/env.sh cleanup_nailgun_server" [testenv:cover] setenv = NOSE_WITH_COVERAGE=1 [testenv:venv] deps = -r{toxinidir}/nailgun/requirements.txt commands = {posargs:} [testenv:pep8] deps = hacking==0.10 usedevelop = False commands = flake8 {posargs:nailgun} [testenv:runfakemode] commands = bash "{toxinidir}/nailgun/tools/prepare_settings_yaml.sh" bash "{toxinidir}/nailgun/tools/prepare_database.sh" python {toxinidir}/nailgun/manage.py syncdb python {toxinidir}/nailgun/manage.py loaddefault python {toxinidir}/nailgun/manage.py loaddata {toxinidir}/nailgun/nailgun/fixtures/sample_environment.json python {toxinidir}/nailgun/manage.py run --config={toxinidir}/nailgun/test.yaml --fake-tasks --fake-tasks-tick-count=80 --fake-tasks-tick-interval=1 {posargs:--port 8000} [flake8] # NOTE(eli): H304 is "No relative imports" error, relative # imports are required for extensions which can be moved # from nailgun directory to different place ignore = H234,H302,H802,H304 exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs show-pep8 = True show-source = True count = True [hacking] import_exceptions = testtools.matchers