Commit 779dcfb3 authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

[code coverage] Fix shard merge errors due to no binary

There are some targets that don't execute binaries at all, hence don't
dump coverage profile files, and in that case, we should skip merging
coverage dumps for those steps, otherwise, it will result in errors.

Bug: 961363
Change-Id: I3d190343d09e2131bef6385b62d957bee62405e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1603844Reviewed-by: default avatarRoberto Carrillo <robertocn@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658412}
parent b9a39969
......@@ -187,6 +187,16 @@ def merge_profiles(input_dir, output_file, input_extension, profdata_tool_path):
'List of invalid .profraw files that failed to validate and convert: %r'
), invalid_profraw_files)
# The list of input files could be empty in the following scenarios:
# 1. The test target is pure Python scripts test which doesn't execute any
# C/C++ binaries, such as devtools_closure_compile.
# 2. The test target executes binary and does dumps coverage profile data
# files, however, all of them turned out to be invalid.
if not profile_input_file_paths:
logging.info('There is no valid profraw/profdata files to merge, skip '
'invoking profdata tools.')
return invalid_profraw_files
invalid_profdata_files = _call_profdata_tool(
profile_input_file_paths=profile_input_file_paths,
profile_output_file_path=output_file,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment