diff --git a/src/files/.gitkeep b/src/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/test-requirements.txt b/src/test-requirements.txt index e56db9a..a4b77a5 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -15,7 +15,7 @@ aodhclient>=0.1.0 gnocchiclient>=3.1.0,<3.2.0 python-barbicanclient>=4.0.1 python-ceilometerclient>=1.5.0 -python-cinderclient>=1.4.0 +python-cinderclient>=1.4.0,<5.0.0 python-designateclient>=1.5 python-glanceclient>=1.1.0 python-heatclient>=0.8.0 diff --git a/src/tox.ini b/src/tox.ini index 4c5f90e..8a91d50 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -1,49 +1,51 @@ -# Source charm: ./src/tox.ini +# Source charm (with amulet): ./src/tox.ini # This file is managed centrally by release-tools and should not be modified -# within individual charm repos. +# 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 + [tox] envlist = pep8 skipsdist = True +# NOTE: Avoid build/test env pollution by not enabling sitepackages. +sitepackages = False +# NOTE: Avoid false positives by not skipping missing interpreters. +skip_missing_interpreters = False [testenv] setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 + CHARM_DIR={envdir} AMULET_SETUP_TIMEOUT=5400 whitelist_externals = juju -passenv = HOME TERM AMULET_* CS_* +passenv = HOME TERM AMULET_* CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} [testenv:pep8] -basepython = python2.7 +basepython = python3 commands = charm-proof -[testenv:func27-noop] +[testenv:func-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] +[testenv:func] # 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] +[testenv:func-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-bionic-stein --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] +[testenv:func-dev] # Run all development test targets which are +x (may not always pass!) basepython = python2.7 commands = diff --git a/tox.ini b/tox.ini index 8cb53db..5b41c1d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,16 @@ # Source charm: ./tox.ini # This file is managed centrally by release-tools and should not be modified -# within individual charm repos. +# 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 + [tox] skipsdist = True -envlist = pep8,py37 -skip_missing_interpreters = True +envlist = pep8,py3 +# NOTE: Avoid build/test env pollution by not enabling sitepackages. +sitepackages = False +# NOTE: Avoid false positives by not skipping missing interpreters. +skip_missing_interpreters = False [testenv] setenv = VIRTUAL_ENV={envdir} @@ -13,39 +19,36 @@ setenv = VIRTUAL_ENV={envdir} LAYER_PATH={toxinidir}/layers INTERFACE_PATH={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build -passenv = http_proxy https_proxy +passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY install_command = pip install {opts} {packages} deps = -r{toxinidir}/requirements.txt [testenv:build] -basepython = python2.7 +basepython = python3 commands = charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} -[testenv:py27] -basepython = python2.7 -# Reactive source charms are Python3-only, but a py27 unit test target -# is required by OpenStack Governance. Remove this shim as soon as -# permitted. http://governance.openstack.org/reference/cti/python_cti.html -whitelist_externals = true -commands = true - -[testenv:py34] -basepython = python3.4 +[testenv:py3] +basepython = python3 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} + +[testenv:py35] +basepython = python3.5 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} [testenv:py36] basepython = python3.6 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} [testenv:py37] basepython = python3.7 deps = -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 @@ -56,13 +59,14 @@ commands = flake8 {posargs} src unit_tests # Technique based heavily upon # https://github.com/openstack/nova/blob/master/tox.ini basepython = python3 -deps = -r{toxinidir}/test-requirements.txt +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt setenv = {[testenv]setenv} PYTHON=coverage run commands = coverage erase - stestr run {posargs} + stestr run --slowest {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml @@ -85,4 +89,4 @@ commands = {posargs} [flake8] # E402 ignore necessary for path append before sys module import in actions -ignore = E402 +ignore = E402,W504