---
id: TASK-5.2
title: Add tests for global/profile args and ordering
status: Done
assignee:
  - codex
created_date: '2026-02-03 12:17'
updated_date: '2026-02-03 12:46'
labels: []
dependencies: []
parent_task_id: TASK-5
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Cover new `args` behavior with Busted tests, including global-only, profile-only, combined order, and string vs list inputs.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover global-only args per phase.
- [x] #2 Tests cover profile-only args per phase.
- [x] #3 Tests cover combined global + profile args and verify ordering (global first).
- [x] #4 Tests cover string vs list inputs and normalization expectations.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1. Add new Busted cases in spec/api_spec/manager_spec.lua that stub manager.execute and assert the exact command array for each phase.
2. Cover global-only args, profile-only args, and combined ordering (global then profile), using both string and list forms.
3. Exercise phases conf/build/flash/run; include sysbuild flash path to verify args appended to west flash when applicable.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added manager_spec cases for global-only args, profile-only args, combined ordering, and string/list normalization across conf/build/flash/run. Ran `busted spec/api_spec/manager_spec.lua`; 1 pre-existing failure remains in `should run flash` (expects `ninja flash` but actual command is `west flash`).
<!-- SECTION:NOTES:END -->
