diff --git a/script/list-components.py b/script/list-components.py index 4eccdbf96c..559919bb8a 100755 --- a/script/list-components.py +++ b/script/list-components.py @@ -140,7 +140,10 @@ def get_components(files: list[str], get_dependencies: bool = False): def main(): parser = argparse.ArgumentParser() parser.add_argument( - "-c", "--changed", action="store_true", help="Only run on changed files" + "-c", + "--changed", + action="store_true", + help="List all components required for testing based on changes", ) parser.add_argument( "-b", "--branch", help="Branch to compare changed files against" @@ -158,7 +161,9 @@ def main(): changed = changed_files(args.branch) else: changed = changed_files() - files = [f for f in files if f in changed] + # If any base test file(s) changed, there's no need to filter out components + if not any("tests/test_build_components" in file for file in changed): + files = [f for f in files if f in changed] for c in get_components(files, args.changed): print(c)