[TD] More files for test_public_bindings (#132284)

It relies on that file

Also we care about .cpp files too apparently
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132284
Approved by: https://github.com/ZainRizvi
This commit is contained in:
Catherine Lee
2024-07-31 19:53:39 +00:00
committed by PyTorch MergeBot
parent cb4c107d70
commit aeb78c9849

View File

@ -15,6 +15,7 @@ class PublicBindings(HeuristicInterface):
# Literally just a heuristic for test_public_bindings. Pretty much anything
# that changes the public API can affect this testp
test_public_bindings = "test_public_bindings"
additional_files = ["test/allowlist_for_publicAPI.json"]
def __init__(self, **kwargs: dict[str, Any]) -> None:
super().__init__(**kwargs)
@ -28,7 +29,8 @@ class PublicBindings(HeuristicInterface):
changed_files = []
if any(
file.startswith("torch/") and file.endswith(".py") for file in changed_files
file.startswith("torch/") or file in self.additional_files
for file in changed_files
):
test_ratings[TestRun(self.test_public_bindings)] = 1.0
return TestPrioritizations(tests, test_ratings)