[PATCH] tests/functional: preserve PYTHONPATH entries

Alyssa Ross posted 1 patch 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260323084739.1013748-1-hi@alyssa.is
Maintainers: Thomas Huth <th.huth+qemu@posteo.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>
tests/functional/meson.build | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
[PATCH] tests/functional: preserve PYTHONPATH entries
Posted by Alyssa Ross 1 week, 4 days ago
Otherwise, it's not possible to use a packaged qemu.qmp.

Fixes: 1497377857 ("tests/functional: Prepare the meson build system for the functional tests")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 tests/functional/meson.build | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 9bec5a0751..8c4d7f70e1 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -76,8 +76,10 @@ foreach speed : ['quick', 'thorough']
     endif
     test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
     test_env.set('QEMU_BUILD_ROOT', meson.project_build_root())
-    test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                               meson.current_source_dir())
+    test_env.prepend('PYTHONPATH',
+                     meson.project_source_root() / 'python',
+                     meson.current_source_dir(),
+                     separator : ':')
 
     # Define the GDB environment variable if gdb is available.
     gdb = get_option('gdb')
@@ -96,8 +98,10 @@ foreach speed : ['quick', 'thorough']
       teststamp = testname + '.tstamp'
       test_precache_env = environment()
       test_precache_env.set('QEMU_TEST_PRECACHE', meson.current_build_dir() / teststamp)
-      test_precache_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
-                                          meson.current_source_dir())
+      test_precache_env.prepend('PYTHONPATH',
+                                meson.project_source_root() / 'python',
+                                meson.current_source_dir(),
+                                separator : ':')
       precache = custom_target('func-precache-' + testname,
                                output: teststamp,
                                command: [python, testpath],

base-commit: 8e711856d7639cbffa51405f2cc2366e3d9e3a23
-- 
2.53.0
Re: [PATCH] tests/functional: preserve PYTHONPATH entries
Posted by Philippe Mathieu-Daudé 1 week, 4 days ago
On 23/3/26 09:47, Alyssa Ross wrote:
> Otherwise, it's not possible to use a packaged qemu.qmp.
> 
> Fixes: 1497377857 ("tests/functional: Prepare the meson build system for the functional tests")
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
>   tests/functional/meson.build | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Re: [PATCH] tests/functional: preserve PYTHONPATH entries
Posted by Thomas Huth 1 week, 4 days ago
On 23/03/2026 09.47, Alyssa Ross wrote:
> Otherwise, it's not possible to use a packaged qemu.qmp.
> 
> Fixes: 1497377857 ("tests/functional: Prepare the meson build system for the functional tests")
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
>   tests/functional/meson.build | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 9bec5a0751..8c4d7f70e1 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -76,8 +76,10 @@ foreach speed : ['quick', 'thorough']
>       endif
>       test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path())
>       test_env.set('QEMU_BUILD_ROOT', meson.project_build_root())
> -    test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
> -                               meson.current_source_dir())
> +    test_env.prepend('PYTHONPATH',
> +                     meson.project_source_root() / 'python',
> +                     meson.current_source_dir(),
> +                     separator : ':')
>   
>       # Define the GDB environment variable if gdb is available.
>       gdb = get_option('gdb')
> @@ -96,8 +98,10 @@ foreach speed : ['quick', 'thorough']
>         teststamp = testname + '.tstamp'
>         test_precache_env = environment()
>         test_precache_env.set('QEMU_TEST_PRECACHE', meson.current_build_dir() / teststamp)
> -      test_precache_env.set('PYTHONPATH', meson.project_source_root() / 'python:' +
> -                                          meson.current_source_dir())
> +      test_precache_env.prepend('PYTHONPATH',
> +                                meson.project_source_root() / 'python',
> +                                meson.current_source_dir(),
> +                                separator : ':')
>         precache = custom_target('func-precache-' + testname,
>                                  output: teststamp,
>                                  command: [python, testpath],
> 
> base-commit: 8e711856d7639cbffa51405f2cc2366e3d9e3a23

Reviewed-by: Thomas Huth <thuth@redhat.com>
Re: [PATCH] tests/functional: preserve PYTHONPATH entries
Posted by Paolo Bonzini 1 week, 4 days ago
Queued, thanks.

Paolo