mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Changed naming convention
presubmit:gerrit_host/folder/to/repo:path/to/file/:CheckName Example presubmit:chromium-review.googlesource.com/chromium/src/:services/viz/ Bug: 1112667 Change-Id: I095a2c04e73c64d67fa1bb3dbf7e6dfd1d93fe26 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2335873 Reviewed-by: Nodir Turakulov <nodir@chromium.org> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org> Commit-Queue: Saagar Sanghavi <saagarsanghavi@google.com>
This commit is contained in:
@@ -21,13 +21,15 @@ class ResultSinkStatus(object):
|
||||
self.status = STATUS_PASS
|
||||
|
||||
@contextlib.contextmanager
|
||||
def setup_rdb(function_name, rel_path):
|
||||
def setup_rdb(function_name, prefix):
|
||||
"""Context Manager function for ResultDB reporting.
|
||||
|
||||
Args:
|
||||
function_name (str): The name of the function we are about to run.
|
||||
rel_path (str): The relative path from the root of the repository to the
|
||||
directory defining the check being executed.
|
||||
prefix (str): The prefix for the name of the test. The format for this is
|
||||
presubmit:gerrit_host/folder/to/repo:path/to/file/
|
||||
for example,
|
||||
presubmit:chromium-review.googlesource.com/chromium/src/:services/viz/
|
||||
"""
|
||||
sink = None
|
||||
if 'LUCI_CONTEXT' in os.environ:
|
||||
@@ -48,7 +50,7 @@ def setup_rdb(function_name, rel_path):
|
||||
elapsed_time = end_time - start_time
|
||||
if sink != None:
|
||||
tr = {
|
||||
'testId': '{0}/:{1}'.format(rel_path, function_name),
|
||||
'testId': '{0}:{1}'.format(prefix, function_name),
|
||||
'status': my_status.status,
|
||||
'expected': (my_status.status == STATUS_PASS),
|
||||
'duration': '{:.9f}s'.format(elapsed_time)
|
||||
|
||||
Reference in New Issue
Block a user