mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 19:44:08 +00:00
[core] Log ignored --skip-bootloader at debug level (#20059)
This commit is contained in:
+3
-3
@@ -829,9 +829,9 @@ def write_cpp_file() -> int:
|
||||
|
||||
def compile_program(args: ArgsProtocol, config: ConfigType) -> int:
|
||||
if CORE.skip_bootloader and not (CORE.is_esp32 and CORE.using_toolchain_esp_idf):
|
||||
# Info, not a warning: an orchestrator cannot see YAML toolchain
|
||||
# overrides, this is its expected no-op, and a full build is safe.
|
||||
_LOGGER.info(
|
||||
# Debug only: an orchestrator cannot see YAML toolchain overrides,
|
||||
# so this is its expected no-op, and a full build is safe.
|
||||
_LOGGER.debug(
|
||||
"--skip-bootloader ignored: only supported on ESP32 with the "
|
||||
"esp-idf toolchain"
|
||||
)
|
||||
|
||||
@@ -5358,7 +5358,7 @@ def _setup_build_info_test(
|
||||
return build_info_path, firmware_path
|
||||
|
||||
|
||||
def test_compile_program_warns_and_ignores_skip_bootloader_elsewhere(
|
||||
def test_compile_program_quietly_ignores_skip_bootloader_elsewhere(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""A full build is always safe; orchestrators cannot see YAML overrides."""
|
||||
@@ -5372,11 +5372,13 @@ def test_compile_program_warns_and_ignores_skip_bootloader_elsewhere(
|
||||
side_effect=EsphomeError("stop here"),
|
||||
),
|
||||
pytest.raises(EsphomeError, match="stop here"),
|
||||
caplog.at_level("INFO"),
|
||||
caplog.at_level("DEBUG"),
|
||||
):
|
||||
compile_program(MockArgs(), config)
|
||||
|
||||
assert "--skip-bootloader ignored" in caplog.text
|
||||
assert [
|
||||
r.levelno for r in caplog.records if "--skip-bootloader ignored" in r.message
|
||||
] == [logging.DEBUG]
|
||||
assert CORE.skip_bootloader is False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user