138c3446d1
Change-Id: If69ac4da23bc537f29befa1b106acd3cdc7a4375 Signed-off-by: Andriy Kurilin <andr.kurilin@gmail.com>
153 lines
4.9 KiB
INI
153 lines
4.9 KiB
INI
[tox]
|
|
minversion = 4.28.0
|
|
ignore_basepython_conflict = true
|
|
envlist = py310,py313,pep8,samples
|
|
|
|
[testenv]
|
|
extras = {env:RALLY_EXTRAS:}
|
|
setenv = LANG=en_US.UTF-8
|
|
LC_CTYPE="en.US.UTF-8"
|
|
LANGUAGE=en_US:en
|
|
LC_ALL=C
|
|
PYTHONHASHSEED=0
|
|
PYTEST_REPORT = {env:PYTEST_REPORT:{toxinidir}/.test_results/{envname}_report.html}
|
|
TESTS_DIR = "tests/unit"
|
|
allowlist_externals = find
|
|
rm
|
|
make
|
|
mkdir
|
|
constraints = {toxinidir}/upper-constraints.txt
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
usedevelop = True
|
|
pre_commands = find . -type f -name "*.pyc" -delete
|
|
commands =
|
|
pytest -vv \ # base command
|
|
--html={env:PYTEST_REPORT} \ # html report
|
|
--self-contained-html \ # embedded css
|
|
--durations=10 \ # get a list of the slowest 10 tests
|
|
-n auto \ # launch tests in parallel
|
|
{posargs:{env:TESTS_DIR}}
|
|
distribute = false
|
|
basepython = python3
|
|
passenv =
|
|
PYTEST_REPORT
|
|
http_proxy
|
|
HTTP_PROXY
|
|
https_proxy
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
HOME
|
|
|
|
[testenv:zuul-ansible-lint]
|
|
distribute = false
|
|
deps = ansible-lint
|
|
commands = ansible-lint --strict --config-file tests/ci/playbooks/.ansible-lint tests/ci/playbooks
|
|
|
|
[testenv:pep8]
|
|
skip_install = true
|
|
commands =
|
|
flake8
|
|
ruff check
|
|
|
|
[testenv:mypy]
|
|
skip_install = true
|
|
deps = {[testenv]deps}
|
|
-r{toxinidir}/types-requirements.txt
|
|
commands = mypy {posargs:"rally"}
|
|
|
|
[testenv:samples]
|
|
setenv =
|
|
TESTS_DIR = "tests/samples"
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:functional]
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
stestr
|
|
setenv =
|
|
TESTS_DIR = "tests/functional"
|
|
|
|
[testenv:cover]
|
|
commands = {toxinidir}/tests/ci/cover.sh {posargs}
|
|
allowlist_externals = {toxinidir}/tests/ci/cover.sh
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-c{toxinidir}/upper-constraints.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -v -b html doc/source doc/build/html
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file etc/rally/rally-config-generator.conf
|
|
|
|
[testenv:requirements]
|
|
deps = requests[security]
|
|
commands = python {toxinidir}/tests/ci/sync_requirements.py {posargs}
|
|
|
|
[flake8]
|
|
# Ruff owns pycodestyle (E/W), pyflakes (F), import ordering (I) and the hacking
|
|
# checks that overlap them: H201 (bare except -> E722), H301 (imports per line
|
|
# -> E401), H303 (wildcard import -> F403) and H306 (import order -> I001).
|
|
# flake8 runs the rest of the hacking (H) checks and the Rally-specific (N3xx)
|
|
# checks.
|
|
ignore = H105,H201,H301,H303,H306,H703,E,W,F
|
|
show-source = true
|
|
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,tools,build,setup.py
|
|
|
|
[flake8:local-plugins]
|
|
extension =
|
|
N301 = checks:check_assert_methods_from_mock
|
|
N312 = checks:no_use_conf_debug_check
|
|
N313 = checks:check_log_warn
|
|
N320 = checks:assert_true_instance
|
|
N321 = checks:assert_equal_type
|
|
N322 = checks:assert_equal_none
|
|
N323 = checks:assert_true_or_false_with_in
|
|
N324 = checks:assert_equal_in
|
|
N326 = checks:assert_equal_true_or_false
|
|
N340 = checks:check_no_direct_rally_objects_import
|
|
N341 = checks:check_no_oslo_deprecated_import
|
|
N342 = checks:check_opts_import_path
|
|
N351 = checks:check_no_constructor_data_struct
|
|
N352 = checks:check_dict_formatting_in_string
|
|
N354 = checks:check_raises
|
|
N360 = checks:check_db_imports_in_cli
|
|
N361 = checks:check_objects_imports_in_cli
|
|
paths = ./tests/hacking
|
|
|
|
[testenv:bindep]
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
# separately, outside of the requirements files.
|
|
deps = bindep
|
|
commands = bindep
|
|
|
|
[testenv:self]
|
|
commands = \
|
|
find . -type f -name "*.pyc" -delete
|
|
mkdir -p {toxinidir}/.test_results
|
|
python3 {toxinidir}/tests/ci/rally_self_job.py --task {toxinidir}/rally-jobs/self-rally.yaml --plugins-path {toxinidir}/rally-jobs/plugins
|
|
|
|
[pytest]
|
|
filterwarnings =
|
|
error
|
|
# we do not use anything inner from OptionParser, so we do not care about it's parent
|
|
ignore:The frontend.Option.* class will be.*:DeprecationWarning:
|
|
# python 3.10
|
|
ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning:
|
|
# pytest-cov & pytest-xdist
|
|
ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning:
|
|
# python3.11 ?
|
|
ignore:datetime\.datetime\.utcnow\(\) is deprecated.*:DeprecationWarning:
|
|
ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated.*:DeprecationWarning:
|
|
ignore:eventletutils module is deprecated and will be removed\.:DeprecationWarning:
|