Remove usage of tempest install_venv scripts
install_venv script was removed from tempest back in Jan, 2016 Further details see Ib7dd6b34533880e48b367732ae3520026a92500e This patch removes script references since virtualenv management is handled during refstack installation. Change-Id: I9c6a9a84792c5f4afd38d53f8a5cb86ecfa344a3
This commit is contained in:
parent
fa7d06a6e9
commit
a13a5a4375
@ -165,34 +165,6 @@ class TestListParser(object):
|
||||
if os.path.isfile(file_path):
|
||||
os.remove(file_path)
|
||||
|
||||
def setup_venv(self, log_level):
|
||||
"""If for some reason the virtualenv for Tempest has not been
|
||||
set up, then install it. This is to ensure that 'testr list-tests'
|
||||
works.
|
||||
|
||||
:param log_level: integer denoting the log level (e.g. logging.DEBUG)
|
||||
"""
|
||||
if not os.path.isdir(os.path.join(self.tempest_dir, ".venv")):
|
||||
self.logger.info("Installing Tempest virtualenv. This may take "
|
||||
"a while.")
|
||||
cmd = ('python',
|
||||
os.path.join(self.tempest_dir, "tools/install_venv.py"))
|
||||
|
||||
# Only show installation messages if the logging level is DEBUG.
|
||||
if log_level <= logging.DEBUG:
|
||||
stdout = None
|
||||
else:
|
||||
stdout = open(os.devnull, 'w')
|
||||
|
||||
process = subprocess.Popen(cmd, cwd=self.tempest_dir,
|
||||
stdout=stdout)
|
||||
process.communicate()
|
||||
|
||||
if process.returncode != 0:
|
||||
self.logger.error("Error installing Tempest virtualenv.")
|
||||
raise subprocess.CalledProcessError(process.returncode,
|
||||
' '.join(cmd))
|
||||
|
||||
def get_normalized_test_list(self, list_location):
|
||||
"""This will take in the user's test list and will normalize it
|
||||
so that the test cases in the list map to actual full test IDS in
|
||||
|
@ -421,7 +421,7 @@ class RefstackClient:
|
||||
self.logger.info("Starting Tempest test...")
|
||||
start_time = time.time()
|
||||
|
||||
# Run the tempest run command, conf file specified at _prep_test method
|
||||
# Run tempest run command, conf file specified at _prep_test method
|
||||
# Use virtual environment (wrapper script)
|
||||
# Run the tests serially if parallel not enabled (--serial).
|
||||
wrapper = os.path.join(self.tempest_dir, 'tools', 'with_venv.sh')
|
||||
@ -433,7 +433,6 @@ class RefstackClient:
|
||||
self.logger.info("Normalizing test list...")
|
||||
parser = TestListParser(os.path.abspath(self.tempest_dir),
|
||||
insecure=self.args.insecure)
|
||||
parser.setup_venv(self.logger.getEffectiveLevel())
|
||||
# get whitelist
|
||||
list_file = parser.create_whitelist(self.args.test_list)
|
||||
if list_file:
|
||||
|
@ -170,23 +170,6 @@ class TestTestListParser(unittest.TestCase):
|
||||
|
||||
self.assertEqual(test_ids, testcase_list)
|
||||
|
||||
def test_setup_venv(self):
|
||||
"""Test whether the proper script is called to setup a virtualenv."""
|
||||
process_mock = mock.Mock(returncode=0)
|
||||
subprocess.Popen = mock.Mock(return_value=process_mock)
|
||||
self.parser.setup_venv(logging.DEBUG)
|
||||
subprocess.Popen.assert_called_with(
|
||||
("python", "%s/tools/install_venv.py" % self.tempest_dir),
|
||||
cwd=self.tempest_dir,
|
||||
stdout=None)
|
||||
|
||||
def test_setup_venv_fail(self):
|
||||
"""Test whether the proper script is called to setup a virtualenv."""
|
||||
process_mock = mock.Mock(returncode=1)
|
||||
subprocess.Popen = mock.Mock(return_value=process_mock)
|
||||
with self.assertRaises(subprocess.CalledProcessError):
|
||||
self.parser.setup_venv(logging.DEBUG)
|
||||
|
||||
@mock.patch.object(parser.TestListParser, "get_normalized_test_list")
|
||||
def test_create_whitelist(self, mock_get_normalized):
|
||||
"""Test whether a test list is properly parsed to extract test names"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user