[CI] Exclude gn changes from running premerge (#133623)

These changes are mostly pushed by the gnsyncbot directly to main and
thus don't go through a PR, but we still test on main to see if main is
broken. Given these touch llvm/, they end up burning a decent amount of
testing time for no real benefit, so I think it makes sense to exclude
them from premerge testing explicitly.
This commit is contained in:
Aiden Grossman 2025-04-01 12:58:16 -07:00 committed by GitHub
parent 782e0cef76
commit ce296f1eba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -200,6 +200,11 @@ def _get_modified_projects(modified_files: list[str]) -> Set[str]:
# documentation builds.
if len(path_parts) > 2 and path_parts[1] == "docs":
continue
# Exclude files for the gn build. We do not test it within premerge
# and changes occur often enough that they otherwise take up
# capacity.
if len(path_parts) > 3 and path_parts[:3] == ("llvm", "utils", "gn"):
continue
modified_projects.add(pathlib.Path(modified_file).parts[0])
return modified_projects

View File

@ -179,6 +179,15 @@ class TestComputeProjects(unittest.TestCase):
self.assertEqual(env_variables["runtimes_to_build"], "")
self.assertEqual(env_variables["runtimes_check_targets"], "")
def test_exclude_gn(self):
env_variables = compute_projects.get_env_variables(
["llvm/utils/gn/build/BUILD.gn"], "Linux"
)
self.assertEqual(env_variables["projects_to_build"], "")
self.assertEqual(env_variables["project_check_targets"], "")
self.assertEqual(env_variables["runtimes_to_build"], "")
self.assertEqual(env_variables["runtimes_check_targets"], "")
if __name__ == "__main__":
unittest.main()