---
id: TASK-27.1
title: Add unit tests for config schema overlays and config resolution edge cases
status: Done
assignee:
  - codex
created_date: '2026-03-03 09:14'
updated_date: '2026-03-03 09:25'
labels:
  - tests
  - coverage
dependencies: []
references:
  - src/config/schema.rs
  - src/core/config.rs
parent_task_id: TASK-27
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Cover uncovered unit paths in config schema overlays and core config resolution based on the 2026-03-03 llvm-cov report. Focus on overlay branches and config resolution branches that currently lack unit test coverage.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 ProjectCfg overlay covers name override when rhs.name is Some.
- [x] #2 ZephyrCfg overlay covers workspace/base override paths.
- [x] #3 BuildCfg overlay covers non-empty root override and link_compile_commands override.
- [x] #4 ProfileCfg overlay covers board/runner overrides; PhaseArgs overlay covers flash/run override branches.
- [x] #5 ArgList deserialization covers the single-string (Helper::One) path.
- [x] #6 core/config resolve_single covers Command::Boards branch (board_resolved default) and discover_zephyr env-restore path when ZEPHYR_BASE was already set before the test.
- [x] #7 All new tests pass with `cargo llvm-cov --lib --bins`.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Add schema tests for overlay branches (ProjectCfg name override, ZephyrCfg workspace/base override, BuildCfg non-empty root override, ProfileCfg board/runner override, PhaseArgs flash/run override) and ArgList single-string deserialization in `src/config/schema.rs`.
2) Add core config tests for `resolve_single` Boards command default board and for `discover_zephyr` when ZEPHYR_BASE is pre-set, ensuring env restore branch executes in `src/core/config.rs`.
3) Run unit tests (targeted if possible) or `cargo llvm-cov --lib --bins` to confirm coverage, then update acceptance criteria.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added schema overlay tests (ProjectCfg name, ZephyrCfg workspace/base, BuildCfg root override, ProfileCfg board/runner override, PhaseArgs flash/run override) and ArgList single-string deserialization. Added core config tests for Command::Boards resolve_single and env-restore when ZEPHYR_BASE pre-set.

Ran `cargo llvm-cov --lib --bins --text --show-missing-lines --output-path /tmp/llvm-cov.txt` (100 unit tests + main test passed).
<!-- SECTION:NOTES:END -->
