From 86bfcc3c07090ecc14252270274433daea400fc1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 10 Oct 2025 07:04:10 -1000 Subject: [PATCH] tweak --- script/analyze_component_buses.py | 4 +++- script/test_build_components.py | 26 +++++++++++++++++++------- tests/components/gcja5/common.yaml | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/script/analyze_component_buses.py b/script/analyze_component_buses.py index 398bcbcc64..574ea2a484 100755 --- a/script/analyze_component_buses.py +++ b/script/analyze_component_buses.py @@ -78,6 +78,7 @@ ISOLATED_COMPONENTS = { "matrix_keypad": "Needs isolation due to keypad", "mcp4725": "no YAML config to specify i2c bus id", "mcp47a1": "no YAML config to specify i2c bus id", + "modbus_controller": "Defines multiple modbus buses for testing client/server functionality - conflicts with package modbus bus", "packages": "cannot merge packages", } @@ -342,7 +343,8 @@ def analyze_all_components( non_groupable.add(component_name) # Check if component is a base bus component - # These are platform implementations and must be tested separately + # These ARE the bus platform implementations and define buses directly for testing + # They cannot be grouped with components that use bus packages (causes ID conflicts) if component_name in BASE_BUS_COMPONENTS: non_groupable.add(component_name) diff --git a/script/test_build_components.py b/script/test_build_components.py index 916af93b0d..06ba860c26 100755 --- a/script/test_build_components.py +++ b/script/test_build_components.py @@ -27,6 +27,7 @@ sys.path.insert(0, str(Path(__file__).parent.parent)) # pylint: disable=wrong-import-position from script.analyze_component_buses import ( + BASE_BUS_COMPONENTS, ISOLATED_COMPONENTS, NO_BUSES_SIGNATURE, analyze_all_components, @@ -369,6 +370,15 @@ def run_grouped_component_tests( if component not in all_tests: continue + # Skip components that must be tested in isolation + # These are shown separately and should not be in non_groupable_reasons + if component in ISOLATED_COMPONENTS: + continue + + # Skip base bus components (these test the bus platforms themselves) + if component in BASE_BUS_COMPONENTS: + continue + # Skip components that use local file references or direct bus configs if component in non_groupable: # Track the reason (using pre-calculated results to avoid expensive re-analysis) @@ -391,13 +401,6 @@ def run_grouped_component_tests( ) continue - # Skip components that must be tested in isolation - if component in ISOLATED_COMPONENTS: - non_groupable_reasons[component] = ( - f"Known build issue: {ISOLATED_COMPONENTS[component]}" - ) - continue - for platform, buses in platforms.items(): # Skip if platform doesn't match filter if platform_filter and not platform.startswith(platform_filter): @@ -428,6 +431,15 @@ def run_grouped_component_tests( reason = ISOLATED_COMPONENTS[comp] print(f" - {comp}: {reason}") + # Show base bus components (test the bus platform implementations) + base_bus_in_tests = [c for c in BASE_BUS_COMPONENTS if c in all_tests] + if base_bus_in_tests: + print( + f"\n○ {len(base_bus_in_tests)} base bus platform components (tested individually):" + ) + for comp in sorted(base_bus_in_tests): + print(f" - {comp}") + # Show excluded components with detailed reasons if non_groupable_reasons: excluded_in_tests = [c for c in non_groupable_reasons if c in all_tests] diff --git a/tests/components/gcja5/common.yaml b/tests/components/gcja5/common.yaml index b16d928401..64374c0e50 100644 --- a/tests/components/gcja5/common.yaml +++ b/tests/components/gcja5/common.yaml @@ -1,5 +1,6 @@ sensor: - platform: gcja5 + uart_id: uart_bus pm_1_0: name: "Particulate Matter <1.0µm Concentration" pm_2_5: