Files
2026-09-09 13:51:06 +00:00

111 lines
2.5 KiB
INI

# Copyright 2026 Cloudbase Solutions Srl
# All Rights Reserved.
[tox]
minversion = 4.0.2
envlist = fmt,flake8,mypy,pep8,py3
skipsdist = True
[vars]
src_path = {toxinidir}/openvixdisklib
tst_path = {toxinidir}/tests
all_path = {[vars]src_path} {[vars]tst_path}
vddk_path = {toxinidir}/.vddk
[testenv]
sitepackages = True
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE=1
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
allowlist_externals =
bash
[testenv:integration]
description = Run integration tests against a VMware environment.
sitepackages = True
usedevelop = True
setenv =
{[testenv]setenv}
LD_LIBRARY_PATH={[vars]vddk_path}
LD_PRELOAD=
commands =
python -m pytest -v tests/integration/ {posargs}
[testenv:integration-coverage]
description = Integration tests with coverage report.
sitepackages = True
usedevelop = True
setenv =
{[testenv:integration]setenv}
deps =
{[testenv]deps}
pytest-cov
pycobertura
commands =
python -m pytest --cov=openvixdisklib --cov-report=term-missing \
--cov-report=xml -p no:cacheprovider tests/integration/ {posargs}
pycobertura show --format html --source openvixdisklib \
coverage.xml -o coverage.html
[testenv:perf]
description = Compare openvixdisklib and VDDK I/O throughput against the lab.
sitepackages = True
usedevelop = True
setenv =
{[testenv:integration]setenv}
commands =
python -m pytest -v -s tests/perf/ {posargs}
[testenv:stress]
description = Repeat connect/open/close against the lab to detect socket leaks.
sitepackages = True
usedevelop = True
setenv =
{[testenv:integration]setenv}
commands =
python -m pytest -v tests/stress/ {posargs}
[testenv:fmt]
description = Format the code based on the coding style standards.
deps =
ruff
commands =
ruff check --select I --fix {[vars]all_path}
ruff format {[vars]all_path}
[testenv:pep8]
description = Verify the coding style (pep8).
deps =
ruff
commands =
ruff format --diff {[vars]all_path}
ruff check {[vars]all_path}
[testenv:mypy]
description = Type checks (mypy).
deps =
mypy
pytest
commands =
mypy {[vars]all_path}
[testenv:flake8]
sitepackages = True
deps =
flake8
commands = flake8 {[vars]all_path} {posargs}
allowlist_externals =
flake8
[flake8]
ignore = E125,E251,W503,W504,E305,E731,E117,W605,F632,E203
exclude = .venv,.git,.tox,dist,build,*.egg,docs,._*
# Same length as ruff.
max-line-length = 88
per-file-ignores =
tests/integration/vix_disklib_errors.py:E501