Skip to content

Commit e0d0e8d

Browse files
logic fixes
Created using spr 1.3.4
1 parent bd6b2f9 commit e0d0e8d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.ci/compute_projects.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
8787

8888
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
8989
"""Computes the list of projects that should be passed to LLVM_ENABLE_PROJECTS"""
90-
projects_to_test = set(modified_projects)
90+
projects_to_test = set()
9191
for modified_project in modified_projects:
92+
# Skip all projects where we cannot run tests.
93+
if modified_project not in PROJECT_CHECK_TARGETS:
94+
continue
95+
projects_to_test.add(modified_project)
9296
if modified_project not in DEPENDENTS_TO_TEST:
9397
continue
9498
projects_to_test.update(DEPENDENTS_TO_TEST[modified_project])

.ci/compute_projects_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,22 @@ def test_flang(self):
125125
self.assertEqual(env_variables["runtimes_to_build"], "")
126126
self.assertEqual(env_variables["runtimes_check_targets"], "")
127127

128+
def test_invalid_subproject(self):
129+
env_variables = compute_projects.get_env_variables(
130+
[".ci/compute_projects.py"], "Linux"
131+
)
132+
self.assertEqual(env_variables["projects_to_build"], "")
133+
self.assertEqual(env_variables["project_check_targets"], "")
134+
self.assertEqual(env_variables["runtimes_to_build"], "")
135+
self.assertEqual(env_variables["runtimes_check_targets"], "")
136+
137+
def test_top_level_file(self):
138+
env_variables = compute_projects.get_env_variables(["README.md"], "Linux")
139+
self.assertEqual(env_variables["projects_to_build"], "")
140+
self.assertEqual(env_variables["project_check_targets"], "")
141+
self.assertEqual(env_variables["runtimes_to_build"], "")
142+
self.assertEqual(env_variables["runtimes_check_targets"], "")
143+
128144

129145
if __name__ == "__main__":
130146
unittest.main()

0 commit comments

Comments
 (0)