<commit_before>[tox]
minversion = 2.1
envlist = py{35,27},functional,pep8,pip-missing-reqs
skipsdist = True

[testenv]
usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
                      find
                      rm
                      env
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         LANGUAGE=en_US
         LC_ALL=en_US.utf-8
         OS_STDOUT_CAPTURE=1
         OS_STDERR_CAPTURE=1
         OS_TEST_TIMEOUT=160
deps = -r{toxinidir}/test-requirements.txt
commands =
  find . -type f -name "*.pyc" -delete
passenv = OS_DEBUG GENERATE_HASHES
# there is also secret magic in subunit-trace which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.

[testenv:py27]
commands =
    {[testenv]commands}
    stestr run '{posargs}'
    env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
    stestr slowest

[testenv:py35]
commands =
    {[testenv]commands}
    stestr run --blacklist-file=tests-py3.txt '{posargs}'
    env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'


[testenv:pep8]
basepython = python2.7
deps = {[testenv]deps}
commands =
  bash tools/flake8wrap.sh {posargs}
  # Check that all JSON files don't have \r\n in line.
  bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
  # Check that all included JSON files are valid JSON
  bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'

[testenv:fast8]
# This is a subset of the full pep8 check which
# only runs flake8 on the changes made since
# HEAD-1. For a full flake8 run including checking
# docs, just use pep8.
basepython = python2.7
commands =
  bash tools/flake8wrap.sh -HEAD

[testenv:functional]
# TODO(melwitt): This can be removed when functional tests are gating with
# python 3.x
basepython = python2.7
usedevelop = True
setenv = {[testenv]setenv}
commands =
  {[testenv]commands}
# NOTE(cdent): The group_regex describes how stestr will group tests into the
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
  stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'
  stestr slowest

# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating
# with python 3.5
[testenv:functional-py35]
basepython = python3.5
usedevelop = True
setenv = {[testenv]setenv}
commands =
    {[testenv]commands}
# NOTE(cdent): The group_regex describes how stestr will group tests into the
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
    stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'

[testenv:api-samples]
usedevelop = True
setenv = {[testenv]setenv}
         GENERATE_SAMPLES=True
         PYTHONHASHSEED=0
commands =
  find . -type f -name "*.pyc" -delete
  stestr --test-path=./nova/tests/functional/api_sample_tests run '{posargs}'
  stestr slowest

[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf

[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf

[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv = {[testenv]setenv}
         PYTHON=coverage run --source nova --parallel-mode
commands =
  coverage erase
  find . -type f -name "*.pyc" -delete
  stestr run '{posargs}'
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report

[testenv:debug]
commands =
  find . -type f -name "*.pyc" -delete
  oslo_debug_helper {posargs}

[testenv:venv]<commit_msg>Remove single quotes from posargs on stestr run commands<commit_after>[tox]
minversion = 2.1
envlist = py{35,27},functional,pep8,pip-missing-reqs
skipsdist = True

[testenv]
usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
                      find
                      rm
                      env
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         LANGUAGE=en_US
         LC_ALL=en_US.utf-8
         OS_STDOUT_CAPTURE=1
         OS_STDERR_CAPTURE=1
         OS_TEST_TIMEOUT=160
deps = -r{toxinidir}/test-requirements.txt
commands =
  find . -type f -name "*.pyc" -delete
passenv = OS_DEBUG GENERATE_HASHES
# there is also secret magic in subunit-trace which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.

[testenv:py27]
commands =
    {[testenv]commands}
    stestr run {posargs}
    env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
    stestr slowest

[testenv:py35]
commands =
    {[testenv]commands}
    stestr run --blacklist-file=tests-py3.txt {posargs}
    env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'


[testenv:pep8]
basepython = python2.7
deps = {[testenv]deps}
commands =
  bash tools/flake8wrap.sh {posargs}
  # Check that all JSON files don't have \r\n in line.
  bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
  # Check that all included JSON files are valid JSON
  bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'

[testenv:fast8]
# This is a subset of the full pep8 check which
# only runs flake8 on the changes made since
# HEAD-1. For a full flake8 run including checking
# docs, just use pep8.
basepython = python2.7
commands =
  bash tools/flake8wrap.sh -HEAD

[testenv:functional]
# TODO(melwitt): This can be removed when functional tests are gating with
# python 3.x
basepython = python2.7
usedevelop = True
setenv = {[testenv]setenv}
commands =
  {[testenv]commands}
# NOTE(cdent): The group_regex describes how stestr will group tests into the
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
  stestr --test-path=./nova/tests/functional --group_regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run {posargs}
  stestr slowest

# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating
# with python 3.5
[testenv:functional-py35]
basepython = python3.5
usedevelop = True
setenv = {[testenv]setenv}
commands =
    {[testenv]commands}
# NOTE(cdent): The group_regex describes how stestr will group tests into the
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
    stestr --test-path=./nova/tests/functional --group_regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run {posargs}

[testenv:api-samples]
usedevelop = True
setenv = {[testenv]setenv}
         GENERATE_SAMPLES=True
         PYTHONHASHSEED=0
commands =
  find . -type f -name "*.pyc" -delete
  stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs}
  stestr slowest

[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf

[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf

[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv = {[testenv]setenv}
         PYTHON=coverage run --source nova --parallel-mode
commands =
  coverage erase
  find . -type f -name "*.pyc" -delete
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report

[testenv:debug]
commands =
  find . -type f -name "*.pyc" -delete
  oslo_debug_helper {posargs}

[testenv:venv]
{'fraction_non_alphanumeric': 0.10691244239631337, 'fraction_numerical': 0.009626216077828981, 'mean_word_length': 3.7019740009629274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, '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': '7328769', 'n_tokens_mistral': 3356, 'n_tokens_neox': 3242, 'n_words': 987}