mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:43:00 +00:00
[ci] Fix memory impact build selecting unbuildable platform (#16788)
This commit is contained in:
@@ -149,6 +149,31 @@ def get_component_test_files(
|
||||
return files
|
||||
|
||||
|
||||
def get_component_test_platforms(component: str, *, base_only: bool = True) -> set[str]:
|
||||
"""Return the set of platforms a component has compilable test files for.
|
||||
|
||||
Uses the same discovery as ``test_build_components.py`` (``get_component_test_files``
|
||||
+ ``parse_test_filename``) so callers agree with what the build runner would
|
||||
actually compile. With ``base_only=True`` (the default, matching the
|
||||
memory-impact build's ``--base-only``), only base ``test.<platform>.yaml``
|
||||
files are considered; variant ``test-<variant>.<platform>.yaml`` files are
|
||||
excluded. The ``"all"`` platform sentinel is excluded.
|
||||
|
||||
Args:
|
||||
component: Component name (e.g. "wifi")
|
||||
base_only: If True, only consider base test files (default).
|
||||
|
||||
Returns:
|
||||
Set of platform identifiers (e.g. {"esp32-idf", "esp8266-ard"}).
|
||||
"""
|
||||
platforms: set[str] = set()
|
||||
for test_file in get_component_test_files(component, all_variants=not base_only):
|
||||
platform = parse_test_filename(test_file)[1]
|
||||
if platform != "all":
|
||||
platforms.add(platform)
|
||||
return platforms
|
||||
|
||||
|
||||
def is_validate_only_file(test_file: Path) -> bool:
|
||||
"""Return True if the given path is a config-only validate file.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user