---
id: TASK-10.4
title: Add manager tests for boards/runners/list-images and error paths
status: Done
assignee:
  - '@codex'
created_date: '2026-02-04 11:47'
updated_date: '2026-02-04 11:59'
labels: []
dependencies: []
references:
  - spec/api_spec/manager_spec.lua
  - lua/zync/api/manager.lua
parent_task_id: TASK-10
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Extend manager specs to cover list/print behavior and error branches for boards, runners, image resolution, and sysbuild list handling, focusing on observable behavior and exit codes.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover `Manager.boards` logging/printing and exit code handling (by stubbing `execute`).
- [x] #2 Tests cover `Manager.runners` success and failure paths (missing zephyr_base should return 1 and log; valid zephyr_base lists runner names).
- [x] #3 Tests cover `Manager.list_images` output ordering and `Manager.run`/`Manager.flash` error paths when sysbuild image resolution fails.
- [x] #4 Tests assert concrete behavior (printed output, exit codes, or config changes), not just line hits.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1. Add manager specs for `boards` to assert it prints the header/footer and returns the execute exit code (stub `execute`, stub `print`).
2. Add manager specs for `runners`: missing `zephyr_base` returns 1 and logs failure; valid `zephyr_base` with fixture files lists runner names (assert printed output).
3. Add manager specs for `list_images` ordering and sysbuild image resolution error paths in `run`/`flash` (assert exit code/log).
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added manager specs for boards, runners, sysbuild image listing, and sysbuild image resolution error paths for run/flash.

Ran `busted spec/api_spec/manager_spec.lua` (31/0/0/0).
<!-- SECTION:NOTES:END -->
