Commit fa759471 authored by Stephen Martinis's avatar Stephen Martinis Committed by Commit Bot

Fix additional merge script args

They currently aren't being parsed correctly, due to the additional args
looking like command line arguments the merge_results.py script wants to
process. This changes it to require a JSON serialized array of strings,
which won't be consumed by the parser.

We can't use nargs='*' because we already use that to receive the list
of input test results.

Bug: 923711
Change-Id: I5709ffdcdce653e8f46b4ef6c3b8ae2cc9579127
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1572805Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Auto-Submit: Stephen Martinis <martiniss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653237}
parent 240cded6
......@@ -38,7 +38,7 @@ def _MergeAPIArgumentParser(*args, **kwargs):
'--additional-merge-script', help='additional merge script to run')
parser.add_argument(
'--additional-merge-script-args',
help='args for the additional merge script', action='append')
help='JSON serialized string of args for the additional merge script')
parser.add_argument(
'--profdata-dir', required=True, help='where to store the merged data')
parser.add_argument(
......@@ -63,16 +63,17 @@ def main():
'--output-json', params.output_json,
]
if params.additional_merge_script_args:
new_args += params.additional_merge_script_args
new_args += json.loads(params.additional_merge_script_args)
new_args += params.jsons_to_merge
rc = subprocess.call([
sys.executable, params.additional_merge_script] + new_args)
args = [
sys.executable, params.additional_merge_script] + new_args
rc = subprocess.call(args)
if rc != 0:
failed = True
logging.warning('Additional merge script %s exited with %s' % (
params.additional_merge_script, p.returncode
params.additional_merge_script, rc
))
invalid_profiles = coverage_merger.merge_profiles(
......
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