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:
@@ -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:
|
||||
|
@@ -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 ""
|
||||
|
Reference in New Issue
Block a user