<commit_before>[tox]
minversion = 3.1
envlist = pep8,py36,py38,releasenotes,npm,py3-dj32
skipsdist = True
# Automatic envs (pyXX) will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set
# ignore_basepython_conflict.
ignore_basepython_conflict = True

[testenv]
basepython = python3
usedevelop = True
setenv =
  VIRTUAL_ENV = {envdir}
  PYTHONDONTWRITEBYTECODE = 1
  PYTHONWARNINGS = once,ignore::PendingDeprecationWarning
  py{3,36,37}:PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::ImportWarning:backports
  # DeprecationWarning is disabled in dj32 tox env as Django 3.2
  # deprecated Django 2.2 features. This workaround is just to reduce
  # the number of warnings due to this change.
  # It should be dropped when we drop Django 2.2 support.
  dj32: PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::DeprecationWarning

whitelist_externals =
  bash
  find
deps =
  -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
  # Unit test for a local hacking rule requires hacking.
  hacking>=3.0.1,<3.1.0 # Apache-2.0
commands =
  dj32: pip install django>=3.2,<3.3
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/unit_tests.sh {toxinidir} {posargs}

[testenv:lower-constraints]
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
  # Unit test for a local hacking rule requires hacking.
  hacking>=3.0.1,<3.1.0 # Apache-2.0

[testenv:venv]
envdir = {toxworkdir}/venv
commands = {posargs}

[testenv:pep8]
envdir = {toxworkdir}/linters
deps =
  {[testenv]deps}
  flake8-import-order==0.12 # LGPLv3
  pylint==2.6.0 # GPLv2
  bandit!=1.6.0,>=1.4.0 # Apache-2.0
setenv =
  DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands =
  flake8 {posargs}
  {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
  bash {toxinidir}/tools/find_executables.sh
  pylint -j 4 --verbose --rcfile=.pylintrc -f colorized openstack_dashboard openstack_auth horizon

[testenv:cover]
envdir = {toxworkdir}/venv
whitelist_externals =
  bash
commands =
  coverage erase
  bash {toxinidir}/tools/unit_tests.sh --coverage {toxinidir}
  coverage xml
  coverage html -d coverage
  coverage report --show-missing --skip-covered

[testenv:selenium]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:selenium-headless]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  SELENIUM_HEADLESS=1
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:selenium-phantomjs]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  SELENIUM_PHANTOMJS=1
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:integration]
envdir = {toxworkdir}/venv
# Run integration tests only
passenv =
  DISPLAY
  FFMPEG_INSTALLED
setenv =
  INTEGRATION_TESTS=1
  SELENIUM_HEADLESS=False
commands =
  oslo-config-generator --namespace openstack_dashboard_integration_tests
  pytest {toxinidir}/openstack_dashboard/test/integration_tests --ds=openstack_dashboard.test.settings -v --junitxml="{toxinidir}/test_reports/integration_test_results.xml" --html="{toxinidir}/test_reports/integration_test_results.html" --self-contained-html {posargs}

[testenv:npm]
passenv =
  HOME
  DISPLAY
commands =
  nodeenv -p
  npm install
  npm run {posargs:test}

[testenv:tests_system_packages]
# Provide an environment for system packagers that dont want anything from pip
# Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
sitepackages = True
passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
# Sets deps to an empty list so nothing is installed from pip
deps =
commands =
  pip install -U {env:TOX_EXTRA_DEPS:}
  {[testenv]commands}

[testenv:docs]
# We need to install horizon dependecies to build module references
deps =
  -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -j auto -W -b html doc/source doc/build/html
  doc8 doc/source

[testenv:pdf-docs]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
whitelist_externals =
  make
commands =
  sphinx-build -j auto -W -b latex doc/source doc/build/pdf
  make -C doc/build/pdf

[testenv:releasenotes]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  doc8 doc/source

[testenv:manage]<commit_msg>Update TOX_CONSTRAINTS_FILE for stable/xena<commit_after>[tox]
minversion = 3.1
envlist = pep8,py36,py38,releasenotes,npm,py3-dj32
skipsdist = True
# Automatic envs (pyXX) will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set
# ignore_basepython_conflict.
ignore_basepython_conflict = True

