<commit_before>[tox]
minversion = 1.6
skipsdist = True
setupdir = {toxinidir}/nailgun
envlist = py27,py34,pep8

[base]
ARTS = {env:ARTS:test_run}
TOOLS = {toxinidir}/nailgun/tools

[common]
changedir={toxinidir}/nailgun
setenv =
         DB_ROOT={env:DB_ROOT:postgres}
         DB_ROOTPW={env:DB_ROOTPW:insecure_slave}
         DB_ROOTPGPASS={[base]ARTS}/pgpass

         NAILGUN_DB_PREPARE={env:NAILGUN_DB_PREPARE:yes}
         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_USERPW={env:NAILGUN_DB_USERPW:openstack_citest}

         NAILGUN_ROOT={toxinidir}/nailgun
         NAILGUN_STATIC={env:NAILGUN_STATIC:static}
         NAILGUN_TEMPLATES={env:NAILGUN_TEMPLATES: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

[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 =
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env"
    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 =
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env"
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_database"
    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/test-requirements.txt
commands = {posargs:}

[testenv:pep8]
deps = hacking==0.10
usedevelop = False
commands =
    flake8 {posargs:nailgun}

[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
<commit_msg>Add performance test command into main tox.ini<commit_after>[tox]
minversion = 1.6
skipsdist = True
setupdir = {toxinidir}/nailgun
envlist = py27,py34,pep8

[base]
ARTS = {env:ARTS:test_run}
TOOLS = {toxinidir}/nailgun/tools

[common]
changedir={toxinidir}/nailgun
setenv =
         DB_ROOT={env:DB_ROOT:postgres}
         DB_ROOTPW={env:DB_ROOTPW:insecure_slave}
         DB_ROOTPGPASS={[base]ARTS}/pgpass

         NAILGUN_DB_PREPARE={env:NAILGUN_DB_PREPARE:yes}
         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_USERPW={env:NAILGUN_DB_USERPW:openstack_citest}

         NAILGUN_ROOT={toxinidir}/nailgun
         NAILGUN_STATIC={env:NAILGUN_STATIC:static}
         NAILGUN_TEMPLATES={env:NAILGUN_TEMPLATES: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

[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 =
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env"
    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:performance]
commands =
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env"
    py.test -vv --cleandb --junit-xml {toxinidir}/nailgun/nailgun.xml -m 'performance' -n 4 {posargs:nailgun/test}

[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 =
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_env"
    bash -c "{[base]TOOLS}/env.sh prepare_nailgun_database"
    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/test-requirements.txt
commands = {posargs:}

[testenv:pep8]
deps = hacking==0.10
usedevelop = False
commands =
    flake8 {posargs:nailgun}

[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

{'fraction_non_alphanumeric': 0.12245532245532245, 'fraction_numerical': 0.014763014763014764, 'mean_word_length': 4.31023102310231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1124762', 'n_tokens_mistral': 2658, 'n_tokens_neox': 2500, 'n_words': 386}