diff mbox series

[blacksail,56/60] oe-selftest: devtool: do not add ide-sdk test kits to the user's CMake kits

Message ID 07d8a26686a90d1ff0c365d70b74d0c7c303af16.1793867929.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [blacksail,01/60] gstreamer1.0-plugins-bad: use gtk+3 dependency name | expand

Commit Message

Yoann Congal Nov. 5, 2026, 8:43 a.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

The shared sysroot test of devtool ide-sdk adds a cmake-kit with the path
of the temporary test build directory to ~/.local/share/CMakeTools. Every
test run adds another stale kit, which is never removed again. Use a
temporary XDG_DATA_HOME for the test, and verify that the kit is added
there.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fa83da7da277a641c3a997d3da26041fa46d48ab)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/lib/oeqa/selftest/cases/devtool.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index dbe039f8e6e..436eccafb93 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -4556,9 +4556,14 @@  class DevtoolIdeSdkSharedTests(DevtoolIdeSdkTests):
         # Handle the workspace (which is not needed by this test case)
         self._check_workspace()
 
+        # Do not add a cmake-kit to the kits of the user
+        xdg_data_home = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(xdg_data_home)
+        ide_env = dict(os.environ, XDG_DATA_HOME=xdg_data_home)
+
         result_init = runCmd(
             'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code',
-            output_log=self._cmd_logger)
+            output_log=self._cmd_logger, env=ide_env)
         bb_vars = get_bb_vars(
             ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support")
         environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS']
@@ -4570,6 +4575,11 @@  class DevtoolIdeSdkSharedTests(DevtoolIdeSdkTests):
         # Verify the cross environment script is available
         self.assertExists(environment_script_path)
 
+        # Verify the cmake-kit is added to the location where CMake Tools looks for it
+        with open(os.path.join(xdg_data_home, 'CMakeTools', 'cmake-tools-kits.json')) as f:
+            kits = json.load(f)
+        self.assertEqual([kit['environmentSetupScript'] for kit in kits], [environment_script_path])
+
         def runCmdEnv(cmd, cwd, output_log=self._cmd_logger):
             cmd = '/bin/sh -c ". %s > /dev/null && %s"' % (
                 environment_script_path, cmd)