1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-21 03:03:50 +01:00

esp32 only platforms

This commit is contained in:
J. Nick Koston
2025-10-17 16:11:28 -10:00
parent 29b9073d62
commit f5d69a2539
3 changed files with 20 additions and 28 deletions

View File

@@ -54,6 +54,7 @@ from helpers import (
changed_files,
get_all_dependencies,
get_components_from_integration_fixtures,
parse_test_filename,
root_path,
)
@@ -335,11 +336,8 @@ def detect_memory_impact_config(
# Check if component has tests for any preferred platform
available_platforms = []
for test_file in test_files:
parts = test_file.stem.split(".")
if len(parts) < 2:
continue
platform = parts[1]
if platform in PLATFORM_PREFERENCE:
_, platform = parse_test_filename(test_file)
if platform != "all" and platform in PLATFORM_PREFERENCE:
available_platforms.append(platform)
if not available_platforms:

View File

@@ -46,6 +46,23 @@ def parse_list_components_output(output: str) -> list[str]:
return [c.strip() for c in output.strip().split("\n") if c.strip()]
def parse_test_filename(test_file: Path) -> tuple[str, str]:
"""Parse test filename to extract test name and platform.
Test files follow the naming pattern: test.<platform>.yaml or test-<variant>.<platform>.yaml
Args:
test_file: Path to test file
Returns:
Tuple of (test_name, platform)
"""
parts = test_file.stem.split(".")
if len(parts) == 2:
return parts[0], parts[1] # test, platform
return parts[0], "all"
def styled(color: str | tuple[str, ...], msg: str, reset: bool = True) -> str:
prefix = "".join(color) if isinstance(color, tuple) else color
suffix = colorama.Style.RESET_ALL if reset else ""