Pin the size command format in the template test, warn on schema drift

This commit is contained in:
J. Nick Koston
2026-08-28 09:15:35 -05:00
parent 52ce6668d6
commit ad40853283
2 changed files with 15 additions and 1 deletions
+3 -1
View File
@@ -130,7 +130,9 @@ def print_summary(size_json: Path, partitions_csv: Path, firmware_elf: Path) ->
if ram_total and ram_used is not None:
print_size_line("RAM", ram_used, ram_total)
else:
_LOGGER.debug("Skipping RAM summary: no DRAM/DIRAM region in %s", size_json)
# Every chip has a DRAM or DIRAM region, so this firing usually
# means the esp_idf_size json schema changed
_LOGGER.warning("Skipping RAM summary: no DRAM/DIRAM region in %s", size_json)
# esp-idf-size >= 2.1 (IDF >= 6.0) reports the exact image size in
# json2; older 1.x omits it, so derive the same figure from the ELF.
+12
View File
@@ -163,6 +163,18 @@ def test_has_discovered_components_after_configure(tmp_path: Path) -> None:
assert has_discovered_components()
def test_get_project_cmakelists_size_command_uses_json2() -> None:
"""The POST_BUILD size command uses the cheap json2 format, with --ng
only on the 1.x tool bundled with IDF < 6."""
content = _render()
assert "-m esp_idf_size --ng --format=json2" in content
CORE.data[KEY_ESP32][KEY_IDF_VERSION] = cv.Version(6, 0, 0)
content = _render()
assert "--ng" not in content
assert "--format=json2" in content
def test_get_project_cmakelists_uses_supplied_builtin_components() -> None:
"""A cached list replaces project_description.json and is still filtered
by EXCLUDE_COMPONENTS."""