From cf2d3500271469fcec692c2c96ad358e22c831c9 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 18 Jan 2017 16:39:28 -0600 Subject: [PATCH] Add helper script to install branch tips shade has a functional test that intends to test shade against the current tip of client libs. Unfortunately, what it's really doing is installing latest release of the library into the shade virtualenv that's used for functional testing and using tip of library for the OpenStack install. This is not a combo we care about. Instead, install the library tips into the virtualenv. To do this, make a functional-tips venv for tox, and make the post_test_hook optionally use it. Change-Id: Ibac2982e88439362c7af933c3a07c4d581ee6f2b --- extras/install-tips.sh | 34 +++++++++++++++++++ .../tests/functional/hooks/post_test_hook.sh | 7 +++- tox.ini | 9 +++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 extras/install-tips.sh diff --git a/extras/install-tips.sh b/extras/install-tips.sh new file mode 100644 index 000000000..b450e9124 --- /dev/null +++ b/extras/install-tips.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright (c) 2017 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +for lib in \ + os-client-config \ + keystoneauth \ + python-novaclient \ + python-keystoneclient \ + python-cinderclient \ + python-neutronclient \ + python-troveclient \ + python-ironicclient \ + python-heatclient \ + python-designateclient \ + python-magnumclient +do + egg=$(echo $lib | tr '-' '_' | sed 's/python-//') + if [ -d /opt/stack/new/$lib ] ; then + pip install -q -U -e "git+file:///opt/stack/new/$lib#egg=$egg" + fi +done diff --git a/shade/tests/functional/hooks/post_test_hook.sh b/shade/tests/functional/hooks/post_test_hook.sh index 41bdd6f21..22ae99ec4 100755 --- a/shade/tests/functional/hooks/post_test_hook.sh +++ b/shade/tests/functional/hooks/post_test_hook.sh @@ -36,9 +36,14 @@ then sudo sed -ie '/^.*domain_id.*$/d' $CLOUDS_YAML fi +if [ "x$1" = "xtips" ] ; then + tox_env=functional-tips +else + tox_env=functional +fi echo "Running shade functional test suite" set +e -sudo -E -H -u jenkins tox -efunctional +sudo -E -H -u jenkins tox -e$tox_env EXIT_CODE=$? sudo testr last --subunit > $WORKSPACE/tempest.subunit set -e diff --git a/tox.ini b/tox.ini index d10bd9f8e..94b0bec65 100644 --- a/tox.ini +++ b/tox.ini @@ -35,6 +35,15 @@ setenv = passenv = OS_* SHADE_* commands = python setup.py testr --slowest --testr-args='--concurrency=1 {posargs}' +[testenv:functional-tips] +setenv = + OS_TEST_PATH = ./shade/tests/functional +passenv = OS_* SHADE_* +whitelist_externals = bash +commands = + bash extras/install-tips.sh + python setup.py testr --slowest --testr-args='--concurrency=1 {posargs}' + [testenv:pep8] commands = flake8 shade