From: AdrianF <adrian.freihofer@siemens.com>
To: openembedded-core@lists.openembedded.org
Cc: Adrian Freihofer <adrian.freihofer@siemens.com>
Subject: [PATCH v2 22/25] oe-selftest: devtool ide-sdk: test install task
Date: Sun, 30 Aug 2026 23:48:44 +0200 [thread overview]
Message-ID: <20260830214912.1346063-23-adrian.freihofer@siemens.com> (raw)
In-Reply-To: <20260830214912.1346063-1-adrian.freihofer@siemens.com>
From: Adrian Freihofer <adrian.freihofer@siemens.com>
Verify that the ide-sdk setup generates the do_install task script and that
the script runs successfully. This covers the prepared-task runner used by
the IDE deployment workflow without requiring Qemu.
Replace the ad-hoc dependsOn handling in _verify_launch_config() with a
new helper that mirrors VS Code's task dependency resolution and
execution order. This ensures that the selftest runs the same sequence
of tasks as VS Code would, including compile and install/deploy
prerequisites, before starting the debug server. This also aligns the
gdb and lldb selftest paths to avoid behavior drift and improve test
reliability.
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
meta/lib/oeqa/selftest/cases/devtool.py | 86 ++++++++++++++++++++-----
1 file changed, 70 insertions(+), 16 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 35f2aa2e6c..c05cf7bc82 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -3116,7 +3116,7 @@ class DevtoolIdeSdkTests(DevtoolBase):
"""Verify the scripts referred by the tasks.json file are fine.
This function does not depend on Qemu. Therefore it verifies the scripts
- exists and the delete step works as expected. But it does not try to
+ exists and the install step works as expected. But it does not try to
deploy to Qemu.
"""
recipe_id, recipe_id_pretty = self._get_recipe_ids(recipe_name)
@@ -3134,6 +3134,11 @@ class DevtoolIdeSdkTests(DevtoolBase):
i_and_d_script_path = os.path.join(
self._workspace_scripts_dir(recipe_name), i_and_d_script)
self.assertExists(i_and_d_script_path)
+ install_script = 'bb_run_do_install_' + recipe_id
+ install_script_path = os.path.join(
+ self._workspace_scripts_dir(recipe_name), install_script)
+ self.assertExists(install_script_path)
+ runCmd(install_script_path, cwd=tempdir, output_log=self._cmd_logger)
deploy_script_path = os.path.join(
self._workspace_scripts_dir(recipe_name), 'deploy_target_' + recipe_id)
@@ -3368,6 +3373,60 @@ class DevtoolIdeSdkTests(DevtoolBase):
self.assertEqual(actual_group, group,
msg="%s not owned by group %s: got %s" % (conf_file, group, actual_group))
+ def _run_vscode_task_with_dependencies(self, tempdir, task_label, run_main_task=True):
+ """Run a VS Code shell task and its dependsOn chain.
+
+ The helper mirrors VS Code task dependency ordering for selftests, so
+ preLaunchTask prerequisites (e.g. compile and do_install/deploy tasks)
+ run before the debug server task.
+ """
+ tasks_path = os.path.join(tempdir, '.vscode', 'tasks.json')
+ self.assertExists(tasks_path, 'tasks.json not found at %s' % tasks_path)
+
+ with open(tasks_path) as tasks_j:
+ tasks_d = json.load(tasks_j)
+
+ task_by_label = {
+ task.get('label'): task
+ for task in tasks_d.get('tasks', [])
+ if task.get('label')
+ }
+ self.assertIn(task_label, task_by_label,
+ "Task '%s' not found in tasks.json" % task_label)
+
+ ran = set()
+
+ def run_task(label, execute_task):
+ if label in ran:
+ return
+
+ task = task_by_label[label]
+ deps = task.get('dependsOn', [])
+ if isinstance(deps, str):
+ deps = [deps]
+
+ for dep in deps:
+ self.assertIn(dep, task_by_label,
+ "DependsOn task '%s' not found in tasks.json" % dep)
+ run_task(dep, True)
+
+ if execute_task:
+ command = task.get('command')
+ if command:
+ args = task.get('args', [])
+ if not isinstance(args, list):
+ args = [args]
+ task_cmd = [command] + [str(arg) for arg in args]
+
+ task_cwd = task.get('options', {}).get('cwd', tempdir)
+ if isinstance(task_cwd, str):
+ task_cwd = task_cwd.replace('${workspaceFolder}', tempdir)
+ runCmd(task_cmd, cwd=task_cwd, output_log=self._cmd_logger)
+
+ ran.add(label)
+
+ run_task(task_label, run_main_task)
+
class DevtoolIdeSdkGccTests(DevtoolIdeSdkTests):
@@ -3853,21 +3912,10 @@ class DevtoolIdeSdkGccTests(DevtoolIdeSdkTests):
(task for task in tasks if task["label"] == prelaunch_task_name), None)
self.assertIsNotNone(prelaunch_task, f"PreLaunchTask '{prelaunch_task_name}' not found in tasks.json")
- # Find the dependsOn task if exists (install and deploy-target)
- if "dependsOn" in prelaunch_task:
- depends_task_names = prelaunch_task["dependsOn"]
- for depends_task_name in depends_task_names:
- depends_task = next(
- (task for task in tasks if task["label"] == depends_task_name), None)
- self.assertIsNotNone(depends_task, f"DependsOn task '{depends_task_name}' not found in tasks.json")
- # For simplicity, we assume the dependsOn task is a prerequisite and does not affect the main command
- self.logger.debug(f"PreLaunchTask '{prelaunch_task_name}' depends on '{depends_task_name}'")
-
- # Extract command details from dependsOn task
- depends_task_command = depends_task["command"]
- depends_task_args = depends_task.get("args", [])
- self.logger.debug(f"Would execute dependsOn task: {depends_task_command} {' '.join(depends_task_args)}")
- runCmd(f"{depends_task_command} {' '.join(depends_task_args)}", output_log=self._cmd_logger)
+ # Execute preLaunchTask prerequisites exactly like VS Code dependsOn
+ # handling, but keep starting the debug server in this method.
+ self._run_vscode_task_with_dependencies(
+ tempdir, prelaunch_task_name, run_main_task=False)
# Verify task structure and extract command details
self.assertEqual(prelaunch_task["type"], "shell", f"Task '{prelaunch_task_name}' should be shell type")
@@ -4635,6 +4683,12 @@ class DevtoolIdeSdkClangTests(DevtoolIdeSdkTests):
self.assertIsNotNone(prelaunch_task,
"preLaunchTask '%s' not found in tasks.json" % prelaunch_task_name)
+ # Run compile/install/deploy prerequisites exactly as VS Code would,
+ # but keep starting the debug server itself in this method so we can
+ # retain explicit readiness handling and diagnostics.
+ self._run_vscode_task_with_dependencies(
+ tempdir, prelaunch_task_name, run_main_task=False)
+
# Extract the SSH command and start lldb-server on the target
task_command = prelaunch_task["command"]
task_args = prelaunch_task["args"]
--
2.55.0
next prev parent reply other threads:[~2026-08-30 21:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 21:48 [PATCH v2 00/25] devtool: ide-sdk: NFS/slirp support, deploy filtering, and robustness fixes AdrianF
2026-08-30 21:48 ` [PATCH v2 01/25] runqemu-extract-sdk: set PSEUDO_INCLUDE_PATHS for the extraction AdrianF
2026-08-30 21:48 ` [PATCH v2 02/25] devtool: ide-sdk: dedupe solib_search_path entries AdrianF
2026-09-03 11:18 ` [OE-core] " Richard Purdie
2026-09-03 16:06 ` Freihofer, Adrian
2026-09-03 20:21 ` Richard Purdie
2026-08-30 21:48 ` [PATCH v2 03/25] devtool: ide-sdk: VSCode IntelliSense for rootfs-dbg sources AdrianF
2026-08-30 21:48 ` [PATCH v2 04/25] cpp-example: fix stuck breakpoints when attaching and daemonize properly AdrianF
2026-08-30 21:48 ` [PATCH v2 05/25] devtool: ide-sdk: auto-write image debug settings to bbappend AdrianF
2026-08-30 21:48 ` [PATCH v2 06/25] oe-selftest: devtool ide-sdk: adapt tests for auto-written image debug settings AdrianF
2026-08-30 21:48 ` [PATCH v2 07/25] oeqa: QemuTarget: set use_slirp when slirp is in runqemuparams AdrianF
2026-08-30 21:48 ` [PATCH v2 08/25] devtool: ide-sdk: support runqemu slirp AdrianF
2026-08-30 21:48 ` [PATCH v2 09/25] devtool: ide-sdk: auto-disable ssh host key checking for loopback targets AdrianF
2026-08-30 21:48 ` [PATCH v2 10/25] oe-selftest: devtool ide-sdk: add slirp networking test AdrianF
2026-08-30 21:48 ` [PATCH v2 11/25] devtool: deploy-target: add --package/--file-glob filters AdrianF
2026-08-30 22:11 ` Patchtest results for " patchtest
2026-08-30 21:48 ` [PATCH v2 12/25] oe-selftest: devtool deploy-target: test " AdrianF
2026-08-30 21:48 ` [PATCH v2 13/25] devtool: ide-sdk: forward --package/--file-glob deploy filters AdrianF
2026-08-30 21:48 ` [PATCH v2 14/25] oe-selftest: devtool ide-sdk: cover --package filters AdrianF
2026-08-30 21:48 ` [PATCH v2 15/25] runqemu-extract-sdk: refactor in Python AdrianF
2026-09-03 11:36 ` [OE-core] " Richard Purdie
2026-08-30 21:48 ` [PATCH v2 16/25] runqemu-export-rootfs: " AdrianF
2026-08-30 21:48 ` [PATCH v2 17/25] devtool: deploy: split ssh deployment into a separate function AdrianF
2026-08-30 21:48 ` [PATCH v2 18/25] devtool: deploy-target: allow deploying directly into a local rootfs AdrianF
2026-08-30 21:48 ` [PATCH v2 19/25] oe-selftest: devtool deploy-target: test deploying into a local rootfs path AdrianF
2026-08-30 21:48 ` [PATCH v2 20/25] oe-selftest: tinfoil: test prepared task runner AdrianF
2026-08-30 21:48 ` [PATCH v2 21/25] devtool: ide-sdk: run do_install through BitBake AdrianF
2026-08-30 21:48 ` AdrianF [this message]
2026-08-30 21:48 ` [PATCH v2 23/25] devtool: ide-sdk: support NFS rootfs AdrianF
2026-08-30 21:48 ` [PATCH v2 24/25] oe-selftest: devtool ide-sdk: test NFS debug rootfs AdrianF
2026-08-30 21:48 ` [PATCH v2 25/25] devtool: ide-sdk: fix GDB loading stale libs instead of recipe's own build AdrianF
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260830214912.1346063-23-adrian.freihofer@siemens.com \
--to=adrian.freihofer@siemens.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox