From e22d3607d6c9ac993746e594e18cd5d56f66cd65 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Fri, 31 May 2013 19:04:00 -0700 Subject: [PATCH] Add integration test option to tox Take current version of hacking and run it on any review.openstack.org repository. By default nova is used tox -eintegration but you can pass in any project as an argument. For example: tox -eintegration -- openstack keystone This deletes the project repo after the test. Partially fixes bug 1186421 Change-Id: I796b7c734459042b1a929afb73434cba62477365 --- integration-test/test.sh | 20 ++++++++++++++++++++ tox.ini | 4 ++++ 2 files changed, 24 insertions(+) create mode 100755 integration-test/test.sh diff --git a/integration-test/test.sh b/integration-test/test.sh new file mode 100755 index 00000000..2dd8963f --- /dev/null +++ b/integration-test/test.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Usage: test.sh openstack keystone +# Note: you can clone from a local file with REPO_ROOT=file:////~/path/to/repo +set -x +set -e +REPO_ROOT=${REPO_ROOT:-https://review.openstack.org/p} +if [[ -z "$2" ]]; then + org=openstack + project=nova +else + org=$1 + project=$2 +fi +git clone $REPO_ROOT/$org/$project --depth=1 +cd $project +set +e +flake8 +cd .. +rm -rf $project diff --git a/tox.ini b/tox.ini index 70409f8f..780af3ca 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,10 @@ downloadcache = ~/cache/pip [testenv:pep8] commands = flake8 +[testenv:integration] +commands = + bash integration-test/test.sh {posargs} + [testenv:cover] setenv = VIRTUAL_ENV={envdir} commands =