Update tox.ini files from release-tools gold copy

All OpenStack Charms now contain identical tox.ini files,
not to be modified or made unique within each charm repo.

This is to ensure consistency across charm repos in tox
target naming, approach and purpose, also giving the
charm dev and test experience additional consistency.

Also create empty dirs with .keep files where necessary.
Some classic charms have actions and/or lib dirs, and some
do not. In all classic charms, flake will now check those
dirs to ensure lint coverage of existing or future content.

Resolve existing lint which was discovered by the updated
coverage.

Change-Id: I2fde6b6b0cc3c74c1e7a6acccf61d3df7cec8d75
This commit is contained in:
Ryan Beisner 2016-09-08 22:09:35 +00:00
parent 4e8b851f1e
commit 3b801648fd
3 changed files with 25 additions and 22 deletions

View File

@ -270,7 +270,7 @@ class BindRNDCRelationAdapter(openstack_adapters.OpenStackRelationAdapter):
class DesignateConfigurationAdapter(
openstack_adapters.APIConfigurationAdapter):
openstack_adapters.APIConfigurationAdapter):
def __init__(self, port_map=None):
super(DesignateConfigurationAdapter, self).__init__(

View File

@ -1,13 +1,16 @@
# Source charm: ./src/tox.ini
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos.
[tox]
envlist = pep8
skipsdist = True
[testenv]
envdir = .tox/py27
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
AMULET_SETUP_TIMEOUT=2700
passenv = HOME TERM AMULET_HTTP_PROXY AMULET_OS_VIP
whitelist_externals = juju
passenv = HOME TERM AMULET_*
deps = -r{toxinidir}/test-requirements.txt
install_command =
pip install --allow-unverified python-apt {opts} {packages}
@ -23,28 +26,24 @@ commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy
[testenv:func27]
# Charm Functional Test
# Run all gate tests which are +x (expected to always pass)
basepython = python2.7
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy
[testenv:func27-smoke]
# Charm Functional Test
# Run a specific test as an Amulet smoke test (expected to always pass)
basepython = python2.7
commands =
bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy
[testenv:func27-dfs]
# Charm Functional Test
# Run all deploy-from-source tests which are +x (may not always pass!)
basepython = python2.7
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy
[testenv:func27-dev]
# Charm Functional Test
# Run all development test targets which are +x (may not always pass!)
basepython = python2.7
commands =

34
tox.ini
View File

@ -1,36 +1,28 @@
# Source charm: ./tox.ini
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos.
[tox]
skipsdist = True
envlist = pep8,py34,py35
skip_missing_interpreters = True
[testenv]
basepython = python2.7
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
TERM=linux
INTERFACE_PATH={toxinidir}/interfaces
LAYER_PATH={toxinidir}/layers
INTERFACE_PATH={toxinidir}/interfaces
JUJU_REPOSITORY={toxinidir}/build
passenv = http_proxy https_proxy
install_command =
pip install {opts} {packages}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements.txt
[testenv:build]
basepython = python2.7
commands =
charm-build --log-level DEBUG -o {toxinidir}/build src
[testenv:venv]
commands = {posargs}
[testenv:pep8]
commands = flake8 {posargs} src/reactive src/lib unit_tests
# Disable py27 tests as this is a reactive python 3 charm. Once project
# config has been updated this tox target can be removed
[testenv:py27]
commands = /bin/true
charm-build --log-level DEBUG -o {toxinidir}/build src {posargs}
[testenv:py34]
basepython = python3.4
@ -41,3 +33,15 @@ commands = ostestr {posargs}
basepython = python3.5
deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}
[testenv:pep8]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
commands = flake8 {posargs} src unit_tests
[testenv:venv]
commands = {posargs}
[flake8]
# E402 ignore necessary for path append before sys module import in actions
ignore = E402