---
id: TASK-7.2
title: Add tests for run binary execution and fallback
status: Done
assignee:
  - codex
created_date: '2026-02-03 16:23'
updated_date: '2026-02-03 16:31'
labels: []
dependencies: []
parent_task_id: TASK-7
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Extend manager specs to cover zephyr binary discovery path, argument passing to the binary, and fallback to `ninja run` without extra args when the binary is missing.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover direct execution of `zephyr.exe` with appended extra args.
- [x] #2 Tests cover fallback to `ninja run` when the binary is missing, with no extra args appended.
- [x] #3 Tests cover sysbuild image selection interaction with the binary path.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1. Add manager_spec case that creates zephyr/zephyr.exe under the active build/image dir and asserts Manager.run executes it with extra args appended.
2. Add a fallback case where the binary is missing and assert Manager.run executes `ninja run` without extra args.
3. Add a sysbuild image selection case to verify the binary path is resolved under the selected image directory.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Updated manager_spec with zephyr binary execution and fallback tests; adjusted run-arg tests to create zephyr/zephyr.exe under correct build dir. Ran `busted spec/api_spec/manager_spec.lua` (24/0/0/0).
<!-- SECTION:NOTES:END -->
