From 068a29eccf2eb506c6fb2dbdd7b4a34df1ca9005 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 6 Sep 2016 22:02:23 +0000 Subject: [PATCH] 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. Change-Id: Ie3752edbe5fc9518e2d31ea27e805d2812e1b76b --- src/tox.ini | 66 +++++++++++++++++++++++++++++++---------------------- tox.ini | 24 +++++++++---------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/tox.ini b/src/tox.ini index 83610cd..479d7bb 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -1,41 +1,53 @@ +# Source charm: ./src/tox.ini +# This file is managed centrally by release-tools and should not be modified +# within individual charm repos. [tox] -skipsdist = True envlist = pep8 +skipsdist = True [testenv] -sitepackages = False setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 - TERM=linux - INTERFACE_PATH={toxinidir}/interfaces - LAYER_PATH={toxinidir}/layers - JUJU_REPOSITORY={toxinidir}/build -passenv = http_proxy https_proxy + 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} -commands = ostestr {posargs} - -[testenv:py27] -basepython = python2.7 -deps = -r{toxinidir}/test-requirements.txt - -[testenv:py34] -basepython = python3.4 -deps = -r{toxinidir}/test-requirements.txt - -[testenv:py35] -basepython = python3.5 -deps = -r{toxinidir}/test-requirements.txt [testenv:pep8] basepython = python2.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = flake8 {posargs} hooks unit_tests tests actions - charm-proof +commands = charm-proof + +[testenv:func27-noop] +# DRY RUN - For Debug +basepython = python2.7 +commands = + bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy + +[testenv:func27] +# 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] +# 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] +# 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] +# Run all development test targets which are +x (may not always pass!) +basepython = python2.7 +commands = + bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy [testenv:venv] commands = {posargs} - -[flake8] -ignore = E402 diff --git a/tox.ini b/tox.ini index 3b6a9f1..893f30f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +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 +envlist = pep8,py34,py35 skip_missing_interpreters = True [testenv] -sitepackages = False 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 --allow-unverified python-apt {opts} {packages} -commands = ostestr {posargs} + pip install {opts} {packages} +deps = + -r{toxinidir}/requirements.txt [testenv:build] basepython = python2.7 commands = - charm-build --log-level DEBUG -o {toxinidir}/build src -deps = -r{toxinidir}/requirements.txt - -[testenv:py27] -basepython = python2.7 -deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} + charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} [testenv:py34] basepython = python3.4 @@ -46,4 +43,5 @@ commands = flake8 {posargs} src unit_tests commands = {posargs} [flake8] -ignore = E402,E226 +# E402 ignore necessary for path append before sys module import in actions +ignore = E402