zaqar-ui/tox.ini
manchandavishal b419a23ce1 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated.
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.
For more info. please refer [1]. It also import ugettext_lazy
in zaqar_ui/api/rest/zaqar.py file to fix pep8 issue.

[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I4e0c00b6d01470f59a6fa5799eaa10d3e5e94f61
2021-02-16 06:12:39 +00:00

116 lines
3.1 KiB
INI

[tox]
envlist = pep8,eslint,karma-local,docs-local,releasenotes,lower-constraints-local
minversion = 2.3.2
skipsdist = True
[testenv]
basepython = python3
usedevelop = True
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=zaqar_ui.test.settings
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python manage.py test {posargs}
# For installation of horizon on local
# NOTICE: this tox.ini requires horizon repository cloned in sibling directory.
[testenv:hz-local]
commands =
pip install -e ../horizon
[testenv:venv]
commands = {posargs}
[testenv:pep8]
commands = flake8 {posargs}
[flake8]
ignore = F405,W504
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules
max-complexity = 20
[testenv:cover]
commands =
coverage erase
coverage run {toxinidir}/manage.py test zaqar_ui
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
# NOTE(shu-mutow): On CI infra, horizon will be installed
# according to job setting. but on local, we need to install
# horizon from master branch.
[testenv:py36-local]
basepython = python3.6
commands =
{[testenv:hz-local]commands}
{[testenv]commands}
[testenv:eslint]
whitelist_externals =
npm
commands =
npm install
npm run lint
# NOTE(shu-mutow): The "postinstall" script on package.json will install horizon
# from master branch into python3.x environment for testing javascripts.
# Horizon from master is needed to be cloned into ../horizon on both local and CI.
[testenv:karma]
whitelist_externals =
{[testenv:eslint]whitelist_externals}
commands =
npm install
npm run test
[testenv:karma-local]
whitelist_externals =
{[testenv:eslint]whitelist_externals}
commands =
{[testenv:karma]commands}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
# zaqar-ui doc generated the module reference,
# so requirements.txt should be here to apply upper-constraints
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands=
sphinx-build -W -b html doc/source doc/build/html
[testenv:docs-local]
deps =
{[testenv:docs]deps}
commands=
{[testenv:hz-local]commands}
{[testenv:docs]commands}
[testenv:releasenotes]
deps =
{[testenv:docs]deps}
commands =
sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:lower-constraints-local]
deps =
{[testenv:lower-constraints]deps}
commands =
{[testenv:hz-local]commands}
{[testenv]commands}