Commit bfd11289 authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

[code coverage] Make a temporary dir result dir for layout tests

This CL works around the issue that layout test results merger script
tries to use the profdata directory (CWD) as output directry and wipes
out the content of that directory.

Bug: 960994
Change-Id: I1ca5383d9eb19aba6799cf19d0d5d95c2af82c9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602332Reviewed-by: default avatarRoberto Carrillo <robertocn@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658379}
parent 7b8c1fb3
......@@ -17,6 +17,7 @@ import logging
import os
import subprocess
import sys
import tempfile
import merge_lib as coverage_merger
......@@ -82,6 +83,25 @@ def main():
'--output-json',
params.output_json,
]
# TODO(crbug.com/960994): Without specifying an output directory, the layout
# merge script will use the CWD as the output directory and then tries to
# wipe out the content in that directory, and unfortunately, the CWD is a
# temporary directory that has been used to hold the coverage profdata, so
# without the following hack, the merge script will deletes all the profdata
# files and lead to build failures.
#
# This temporary workaround is only used for evaluating the stability of the
# linux-coverage-rel trybot, it should be removed before merging into
# linxu-rel as it's not reliable enough, for example, things could break if
# the name or arguments of the script are changed.
if params.additional_merge_script.endswith('merge_web_test_results.py'):
new_args.extend([
'--output-directory',
tempfile.mkdtemp(),
'--allow-existing-output-directory',
])
if params.additional_merge_script_args:
new_args += json.loads(params.additional_merge_script_args)
......
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