1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 05:03:48 +00:00

[ci] Fix WiFi testing mode validation and component splitter for variant-only tests (#11481)

This commit is contained in:
J. Nick Koston
2025-10-22 09:10:24 -10:00
committed by GitHub
parent 77141d3e83
commit 1c67a61945
2 changed files with 16 additions and 7 deletions

View File

@@ -213,11 +213,15 @@ def _validate(config):
if CONF_EAP in config: if CONF_EAP in config:
network[CONF_EAP] = config.pop(CONF_EAP) network[CONF_EAP] = config.pop(CONF_EAP)
if CONF_NETWORKS in config: if CONF_NETWORKS in config:
raise cv.Invalid( # In testing mode, merged component tests may have both ssid and networks
"You cannot use the 'ssid:' option together with 'networks:'. Please " # Just use the networks list and ignore the single ssid
"copy your network into the 'networks:' key" if not CORE.testing_mode:
) raise cv.Invalid(
config[CONF_NETWORKS] = cv.ensure_list(WIFI_NETWORK_STA)(network) "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): if (CONF_NETWORKS not in config) and (CONF_AP not in config):
config = config.copy() config = config.copy()

View File

@@ -118,8 +118,13 @@ def create_intelligent_batches(
continue continue
# Get signature from any platform (they should all have the same buses) # 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 # Components not in component_buses may only have variant-specific tests
comp_platforms = component_buses[component] 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(): for platform, buses in comp_platforms.items():
if buses: if buses:
signature = create_grouping_signature({platform: buses}, platform) signature = create_grouping_signature({platform: buses}, platform)