python-observabilityclient/tox.ini
Jaromir Wysoglad e8961fdf62 Add functional tests
This adds new functional tests, which are supposed to be run
on devstack with a running instance of prometheus.
It tests all of the cli commands as well as all the functions
exposed in the python client.

These tests could be included into the telemetry-dsvm-integration
jobs in the future to use the same devstack vm.

Change-Id: Ibd6deec559465bf3cb7480681b816f55bdf9010e
2023-11-15 05:54:41 -05:00

85 lines
2.5 KiB
INI

[tox]
minversion = 4.2.5
envlist = py38,py39,py311,pep8
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
OBSERVABILITY_CLIENT_EXEC_DIR={envdir}/bin
OS_TEST_PATH = ./observabilityclient/tests/unit
passenv =
PROMETHEUS_*
OBSERVABILITY_*
deps = .[test]
pytest
commands = pytest {posargs} {env:OS_TEST_PATH}
[testenv:pep8]
basepython = python3
deps = hacking<3.1.0,>=3.0
commands = flake8
[testenv:venv]
deps = .[test,doc]
commands = {posargs}
[testenv:cover]
deps = {[testenv]deps}
pytest-cov
commands = observabilityclient {posargs} {env:$OS_TEST_PATH}
[testenv:functional]
setenv =
OS_TEST_PATH = ./observabilityclient/tests/functional
OS_TESTENV_NAME = {envname}
allowlist_externals =
bash
deps = .[test]
pytest
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bash tools/fix_ca_bundle.sh
pytest {posargs} {env:OS_TEST_PATH}
[flake8]
show-source = True
# A002 argument "input" is shadowing a python builtin
# A003 class attribute "list" is shadowing a python builtin
# D100 Missing docstring in public module
# D101 Missing docstring in public class
# D102 Missing docstring in public method
# D103 Missing docstring in public function
# D104 Missing docstring in public package
# D105 Missing docstring in magic method
# D106 Missing docstring in public nested class
# D107 Missing docstring in __init__
# W503 line break before binary operator
# W504 line break after binary operator
ignore = A002,A003,D100,D101,D102,D103,D104,D105,D106,D107,W503,W504
exclude=.venv,.git,.tox,dist,doc,*egg,build
# [H101] Include your name with TODOs as in # TODO(yourname).
# [H104] Empty files should not contain license or comments
# [H106] Do not put vim configuration in source files.
# [H201] Do not write except:, use except Exception: at the very least.
# [H202] Testing for Exception being raised
# [H203] Use assertIs(Not)None to check for None.
# [H204] Use assert(Not)Equal to check for equality.
# [H205] Use assert(Greater|Less)(Equal) for comparison.
# [H23] Py3 compat
# [H301] Do not import more than one module per line (*)
# [H303] Do not use wildcard * import (*)
# [H304] Do not make relative imports
# [H306] Alphabetically order your imports by the full module path.
enable-extensions=G,H101,H104,H106,H201,H202,H203,H204,H205,H23,H301,H303,H304,H306
application-import-names = observabilityclient
[pytest]
addopts = --verbose
norecursedirs = .tox