forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test directory -> monorail component metadata to test invocations.
The new ResultDB system has the ability to associate test results with Monorail components and teams, but in order to do that, we need to upload the mapping information contained in the testing/DIR_METADATA files along with the test results. This CL adds a gclient hook to generate the metadata in a ResultDB-friendly format that can be accessed by `rdb` and uploaded as part of a test invocation, and makes the generated data a dependency of the bin/run_* test scripts, to ensure that every test invocation will have the data. Change-Id: I83dcf7f460b6fbd1d4c23616d972510712019148 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568896 Commit-Queue: Dirk Pranke <dpranke@google.com> Reviewed-by: Chan Li <chanli@chromium.org> Reviewed-by: Nodir Turakulov <nodir@chromium.org> Cr-Commit-Position: refs/heads/master@{#861612}
- Loading branch information
Showing
5 changed files
with
95 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,44 @@ | ||
#!/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 | ||
|
||
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' | ||
|
||
return subprocess.call([ | ||
exe, | ||
'location-tags', | ||
'-out', args.out, | ||
'-root', SRC_DIR, | ||
'-repo', 'https://chromium.googlesource.com/chromium/src', | ||
]) | ||
|
||
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