Package: refstack-client / 0.0.0~2023.09.19.b60a7e41f7-2

do-not-use-venv-to-run-tests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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]",