Report optimized/unoptimized targets correctly

Always report every target that gets built as unoptimized, and only
report targets that wouldn't get built as optimized. Previously when
test discovery succeeded only targets that get built were getting
reported (as optimized when those were the unoptimized ones), and
targets that wouldn't get built were not being reported at all (when
those would be the optimized targets).

Test: Presubmit
Bug: 372973116
Change-Id: I0b22b57654bba90d9eb398651b09ae0f65df0d5c
This commit is contained in:
Luca Farsi 2024-11-18 11:59:43 -08:00
parent 5e393bc8c4
commit b44af1747c

View file

@ -89,6 +89,8 @@ class BuildPlanner:
else:
regex = r'\b(%s)\b' % re.escape(target)
if any(re.search(regex, opt) for opt in test_discovery_zip_regexes):
get_metrics_agent().report_unoptimized_target(target, 'Test artifact used.')
else:
get_metrics_agent().report_optimized_target(target)
if self._unused_target_exclusion_enabled(