From a5ae1097cc6a72e6e2e1c846d3fe54eb070b5649 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 24 Aug 2026 18:45:40 -0500 Subject: [PATCH] Restore the fast fail before the baseline build when nothing matched --- script/test_build_components.py | 7 +++++++ tests/script/test_test_build_components.py | 8 ++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/script/test_build_components.py b/script/test_build_components.py index d50e9f5847..d167d7850e 100755 --- a/script/test_build_components.py +++ b/script/test_build_components.py @@ -1083,6 +1083,13 @@ def test_components( print("No components requested (blank component list)") return 1 + if fail_on_no_tests and not all_tests: + # Nothing matched at all: fail before the synthetic baseline build, + # which would spend a compile reporting success on nothing. Partial + # matches defer to the per-pattern accounting after the summary. + print(f"No components found matching: {component_patterns}") + return 1 + if not all_tests: print(f"No components found matching: {component_patterns}") print( diff --git a/tests/script/test_test_build_components.py b/tests/script/test_test_build_components.py index 214c1e1273..1d21e5d943 100644 --- a/tests/script/test_test_build_components.py +++ b/tests/script/test_test_build_components.py @@ -302,9 +302,7 @@ def test_components_wildcard_no_match_fails_with_flag( fail_on_no_tests=True, ) assert rc == 1 - assert "No tests ran for requested pattern(s): zz_no_such*" in ( - capsys.readouterr().out - ) + assert "No components found matching" in capsys.readouterr().out def test_components_empty_match_tolerated_without_flag() -> None: @@ -332,6 +330,4 @@ def test_components_unknown_component_fails_with_flag( fail_on_no_tests=True, ) assert rc == 1 - assert "No tests ran for requested pattern(s): no_such_component_xyz" in ( - capsys.readouterr().out - ) + assert "No components found matching" in capsys.readouterr().out