diff --git a/Makefile b/Makefile index c6109cc..f63dfd0 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,7 @@ test: functional_test: @echo Starting Amulet tests... - @tests/setup/00-setup - @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 + @tox -e func27 bin/charm_helpers_sync.py: @mkdir -p bin @@ -21,7 +20,3 @@ bin/charm_helpers_sync.py: sync: bin/charm_helpers_sync.py $(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml $(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml - -publish: lint - bzr push lp:charms/ceph-osd - bzr push lp:charms/trusty/ceph-osd diff --git a/lib/.keep b/lib/.keep new file mode 100644 index 0000000..f49b91a --- /dev/null +++ b/lib/.keep @@ -0,0 +1,3 @@ + This file was created by release-tools to ensure that this empty + directory is preserved in vcs re: lint check definitions in global + tox.ini files. This file can be removed if/when this dir is actually in use. diff --git a/test-requirements.txt b/test-requirements.txt index 4faf254..74baa12 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,3 +7,19 @@ flake8>=2.2.4,<=2.4.1 os-testr>=0.4.1 charm-tools>=2.0.0 requests==2.6.0 +# BEGIN: Amulet OpenStack Charm Helper Requirements +# Liberty client lower constraints +amulet>=1.14.3,<2.0 +bundletester>=0.6.1,<1.0 +python-ceilometerclient>=1.5.0,<2.0 +python-cinderclient>=1.4.0,<2.0 +python-glanceclient>=1.1.0,<2.0 +python-heatclient>=0.8.0,<1.0 +python-keystoneclient>=1.7.1,<2.0 +python-neutronclient>=3.1.0,<4.0 +python-novaclient>=2.30.1,<3.0 +python-openstackclient>=1.7.0,<2.0 +python-swiftclient>=2.6.0,<3.0 +pika>=0.10.0,<1.0 +distro-info +# END: Amulet OpenStack Charm Helper Requirements diff --git a/tests/.gitkeep b/tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/014-basic-precise-icehouse b/tests/gate-basic-precise-icehouse similarity index 100% rename from tests/014-basic-precise-icehouse rename to tests/gate-basic-precise-icehouse diff --git a/tests/015-basic-trusty-icehouse b/tests/gate-basic-trusty-icehouse similarity index 100% rename from tests/015-basic-trusty-icehouse rename to tests/gate-basic-trusty-icehouse diff --git a/tests/016-basic-trusty-juno b/tests/gate-basic-trusty-juno similarity index 100% rename from tests/016-basic-trusty-juno rename to tests/gate-basic-trusty-juno diff --git a/tests/017-basic-trusty-kilo b/tests/gate-basic-trusty-kilo similarity index 100% rename from tests/017-basic-trusty-kilo rename to tests/gate-basic-trusty-kilo diff --git a/tests/018-basic-trusty-liberty b/tests/gate-basic-trusty-liberty similarity index 100% rename from tests/018-basic-trusty-liberty rename to tests/gate-basic-trusty-liberty diff --git a/tests/019-basic-trusty-mitaka b/tests/gate-basic-trusty-mitaka similarity index 100% rename from tests/019-basic-trusty-mitaka rename to tests/gate-basic-trusty-mitaka diff --git a/tests/020-basic-wily-liberty b/tests/gate-basic-wily-liberty similarity index 100% rename from tests/020-basic-wily-liberty rename to tests/gate-basic-wily-liberty diff --git a/tests/021-basic-xenial-mitaka b/tests/gate-basic-xenial-mitaka similarity index 100% rename from tests/021-basic-xenial-mitaka rename to tests/gate-basic-xenial-mitaka diff --git a/tests/setup/00-setup b/tests/setup/00-setup deleted file mode 100755 index 94e5611..0000000 --- a/tests/setup/00-setup +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -ex - -sudo add-apt-repository --yes ppa:juju/stable -sudo apt-get update --yes -sudo apt-get install --yes amulet \ - distro-info-data \ - python-cinderclient \ - python-distro-info \ - python-glanceclient \ - python-heatclient \ - python-keystoneclient \ - python-neutronclient \ - python-novaclient \ - python-pika \ - python-swiftclient diff --git a/tests/tests.yaml b/tests/tests.yaml index 49e721b..e3185c6 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,22 +1,17 @@ -bootstrap: true -reset: false -virtualenv: true -makefile: - - lint - - test -sources: - - ppa:juju/stable -packages: - - amulet - - distro-info-data - - python-ceilometerclient - - python-cinderclient - - python-distro-info - - python-glanceclient - - python-heatclient - - python-keystoneclient - - python-neutronclient - - python-novaclient - - python-pika - - python-swiftclient - - python-nose \ No newline at end of file +# Bootstrap the model if necessary. +bootstrap: True +# Re-use bootstrap node instead of destroying/re-bootstrapping. +reset: True +# Use tox/requirements to drive the venv instead of bundletester's venv feature. +virtualenv: False +# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet. +makefile: [] +# Do not specify juju PPA sources. Juju is presumed to be pre-installed +# and configured in all test runner environments. +#sources: +# Do not specify or rely on system packages. +#packages: +# Do not specify python packages here. Use test-requirements.txt +# and tox instead. ie. The venv is constructed before bundletester +# is invoked. +#python-packages: diff --git a/tox.ini b/tox.ini index 9c02ada..d8d8d03 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,6 @@ +# Classic charm: ./tox.ini +# This file is managed centrally by release-tools and should not be modified +# within individual charm repos. [tox] envlist = pep8,py27 skipsdist = True @@ -5,10 +8,13 @@ skipsdist = True [testenv] setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 + CHARM_DIR={envdir} + AMULET_SETUP_TIMEOUT=2700 install_command = pip install --allow-unverified python-apt {opts} {packages} commands = ostestr {posargs} -sitepackages = False +whitelist_externals = juju +passenv = HOME TERM AMULET_* [testenv:py27] basepython = python2.7 @@ -19,12 +25,56 @@ deps = -r{toxinidir}/requirements.txt basepython = python2.7 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = flake8 {posargs} actions hooks unit_tests tests +commands = flake8 {posargs} hooks unit_tests tests actions lib charm-proof [testenv:venv] commands = {posargs} +[testenv:func27-noop] +# DRY RUN - For Debug +basepython = python2.7 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +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 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +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 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +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 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +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 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = + bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy + [flake8] ignore = E402,E226 -exclude = hooks/charmhelpers +exclude = */charmhelpers