From 1c67a619459c58fd855771defec3389ae41603f3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 22 Oct 2025 09:10:24 -1000 Subject: [PATCH] [ci] Fix WiFi testing mode validation and component splitter for variant-only tests (#11481) --- esphome/components/wifi/__init__.py | 14 +++++++++----- script/split_components_for_ci.py | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 29d33bfc76..ba488728b7 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -213,11 +213,15 @@ def _validate(config): if CONF_EAP in config: network[CONF_EAP] = config.pop(CONF_EAP) if CONF_NETWORKS in config: - raise cv.Invalid( - "You cannot use the 'ssid:' option together with 'networks:'. Please " - "copy your network into the 'networks:' key" - ) - config[CONF_NETWORKS] = cv.ensure_list(WIFI_NETWORK_STA)(network) + # In testing mode, merged component tests may have both ssid and networks + # Just use the networks list and ignore the single ssid + if not CORE.testing_mode: + raise cv.Invalid( + "You cannot use the 'ssid:' option together with 'networks:'. Please " + "copy your network into the 'networks:' key" + ) + else: + config[CONF_NETWORKS] = cv.ensure_list(WIFI_NETWORK_STA)(network) if (CONF_NETWORKS not in config) and (CONF_AP not in config): config = config.copy() diff --git a/script/split_components_for_ci.py b/script/split_components_for_ci.py index c58dfd218f..87da540d43 100755 --- a/script/split_components_for_ci.py +++ b/script/split_components_for_ci.py @@ -118,8 +118,13 @@ def create_intelligent_batches( continue # Get signature from any platform (they should all have the same buses) - # Components not in component_buses were filtered out by has_test_files check - comp_platforms = component_buses[component] + # Components not in component_buses may only have variant-specific tests + comp_platforms = component_buses.get(component) + if not comp_platforms: + # Component has tests but no analyzable base config - treat as no buses + signature_groups[(ALL_PLATFORMS, NO_BUSES_SIGNATURE)].append(component) + continue + for platform, buses in comp_platforms.items(): if buses: signature = create_grouping_signature({platform: buses}, platform)