---
id: TASK-15.3
title: Add tests for config interpolation behavior
status: Done
assignee:
  - codex
created_date: '2026-02-19 15:48'
updated_date: '2026-02-19 16:49'
labels: []
dependencies:
  - TASK-15.1
  - TASK-15.2
references:
  - spec/
  - spec/lib_spec/utils_spec.lua
  - spec/api_spec/configurator_spec.lua
  - spec/api_spec/manager_spec.lua
parent_task_id: TASK-15
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add unit tests covering recursive interpolation, profile-aware resolution, and common path substitutions in config args.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover recursive interpolation in nested tables and args fields.
- [x] #2 Tests cover profile-aware substitutions for ${board}, ${build_dir}, and ${project_dir}.
- [x] #3 Tests confirm configs without placeholders behave unchanged.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Add configurator spec that writes zconf.lua with nested tables and args containing ${...} placeholders, run init_conf(), and assert recursive interpolation for nested fields and args resolved using workspace values.
2) Add configurator spec with profiles that use ${board}, ${build_dir}, and ${project_dir} inside profile args; ensure init_conf() interpolates per-profile scope (board override + build/sim).
3) Add configurator spec for configs without placeholders to confirm values remain unchanged after init_conf().
4) Run relevant Busted test(s) and update acceptance criteria status/notes accordingly.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added configurator specs for recursive interpolation, profile-aware placeholders, and no-placeholder configs in spec/api_spec/configurator_spec.lua.

Tests run: busted -c spec/api_spec/configurator_spec.lua (30 successes). Note: existing zconf unknown field warnings appeared during run.

Updated interpolation specs to avoid unknown zconf fields by confining nested/recursive cases to args tables; warnings cleared.

Tests run: busted -c spec/api_spec/configurator_spec.lua (30 successes).
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Summary:
- Added configurator specs to validate recursive interpolation in nested args tables, profile-aware placeholder resolution for ${board}/${build_dir}/${project_dir}, and no-placeholder configs remaining unchanged.
- Covered both workspace-level and per-profile interpolation scopes in zconf inputs to match configurator behavior, without introducing unknown zconf fields.

Tests:
- busted -c spec/api_spec/configurator_spec.lua (30 successes)

Notes:
- No Definition of Done items were defined for this task.
<!-- SECTION:FINAL_SUMMARY:END -->
