forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Add test directory -> monorail component metadata to test inv…
…ocations." This reverts commit a2927e3. Change-Id: I40558e50f44a497a492829e561fc7c0358619d2f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2779735 Reviewed-by: Chan Li <chanli@chromium.org> Commit-Queue: Dirk Pranke <dpranke@google.com> Cr-Commit-Position: refs/heads/master@{#865433}
- Loading branch information
Showing
5 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env python | ||
# Copyright (c) 2021 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
"""Generates the directory->tags mapping used by ResultDB.""" | ||
|
||
# pylint: disable=line-too-long | ||
# | ||
# For more on the tags, see | ||
# https://source.chromium.org/chromium/infra/infra/+/master:go/src/go.chromium.org/luci/resultdb/sink/proto/v1/location_tag.proto | ||
# | ||
# pylint: enable=line-too-long | ||
|
||
from __future__ import print_function | ||
|
||
import argparse | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
THIS_DIR = os.path.dirname(__file__) | ||
SRC_DIR = os.path.dirname(THIS_DIR) | ||
BUILD_DIR = os.path.join(SRC_DIR, 'build') | ||
sys.path.insert(0, BUILD_DIR) | ||
import find_depot_tools | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-o', '--out', required=True, | ||
help='path to write location tag metadata to') | ||
args = parser.parse_args() | ||
|
||
exe = os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'dirmd') | ||
if sys.platform == 'win32': | ||
exe = exe + '.bat' | ||
|
||
try: | ||
return subprocess.call([ | ||
exe, | ||
'location-tags', | ||
'-out', args.out, | ||
'-root', SRC_DIR, | ||
'-repo', 'https://chromium.googlesource.com/chromium/src', | ||
]) | ||
except OSError as e: | ||
# TODO(crbug.com/1191087): Figure out what exactly is going on on Win7 | ||
# and whether this should work, be a hard error, or can be safely | ||
# ignored. | ||
print('%s not found: %s' % (exe, repr(e))) | ||
if (e.errno == errno.ENOENT and sys.platform == 'win32' | ||
and sys.getwindowsversion().major < 10): | ||
pass | ||
raise | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters