Description: Do not use venv to run tests
Author: Thomas Goirand <zigo@debian.org>
Forwarded: not-needed
Last-Update: 2022-01-10

Index: refstack-client/refstack_client/list_parser.py
===================================================================
--- refstack-client.orig/refstack_client/list_parser.py
+++ refstack-client/refstack_client/list_parser.py
@@ -47,15 +47,12 @@ class TestListParser(object):
         mappings are then formed for these tests.
         """
         if os.path.exists(os.path.join(self.tempest_dir, '.stestr.conf')):
-            init_cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
-                        'stestr', 'init')
+            init_cmd = ['stestr', 'init']
             subprocess.Popen(init_cmd, stdout=subprocess.PIPE,
                              cwd=self.tempest_dir)
-            cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
-                   'stestr', 'list')
+            cmd = ['stestr', 'list']
         else:
-            cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
-                   'testr', 'list-tests')
+            cmd = ['testr', 'list-tests']
         process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                    cwd=self.tempest_dir)
         (stdout, stderr) = process.communicate()
Index: refstack-client/refstack_client/refstack_client.py
===================================================================
--- refstack-client.orig/refstack_client/refstack_client.py
+++ refstack-client/refstack_client/refstack_client.py
@@ -502,8 +502,7 @@ class RefstackClient:
         # 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')
-        cmd = [wrapper, 'tempest', 'run']
+        cmd = ['tempest', 'run']
         if not self.args.parallel:
             cmd.append('--serial')
         # If a test list was specified, have it take precedence.
Index: refstack-client/refstack_client/tests/unit/test_client.py
===================================================================
--- refstack-client.orig/refstack_client/tests/unit/test_client.py
+++ refstack-client/refstack_client/tests/unit/test_client.py
@@ -565,7 +565,7 @@ class TestRefstackClient(unittest.TestCa
         client.test()
 
         mock_popen.assert_called_with(
-            ['%s/tools/with_venv.sh' % self.test_path, 'tempest', 'run',
+            ['tempest', 'run',
              '--serial', '--regex', 'tempest.api.compute'],
             stderr=None
         )
@@ -596,7 +596,7 @@ class TestRefstackClient(unittest.TestCa
         client._get_cpid_from_keystone = MagicMock()
         client.test()
         mock_popen.assert_called_with(
-            ['%s/tools/with_venv.sh' % self.test_path, 'tempest', 'run',
+            ['tempest', 'run',
              '--serial', '--regex', 'tempest.api.compute'],
             stderr=None
         )
@@ -629,7 +629,7 @@ class TestRefstackClient(unittest.TestCa
             return_value='test-id')
         client.test()
         mock_popen.assert_called_with(
-            ['%s/tools/with_venv.sh' % self.test_path, 'tempest', 'run',
+            ['tempest', 'run',
              '--serial', '--regex', 'tempest.api.compute'],
             stderr=None
         )
@@ -675,7 +675,7 @@ class TestRefstackClient(unittest.TestCa
         # uses tempest which contains the following change in its code:
         # https://review.opendev.org/c/openstack/tempest/+/768583
         mock_popen.assert_called_with(
-            ['%s/tools/with_venv.sh' % self.test_path, 'tempest', 'run',
+            ['tempest', 'run',
              '--serial', '--whitelist_file', '/tmp/some-list'],
             stderr=None
         )
@@ -735,7 +735,7 @@ class TestRefstackClient(unittest.TestCa
         client.test()
 
         mock_popen.assert_called_with(
-            ['%s/tools/with_venv.sh' % self.test_path, 'tempest', 'run',
+            ['tempest', 'run',
              '--serial', '--regex', 'tempest.api.compute'],
             stderr=None
         )
Index: refstack-client/refstack_client/tests/unit/test_list_parser.py
===================================================================
--- refstack-client.orig/refstack_client/tests/unit/test_list_parser.py
+++ refstack-client/refstack_client/tests/unit/test_list_parser.py
@@ -50,8 +50,7 @@ class TestTestListParser(unittest.TestCa
         output = self.parser._get_tempest_test_ids()
 
         subprocess.Popen.assert_called_with(
-            ("%s/tools/with_venv.sh" % self.tempest_dir, "testr",
-             "list-tests"),
+            ("testr", "list-tests"),
             stdout=subprocess.PIPE,
             cwd=self.tempest_dir)
         expected_output = {"tempest.test.one": "[gate]",