[testenv]
basepython = python3
usedevelop = True
setenv =
  VIRTUAL_ENV = {envdir}
  PYTHONDONTWRITEBYTECODE = 1
  PYTHONWARNINGS = once,ignore::PendingDeprecationWarning
  py{3,36,37}:PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::ImportWarning:backports
  # DeprecationWarning is disabled in dj32 tox env as Django 3.2
  # deprecated Django 2.2 features. This workaround is just to reduce
  # the number of warnings due to this change.
  # It should be dropped when we drop Django 2.2 support.
  dj32: PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::DeprecationWarning

whitelist_externals =
  bash
  find
deps =
  -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena}
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
  # Unit test for a local hacking rule requires hacking.
  hacking>=3.0.1,<3.1.0 # Apache-2.0
commands =
  dj32: pip install django>=3.2,<3.3
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/unit_tests.sh {toxinidir} {posargs}

[testenv:lower-constraints]
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
  # Unit test for a local hacking rule requires hacking.
  hacking>=3.0.1,<3.1.0 # Apache-2.0

[testenv:venv]
envdir = {toxworkdir}/venv
commands = {posargs}

[testenv:pep8]
envdir = {toxworkdir}/linters
deps =
  {[testenv]deps}
  flake8-import-order==0.12 # LGPLv3
  pylint==2.6.0 # GPLv2
  bandit!=1.6.0,>=1.4.0 # Apache-2.0
setenv =
  DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands =
  flake8 {posargs}
  {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
  bash {toxinidir}/tools/find_executables.sh
  pylint -j 4 --verbose --rcfile=.pylintrc -f colorized openstack_dashboard openstack_auth horizon

[testenv:cover]
envdir = {toxworkdir}/venv
whitelist_externals =
  bash
commands =
  coverage erase
  bash {toxinidir}/tools/unit_tests.sh --coverage {toxinidir}
  coverage xml
  coverage html -d coverage
  coverage report --show-missing --skip-covered

[testenv:selenium]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:selenium-headless]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  SELENIUM_HEADLESS=1
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:selenium-phantomjs]
envdir = {toxworkdir}/venv
setenv =
  {[testenv]setenv}
  SELENIUM_PHANTOMJS=1
  WITH_SELENIUM=1
commands =
  find . -type f -name "*.pyc" -delete
  bash {toxinidir}/tools/selenium_tests.sh {toxinidir} {posargs}

[testenv:integration]
envdir = {toxworkdir}/venv
# Run integration tests only
passenv =
  DISPLAY
  FFMPEG_INSTALLED
setenv =
  INTEGRATION_TESTS=1
  SELENIUM_HEADLESS=False
commands =
  oslo-config-generator --namespace openstack_dashboard_integration_tests
  pytest {toxinidir}/openstack_dashboard/test/integration_tests --ds=openstack_dashboard.test.settings -v --junitxml="{toxinidir}/test_reports/integration_test_results.xml" --html="{toxinidir}/test_reports/integration_test_results.html" --self-contained-html {posargs}

[testenv:npm]
passenv =
  HOME
  DISPLAY
commands =
  nodeenv -p
  npm install
  npm run {posargs:test}

[testenv:tests_system_packages]
# Provide an environment for system packagers that dont want anything from pip
# Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
sitepackages = True
passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
# Sets deps to an empty list so nothing is installed from pip
deps =
commands =
  pip install -U {env:TOX_EXTRA_DEPS:}
  {[testenv]commands}

[testenv:docs]
# We need to install horizon dependecies to build module references
deps =
  -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -j auto -W -b html doc/source doc/build/html
  doc8 doc/source

[testenv:pdf-docs]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
whitelist_externals =
  make
commands =
  sphinx-build -j auto -W -b latex doc/source doc/build/pdf
  make -C doc/build/pdf

[testenv:releasenotes]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  doc8 doc/source

[testenv:manage]
{'fraction_non_alphanumeric': 0.108883964544722, 'fraction_numerical': 0.015713134568896052, 'mean_word_length': 4.755942028985507, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '3117860', 'n_tokens_mistral': 3917, 'n_tokens_neox': 3717, 'n_words': 814}