From 4f9cd7821a7433ddf9fe9edf6bc52ccc3b89576d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 4 Oct 2026 18:14:42 -0500 Subject: [PATCH] [core] Log ignored --skip-bootloader at debug level (#20059) --- esphome/__main__.py | 6 +++--- tests/unit_tests/test_main.py | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index 40457dbcc2..6c984050f4 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -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" ) diff --git a/tests/unit_tests/test_main.py b/tests/unit_tests/test_main.py index e46b61cfd5..4edf6d5fc3 100644 --- a/tests/unit_tests/test_main.py +++ b/tests/unit_tests/test_main.py @@ -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