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: Ibdb8309fdd7a907826d783e04b8a9650fe35035f
This commit is contained in:
Ryan Beisner 2016-09-08 22:09:18 +00:00
parent c63fea2738
commit 43d1bdc2b7
3 changed files with 32 additions and 25 deletions

View File

@ -98,11 +98,14 @@ class AodhBasicDeployment(OpenStackAmuletDeployment):
tenant='admin')
# Authenticate admin with aodh endpoint
aodh_ep = self.keystone.service_catalog.url_for(service_type='alarming',
endpoint_type='publicURL')
keystone_ep = self.keystone.service_catalog.url_for(service_type='identity',
endpoint_type='publicURL')
os_token = self.keystone.auth_token
aodh_ep = self.keystone.service_catalog.url_for(
service_type='alarming',
endpoint_type='publicURL')
keystone_ep = self.keystone.service_catalog.url_for(
service_type='identity',
endpoint_type='publicURL')
auth = keystone_identity.V2Token(auth_url=keystone_ep,
token=self.keystone.auth_token)
sess = keystone_session.Session(auth=auth)

View File

@ -1,12 +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
whitelist_externals = juju
passenv = HOME TERM AMULET_*
deps = -r{toxinidir}/test-requirements.txt
install_command =
pip install --allow-unverified python-apt {opts} {packages}
@ -22,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]
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
[testenv:py27]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}
commands =
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