mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
Pin the size command format in the template test, warn on schema drift
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user