diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 63a8ade37f..5843b3a5e0 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -23,7 +23,7 @@ jobs: with: debug-only: ${{ github.ref != 'refs/heads/dev' }} # Dry-run when not run on dev branch remove-stale-when-updated: true - operations-per-run: 150 + operations-per-run: 400 # The 90 day stale policy for PRs # - PRs diff --git a/ard_esp32_opentherm_tests_pr.md b/ard_esp32_opentherm_tests_pr.md new file mode 100644 index 0000000000..b543109d56 --- /dev/null +++ b/ard_esp32_opentherm_tests_pr.md @@ -0,0 +1,86 @@ +# What does this implement/fix? + +Removes redundant ESP32 Arduino test files for the `opentherm` component and cleans up redundant preprocessor conditionals. The ESP-IDF tests provide complete coverage since the opentherm component has no framework-specific implementation differences for ESP32. + +Also fixes incorrect preprocessor conditionals - changes `#if defined(ESP32) || defined(USE_ESP_IDF)` to `#ifdef USE_ESP32`. The macro `ESP32` is only defined for the original ESP32 variant, while `USE_ESP32` covers all ESP32 variants (C3, S2, S3, etc.). The `|| defined(USE_ESP_IDF)` was unnecessary since ESP-IDF can only run on ESP32 platforms. + +## Background + +As part of the ongoing effort to reduce Arduino-specific test redundancy (esphome/backlog#66), this PR removes ESP32 Arduino tests that duplicate IDF test coverage. + +**Analysis of opentherm component:** +- Previously used `#if defined(ESP32) || defined(USE_ESP_IDF)` to check for ESP32 **platform** +- This was incorrect: `ESP32` is only defined for the original ESP32 variant, not C3/S2/S3 +- Changed to `#ifdef USE_ESP32` which covers all ESP32 variants +- The `|| defined(USE_ESP_IDF)` part was unnecessary since ESP-IDF can only run on ESP32 platforms +- ESP32 timer APIs (`timer_init`, `timer_set_counter_value`, `timer_isr_callback_add`) are ESP-IDF APIs +- These timer APIs work identically in both Arduino and ESP-IDF frameworks since Arduino is now built on ESP-IDF +- Only ESP8266 has framework-specific code (using Arduino's `timer1_*` functions) +- ESP32 implementation is identical across frameworks + +## Changes + +### Code Cleanup + +**OpenTherm component:** +- Fixed incorrect `#if defined(ESP32) || defined(USE_ESP_IDF)` to `#ifdef USE_ESP32` in: + - `esphome/components/opentherm/opentherm.h` (3 locations) + - `esphome/components/opentherm/opentherm.cpp` (4 locations) +- `ESP32` is only defined for the original ESP32 variant, not C3/S2/S3 +- `USE_ESP32` correctly covers all ESP32 variants +- The `|| defined(USE_ESP_IDF)` part was unnecessary since ESP-IDF can only be defined on ESP32 platforms + +### Test Files Removed + +- `tests/components/opentherm/test.esp32-ard.yaml` +- `tests/components/opentherm/test.esp32-c3-ard.yaml` + +### Test Coverage Maintained + +ESP-IDF test files remain and cover both frameworks: +- `tests/components/opentherm/test.esp32-idf.yaml` +- `tests/components/opentherm/test.esp32-c3-idf.yaml` + +### Platform-Specific Tests Retained + +Arduino tests remain for ESP8266 (uses Arduino-specific `timer1_*` functions): +- `tests/components/opentherm/test.esp8266-ard.yaml` + +## Benefits + +- **Reduces CI test time** - 2 fewer redundant test configurations +- **Simplifies code** - Removes redundant preprocessor conditionals +- **Maintains coverage** - IDF tests cover both frameworks for ESP32 + +## Types of changes + +- [x] Code quality improvements to existing code or addition of tests + +**Related issue or feature (if applicable):** + +- Part of esphome/backlog#66 - Remove redundant ESP32 Arduino tests + +**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** + +N/A - No user-facing changes + +## Test Environment + +- [x] ESP32 +- [x] ESP32 IDF +- [ ] ESP8266 +- [ ] RP2040 +- [ ] BK72xx +- [ ] RTL87xx +- [ ] nRF52840 + +## Example entry for `config.yaml`: + +N/A - No configuration changes + +## Checklist: + - [x] The code change is tested and works locally. + - [ ] Tests have been added to verify that the new code works (under `tests/` folder). + +If user exposed functionality or configuration variables are added/changed: + - [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs). diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 3cbcdb99b4..d9b8d067a4 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -329,7 +329,8 @@ ARDUINO_FRAMEWORK_VERSION_LOOKUP = { "dev": cv.Version(3, 3, 1), } ARDUINO_PLATFORM_VERSION_LOOKUP = { - cv.Version(3, 3, 1): cv.Version(55, 3, 31), + cv.Version(3, 3, 2): cv.Version(55, 3, 31, "1"), + cv.Version(3, 3, 1): cv.Version(55, 3, 31, "1"), cv.Version(3, 3, 0): cv.Version(55, 3, 30, "2"), cv.Version(3, 2, 1): cv.Version(54, 3, 21, "2"), cv.Version(3, 2, 0): cv.Version(54, 3, 20), @@ -347,8 +348,8 @@ ESP_IDF_FRAMEWORK_VERSION_LOOKUP = { "dev": cv.Version(5, 5, 1), } ESP_IDF_PLATFORM_VERSION_LOOKUP = { - cv.Version(5, 5, 1): cv.Version(55, 3, 31), - cv.Version(5, 5, 0): cv.Version(55, 3, 31), + cv.Version(5, 5, 1): cv.Version(55, 3, 31, "1"), + cv.Version(5, 5, 0): cv.Version(55, 3, 31, "1"), cv.Version(5, 4, 2): cv.Version(54, 3, 21, "2"), cv.Version(5, 4, 1): cv.Version(54, 3, 21, "2"), cv.Version(5, 4, 0): cv.Version(54, 3, 21, "2"), @@ -363,8 +364,8 @@ ESP_IDF_PLATFORM_VERSION_LOOKUP = { # - https://github.com/pioarduino/platform-espressif32/releases PLATFORM_VERSION_LOOKUP = { "recommended": cv.Version(54, 3, 21, "2"), - "latest": cv.Version(55, 3, 31), - "dev": "https://github.com/pioarduino/platform-espressif32.git#develop", + "latest": cv.Version(55, 3, 31, "1"), + "dev": cv.Version(55, 3, 31, "1"), } @@ -656,6 +657,7 @@ def _show_framework_migration_message(name: str, variant: str) -> None: + "Why change? ESP-IDF offers:\n" + color(AnsiFore.GREEN, " ✨ Up to 40% smaller binaries\n") + color(AnsiFore.GREEN, " 🚀 Better performance and optimization\n") + + color(AnsiFore.GREEN, " ⚡ 2-3x faster compile times\n") + color(AnsiFore.GREEN, " 📦 Custom-built firmware for your exact needs\n") + color( AnsiFore.GREEN, @@ -663,7 +665,6 @@ def _show_framework_migration_message(name: str, variant: str) -> None: ) + "\n" + "Trade-offs:\n" - + color(AnsiFore.YELLOW, " ⏱️ Compile times are ~25% longer\n") + color(AnsiFore.YELLOW, " 🔄 Some components need migration\n") + "\n" + "What should I do?\n" diff --git a/tests/components/debug/test.esp32-c3-ard.yaml b/tests/components/debug/test.esp32-c3-ard.yaml deleted file mode 100644 index 7d43491862..0000000000 --- a/tests/components/debug/test.esp32-c3-ard.yaml +++ /dev/null @@ -1,4 +0,0 @@ -<<: !include common.yaml - -esp32: - cpu_frequency: 80MHz diff --git a/tests/components/debug/test.esp32-s2-ard.yaml b/tests/components/debug/test.esp32-s2-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/debug/test.esp32-s2-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/debug/test.esp32-s3-ard.yaml b/tests/components/debug/test.esp32-s3-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/debug/test.esp32-s3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/logger/test-usb_cdc.esp32-c3-ard.yaml b/tests/components/logger/test-usb_cdc.esp32-c3-idf.yaml similarity index 100% rename from tests/components/logger/test-usb_cdc.esp32-c3-ard.yaml rename to tests/components/logger/test-usb_cdc.esp32-c3-idf.yaml diff --git a/tests/components/logger/test-usb_cdc.esp32-s3-ard.yaml b/tests/components/logger/test-usb_cdc.esp32-s3-ard.yaml deleted file mode 100644 index cfdaec9771..0000000000 --- a/tests/components/logger/test-usb_cdc.esp32-s3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common-usb_cdc.yaml diff --git a/tests/components/logger/test-usb_cdc.esp32-s2-ard.yaml b/tests/components/logger/test-usb_cdc.esp32-s3-idf.yaml similarity index 100% rename from tests/components/logger/test-usb_cdc.esp32-s2-ard.yaml rename to tests/components/logger/test-usb_cdc.esp32-s3-idf.yaml diff --git a/tests/components/logger/test.esp32-ard.yaml b/tests/components/logger/test.esp32-ard.yaml deleted file mode 100644 index 3fe04e18a3..0000000000 --- a/tests/components/logger/test.esp32-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common-default_uart.yaml diff --git a/tests/components/logger/test.esp32-c3-ard.yaml b/tests/components/logger/test.esp32-c3-ard.yaml deleted file mode 100644 index 3fe04e18a3..0000000000 --- a/tests/components/logger/test.esp32-c3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common-default_uart.yaml diff --git a/tests/components/mdns/test-enabled.esp32-ard.yaml b/tests/components/mdns/test-enabled.esp32-ard.yaml deleted file mode 100644 index 97fd63d70e..0000000000 --- a/tests/components/mdns/test-enabled.esp32-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common-enabled.yaml diff --git a/tests/components/mdns/test-enabled.esp32-c3-ard.yaml b/tests/components/mdns/test-enabled.esp32-c3-ard.yaml deleted file mode 100644 index 97fd63d70e..0000000000 --- a/tests/components/mdns/test-enabled.esp32-c3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common-enabled.yaml diff --git a/tests/components/network/test-ipv6.esp32-ard.yaml b/tests/components/network/test-ipv6.esp32-ard.yaml deleted file mode 100644 index da1324b17e..0000000000 --- a/tests/components/network/test-ipv6.esp32-ard.yaml +++ /dev/null @@ -1,4 +0,0 @@ -substitutions: - network_enable_ipv6: "true" - -<<: !include common.yaml diff --git a/tests/components/network/test-ipv6.esp32-c3-ard.yaml b/tests/components/network/test-ipv6.esp32-c3-ard.yaml deleted file mode 100644 index da1324b17e..0000000000 --- a/tests/components/network/test-ipv6.esp32-c3-ard.yaml +++ /dev/null @@ -1,4 +0,0 @@ -substitutions: - network_enable_ipv6: "true" - -<<: !include common.yaml diff --git a/tests/components/network/test.esp32-ard.yaml b/tests/components/network/test.esp32-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/network/test.esp32-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/network/test.esp32-c3-ard.yaml b/tests/components/network/test.esp32-c3-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/network/test.esp32-c3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/time/test.esp32-ard.yaml b/tests/components/time/test.esp32-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/time/test.esp32-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/time/test.esp32-c3-ard.yaml b/tests/components/time/test.esp32-c3-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/time/test.esp32-c3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml