Remove tethering between func and api tests and use venv for tempest

In this patch removed tethering between functional tests and api tests
which blocks test runs when tempest installation uses venv.
Also, in this patch implemented tempest venv using for main gate job,
which gave to main gate a beautiful stability against version conflicts.

Change-Id: I577399552341f4b8085637e5dab975ccdd28cd2b
Closes-Bug: #1476759
This commit is contained in:
Victor Ryzhenkin 2015-08-20 16:51:59 +03:00
parent 2213871717
commit 11f0aeeb5e
6 changed files with 55 additions and 29 deletions

View File

@ -2,4 +2,14 @@
source ./run_tests_common.sh
nosetests -sv ../murano/tests/functional/api/v1
# Using .venv for tempest installation
pushd $TEMPEST_DIR
python tools/install_venv.py
source .venv/bin/activate
pip install nose
nosetests -sv /opt/stack/new/murano/murano/tests/functional/api/v1
RETVAL=$?
deactivate
popd
exit $RETVAL

View File

@ -14,12 +14,3 @@ echo "Successfully contacted Murano API"
# Where tempest code lives
TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest}
# Add tempest source tree to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$TEMPEST_DIR
#installing requirements for tempest
pip install -r $TEMPEST_DIR/requirements.txt
#installing test requirements for murano
pip install -r ../test-requirements.txt

View File

@ -2,4 +2,13 @@
source ./run_tests_common.sh
nosetests -sv ../murano/tests/functional/integration/test_policy_enf.py ../murano/tests/functional/integration/test_mistral.py
# Add tempest source tree to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$TEMPEST_DIR
#installing requirements for tempest
pip install -r $TEMPEST_DIR/requirements.txt
#installing test requirements for murano
pip install -r ../test-requirements.txt
nosetests -sv ../murano/tests/functional/integration/test_policy_enf.py ../murano/tests/functional/integration/test_mistral.py

View File

@ -20,10 +20,10 @@ from tempest.test import attr
from tempest_lib import exceptions
from murano.tests.functional.api import base
from murano.tests.functional.common import utils as common_utils
import murano.tests.functional.common.zip_utils_mixin as zip_utils
class TestCaseRepository(base.TestCase, common_utils.ZipUtilsMixin):
class TestCaseRepository(base.TestCase, zip_utils.ZipUtilsMixin):
@classmethod
def setUpClass(cls):

View File

@ -19,7 +19,6 @@ import random
import socket
import telnetlib
import time
import zipfile
from heatclient import client as heatclient
from keystoneclient import exceptions as ks_exceptions
@ -30,6 +29,7 @@ from oslo_log import log as logging
import yaml
from murano.services import states
import murano.tests.functional.common.zip_utils_mixin as zip_utils
import murano.tests.functional.engine.config as cfg
CONF = cfg.cfg.CONF
@ -69,21 +69,7 @@ def memoize(f):
return decorated_function
class ZipUtilsMixin(object):
@staticmethod
def zip_dir(parent_dir, dir):
abs_path = os.path.join(parent_dir, dir)
path_len = len(abs_path) + 1
zip_file = abs_path + ".zip"
with zipfile.ZipFile(zip_file, "w") as zf:
for dir_name, _, files in os.walk(abs_path):
for filename in files:
fn = os.path.join(dir_name, filename)
zf.write(fn, fn[path_len:])
return zip_file
class DeployTestMixin(ZipUtilsMixin):
class DeployTestMixin(zip_utils.ZipUtilsMixin):
cfg.load_config()
# -----------------------------Clients methods---------------------------------

View File

@ -0,0 +1,30 @@
# Copyright (c) 2015 OpenStack Foundation
#
# 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.
import os
import zipfile
class ZipUtilsMixin(object):
@staticmethod
def zip_dir(parent_dir, dir):
abs_path = os.path.join(parent_dir, dir)
path_len = len(abs_path) + 1
zip_file = abs_path + ".zip"
with zipfile.ZipFile(zip_file, "w") as zf:
for dir_name, _, files in os.walk(abs_path):
for filename in files:
fn = os.path.join(dir_name, filename)
zf.write(fn, fn[path_len:])
return zip_file