diff --git a/refstack_client/list_parser.py b/refstack_client/list_parser.py index 5106a2a..42905c9 100644 --- a/refstack_client/list_parser.py +++ b/refstack_client/list_parser.py @@ -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 diff --git a/refstack_client/refstack_client.py b/refstack_client/refstack_client.py index 0ebfcc0..9d87d13 100755 --- a/refstack_client/refstack_client.py +++ b/refstack_client/refstack_client.py @@ -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: diff --git a/refstack_client/tests/unit/test_list_parser.py b/refstack_client/tests/unit/test_list_parser.py index 8ba0a7a..b6b1739 100644 --- a/refstack_client/tests/unit/test_list_parser.py +++ b/refstack_client/tests/unit/test_list_parser.py @@ -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"""