2019-12-23 17:30:08 +00:00
|
|
|
# Classic charm (with zaza): ./tox.ini
|
2016-09-06 22:09:15 +00:00
|
|
|
# This file is managed centrally by release-tools and should not be modified
|
2019-09-30 22:08:58 +00:00
|
|
|
# within individual charm repos. See the 'global' dir contents for available
|
|
|
|
# choices of tox.ini for OpenStack Charms:
|
|
|
|
# https://github.com/openstack-charmers/release-tools
|
2020-05-18 12:46:39 +00:00
|
|
|
#
|
|
|
|
# TODO: Distill the func test requirements from the lint/unit test
|
|
|
|
# requirements. They are intertwined. Also, Zaza itself should specify
|
|
|
|
# all of its own requirements and if it doesn't, fix it there.
|
2015-11-02 09:35:30 +00:00
|
|
|
[tox]
|
2019-09-30 22:08:58 +00:00
|
|
|
envlist = pep8,py3
|
|
|
|
# NOTE: Avoid build/test env pollution by not enabling sitepackages.
|
2019-08-27 17:46:08 +00:00
|
|
|
sitepackages = False
|
2019-09-30 22:08:58 +00:00
|
|
|
# NOTE: Avoid false positives by not skipping missing interpreters.
|
2019-08-27 17:46:08 +00:00
|
|
|
skip_missing_interpreters = False
|
2015-11-02 09:35:30 +00:00
|
|
|
|
|
|
|
[testenv]
|
2023-01-13 11:47:41 +00:00
|
|
|
# We use tox mainly for virtual environment management for test requirements
|
|
|
|
# and do not install the charm code as a Python package into that environment.
|
|
|
|
# Ref: https://tox.wiki/en/latest/config.html#skip_install
|
|
|
|
skip_install = True
|
2015-11-02 09:35:30 +00:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
PYTHONHASHSEED=0
|
2016-09-09 19:43:20 +00:00
|
|
|
CHARM_DIR={envdir}
|
2019-09-30 22:08:58 +00:00
|
|
|
commands = stestr run --slowest {posargs}
|
2022-01-27 15:33:27 +00:00
|
|
|
allowlist_externals =
|
|
|
|
charmcraft
|
2023-02-14 21:26:01 +00:00
|
|
|
{toxinidir}/rename.sh
|
2023-01-13 11:47:41 +00:00
|
|
|
passenv =
|
|
|
|
HOME
|
|
|
|
TERM
|
|
|
|
CS_*
|
|
|
|
OS_*
|
|
|
|
TEST_*
|
2020-05-18 12:46:39 +00:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2015-11-02 09:35:30 +00:00
|
|
|
|
2022-01-27 15:33:27 +00:00
|
|
|
[testenv:build]
|
|
|
|
basepython = python3
|
|
|
|
deps = -r{toxinidir}/build-requirements.txt
|
2023-01-13 11:47:41 +00:00
|
|
|
# charmcraft clean is done to ensure that
|
|
|
|
# `tox -e build` always performs a clean, repeatable build.
|
|
|
|
# For faster rebuilds during development,
|
|
|
|
# directly run `charmcraft -v pack && ./rename.sh`.
|
2022-01-27 15:33:27 +00:00
|
|
|
commands =
|
|
|
|
charmcraft clean
|
2022-06-10 20:14:48 +00:00
|
|
|
charmcraft -v pack
|
2022-01-27 15:33:27 +00:00
|
|
|
{toxinidir}/rename.sh
|
2023-01-13 11:47:41 +00:00
|
|
|
charmcraft clean
|
2022-01-27 15:33:27 +00:00
|
|
|
|
2022-06-10 20:14:48 +00:00
|
|
|
[testenv:py310]
|
|
|
|
basepython = python3.10
|
2021-10-29 21:00:42 +00:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
|
2022-06-10 20:14:48 +00:00
|
|
|
[testenv:py3]
|
|
|
|
basepython = python3
|
2020-05-18 12:46:39 +00:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
|
2016-02-16 07:05:03 +00:00
|
|
|
[testenv:pep8]
|
2018-09-26 22:40:15 +00:00
|
|
|
basepython = python3
|
2021-07-22 12:58:24 +00:00
|
|
|
deps = flake8==3.9.2
|
2022-06-10 20:14:48 +00:00
|
|
|
git+https://github.com/juju/charm-tools.git
|
2019-06-14 06:48:09 +00:00
|
|
|
commands = flake8 {posargs} hooks unit_tests tests actions lib files
|
2016-03-23 08:52:13 +00:00
|
|
|
charm-proof
|
2015-11-02 09:35:30 +00:00
|
|
|
|
2019-03-01 11:16:56 +00:00
|
|
|
[testenv:cover]
|
|
|
|
# Technique based heavily upon
|
|
|
|
# https://github.com/openstack/nova/blob/master/tox.ini
|
|
|
|
basepython = python3
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run
|
|
|
|
commands =
|
|
|
|
coverage erase
|
2019-09-30 22:08:58 +00:00
|
|
|
stestr run --slowest {posargs}
|
2019-03-01 11:16:56 +00:00
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
coverage report
|
|
|
|
|
|
|
|
[coverage:run]
|
|
|
|
branch = True
|
|
|
|
concurrency = multiprocessing
|
|
|
|
parallel = True
|
|
|
|
source =
|
|
|
|
.
|
|
|
|
omit =
|
|
|
|
.tox/*
|
|
|
|
*/charmhelpers/*
|
|
|
|
unit_tests/*
|
|
|
|
|
2015-11-02 09:35:30 +00:00
|
|
|
[testenv:venv]
|
2018-09-26 22:40:15 +00:00
|
|
|
basepython = python3
|
2015-11-02 09:35:30 +00:00
|
|
|
commands = {posargs}
|
|
|
|
|
2019-09-30 22:08:58 +00:00
|
|
|
[testenv:func-noop]
|
2019-12-23 17:30:08 +00:00
|
|
|
basepython = python3
|
2016-07-19 08:36:17 +00:00
|
|
|
commands =
|
2019-12-23 17:30:08 +00:00
|
|
|
functest-run-suite --help
|
2016-07-19 08:36:17 +00:00
|
|
|
|
2019-09-30 22:08:58 +00:00
|
|
|
[testenv:func]
|
2019-12-23 17:30:08 +00:00
|
|
|
basepython = python3
|
2016-07-19 08:36:17 +00:00
|
|
|
commands =
|
2019-12-23 17:30:08 +00:00
|
|
|
functest-run-suite --keep-model
|
2016-07-19 08:36:17 +00:00
|
|
|
|
2019-09-30 22:08:58 +00:00
|
|
|
[testenv:func-smoke]
|
2019-12-23 17:30:08 +00:00
|
|
|
basepython = python3
|
2016-07-19 08:36:17 +00:00
|
|
|
commands =
|
2019-12-23 17:30:08 +00:00
|
|
|
functest-run-suite --keep-model --smoke
|
2016-07-19 08:36:17 +00:00
|
|
|
|
2019-09-30 22:08:58 +00:00
|
|
|
[testenv:func-dev]
|
2019-12-23 17:30:08 +00:00
|
|
|
basepython = python3
|
|
|
|
commands =
|
|
|
|
functest-run-suite --keep-model --dev
|
|
|
|
|
|
|
|
[testenv:func-target]
|
|
|
|
basepython = python3
|
2016-07-19 08:36:17 +00:00
|
|
|
commands =
|
2019-12-23 17:30:08 +00:00
|
|
|
functest-run-suite --keep-model --bundle {posargs}
|
2016-07-19 08:36:17 +00:00
|
|
|
|
2015-11-02 09:35:30 +00:00
|
|
|
[flake8]
|
2020-09-26 17:27:02 +00:00
|
|
|
ignore = E402,E226,W503,W504
|
2016-09-06 22:09:15 +00:00
|
|
|
exclude = */charmhelpers
|