From 5fad56e89f4daeaeccfdcdb0210f23d94086e9e1 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 3 Jan 2014 22:43:37 +0000 Subject: Add integration tests with known consumers Run the tests of some consumers of cliff to ensure that changes being made do not break the apps or downsteam libraries. Change-Id: Ifded67608b49044cc6a0832389ad7fe825148a3c --- integration-tests/neutronclient-stable.sh | 22 ++++++++++++++++++++++ integration-tests/neutronclient-tip.sh | 14 ++++++++++++++ integration-tests/openstackclient-stable.sh | 22 ++++++++++++++++++++++ integration-tests/openstackclient-tip.sh | 14 ++++++++++++++ test-requirements.txt | 1 - tox.ini | 18 ++++++++++++++++++ 6 files changed, 90 insertions(+), 1 deletion(-) create mode 100755 integration-tests/neutronclient-stable.sh create mode 100755 integration-tests/neutronclient-tip.sh create mode 100755 integration-tests/openstackclient-stable.sh create mode 100755 integration-tests/openstackclient-tip.sh diff --git a/integration-tests/neutronclient-stable.sh b/integration-tests/neutronclient-stable.sh new file mode 100755 index 0000000..4e066db --- /dev/null +++ b/integration-tests/neutronclient-stable.sh @@ -0,0 +1,22 @@ +#!/bin/sh -x + +set -e + +envdir=$1 + +# Manually download the source from PyPI and build it with the --editable flag. +# This gives us access to run the tests. +pip install --pre --no-deps --no-install --no-clean python-neutronclient + +# This is where the source will end up after pip is done downloading and building it +srcdir=$envdir/build/python-neutronclient/ +cd $srcdir + +# Install the source safely +pip install --no-clean -ve . + +# Install the test requirements +pip install --no-clean -r $srcdir/test-requirements.txt + +# Run testr +python setup.py testr diff --git a/integration-tests/neutronclient-tip.sh b/integration-tests/neutronclient-tip.sh new file mode 100755 index 0000000..04eb899 --- /dev/null +++ b/integration-tests/neutronclient-tip.sh @@ -0,0 +1,14 @@ +#!/bin/sh -x + +set -e + +envdir=$1 + +# The source for the client library is checked out by pip because of +# the deps listed in tox.ini, so we just need to move into that +# directory. +cd $envdir/src/neutronclient/ + +pip install -r test-requirements.txt + +python setup.py testr diff --git a/integration-tests/openstackclient-stable.sh b/integration-tests/openstackclient-stable.sh new file mode 100755 index 0000000..e2e29cb --- /dev/null +++ b/integration-tests/openstackclient-stable.sh @@ -0,0 +1,22 @@ +#!/bin/sh -x + +set -e + +envdir=$1 + +# Manually download the source from PyPI and build it with the --editable flag. +# This gives us access to run the tests. +pip install --pre --no-deps --no-install --no-clean python-openstackclient + +# This is where the source will end up after pip is done downloading and building it +srcdir=$envdir/build/python-openstackclient/ +cd $srcdir + +# Install the source safely +pip install --no-clean -ve . + +# Install the test requirements +pip install --no-clean -r $srcdir/test-requirements.txt + +# Run testr +python setup.py testr diff --git a/integration-tests/openstackclient-tip.sh b/integration-tests/openstackclient-tip.sh new file mode 100755 index 0000000..b24ff31 --- /dev/null +++ b/integration-tests/openstackclient-tip.sh @@ -0,0 +1,14 @@ +#!/bin/sh -x + +set -e + +envdir=$1 + +# The source for the client library is checked out by pip because of +# the deps listed in tox.ini, so we just need to move into that +# directory. +cd $envdir/src/openstackclient/ + +pip install -r test-requirements.txt + +python setup.py testr diff --git a/test-requirements.txt b/test-requirements.txt index 5b46989..85c0039 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,5 +3,4 @@ mock coverage pep8 cmd2 -distribute PrettyTable diff --git a/tox.ini b/tox.ini index e78ee7d..a210ff2 100644 --- a/tox.ini +++ b/tox.ini @@ -18,3 +18,21 @@ basepython=python2.6 [testenv:venv] commands = {posargs} + +[testenv:neutronclient-stable] +basepython = python2.7 +commands = {toxinidir}/integration-tests/neutronclient-stable.sh {envdir} + +[testenv:neutronclient-tip] +basepython = python2.7 +deps = -egit+http://git.openstack.org/cgit/openstack/python-neutronclient#egg=neutronclient +commands = {toxinidir}/integration-tests/neutronclient-tip.sh {envdir} + +[testenv:openstackclient-stable] +basepython = python2.7 +commands = {toxinidir}/integration-tests/openstackclient-stable.sh {envdir} + +[testenv:openstackclient-tip] +basepython = python2.7 +deps = -egit+http://git.openstack.org/cgit/openstack/python-openstackclient#egg=openstackclient +commands = {toxinidir}/integration-tests/openstackclient-tip.sh {envdir} -- cgit v1.2.1