diff --git a/test_utils/scripts/get_target_packages.py b/test_utils/scripts/get_target_packages.py index 41f29562d99e..80c6850ea162 100644 --- a/test_utils/scripts/get_target_packages.py +++ b/test_utils/scripts/get_target_packages.py @@ -44,6 +44,11 @@ 'speech': {'storage'}, 'vision': {'storage'}, } +REVERSE_DEPS = {} +for pkg, deps in PKG_DEPENDENCIES.items(): + for dep in deps: + REVERSE_DEPS.setdefault(dep, set()).add(pkg) +del pkg, deps def get_baseline(): @@ -147,7 +152,7 @@ def get_changed_packages(file_list): # Add the package, as well as any dependencies this package has. # NOTE: For now, dependencies only go down one level. answer.add(package) - answer = answer.union(PKG_DEPENDENCIES.get(package, set())) + answer = answer.union(REVERSE_DEPS.get(package, set())) # We got this far without being short-circuited; return the final answer. return answer