diff --git a/script/test_build_components.py b/script/test_build_components.py index a4b9877aaf..b042452d9d 100755 --- a/script/test_build_components.py +++ b/script/test_build_components.py @@ -196,9 +196,19 @@ def run_esphome_test( print(" (using --testing-mode)") try: - result = subprocess.run(cmd, check=not continue_on_fail) - return result.returncode == 0, cmd_str + result = subprocess.run(cmd, check=False) + success = result.returncode == 0 + if not success and not continue_on_fail: + # Print command immediately for failed tests + print(f"\n{'=' * 80}") + print("FAILED - Command to reproduce:") + print(f"{'=' * 80}") + print(cmd_str) + print() + raise subprocess.CalledProcessError(result.returncode, cmd) + return success, cmd_str except subprocess.CalledProcessError: + # Re-raise if we're not continuing on fail if not continue_on_fail: raise return False, cmd_str @@ -295,9 +305,19 @@ def run_grouped_test( print(" (using --testing-mode)") try: - result = subprocess.run(cmd, check=not continue_on_fail) - return result.returncode == 0, cmd_str + result = subprocess.run(cmd, check=False) + success = result.returncode == 0 + if not success and not continue_on_fail: + # Print command immediately for failed tests + print(f"\n{'=' * 80}") + print("FAILED - Command to reproduce:") + print(f"{'=' * 80}") + print(cmd_str) + print() + raise subprocess.CalledProcessError(result.returncode, cmd) + return success, cmd_str except subprocess.CalledProcessError: + # Re-raise if we're not continuing on fail if not continue_on_fail: raise return False, cmd_str diff --git a/tests/components/lvgl/common.yaml b/tests/components/lvgl/common.yaml index a035900386..d9b7013a1e 100644 --- a/tests/components/lvgl/common.yaml +++ b/tests/components/lvgl/common.yaml @@ -1,5 +1,6 @@ touchscreen: - platform: ft63x6 + i2c_id: i2c_bus id: tft_touch display: tft_display update_interval: 50ms diff --git a/tests/components/lvgl/test.esp32-idf.yaml b/tests/components/lvgl/test.esp32-idf.yaml index e8222a4fa8..6170b0f4fb 100644 --- a/tests/components/lvgl/test.esp32-idf.yaml +++ b/tests/components/lvgl/test.esp32-idf.yaml @@ -1,10 +1,7 @@ -spi: - clk_pin: 14 - mosi_pin: 13 - -i2c: - sda: GPIO18 - scl: GPIO19 +packages: + lvgl: !include lvgl-package.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml sensor: - platform: rotary_encoder @@ -25,6 +22,7 @@ binary_sensor: display: - platform: ili9xxx + spi_id: spi_bus model: st7789v id: second_display dimensions: @@ -44,6 +42,7 @@ display: update_interval: never - platform: ili9xxx + spi_id: spi_bus model: st7789v id: tft_display dimensions: @@ -60,10 +59,6 @@ display: invert_colors: false update_interval: never -packages: - lvgl: !include lvgl-package.yaml - spi: !include ../../test_build_components/common/spi/esp32-idf.yaml - lvgl: displays: - tft_display