forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Add presubmit to add PERFETTO_TESTS to cl description"
This is a reland of commit 73fabae The change was originally reverted due to 1473397. The fix is to replace PresubmitError with PresubmitNotifyResult. Original change's description: > Add presubmit to add PERFETTO_TESTS to cl description > > When making changes to the trace processor chrome standard library, developers should run the Perfetto Diff Tests and ensure they pass before submitting. > > PERFETTO_TESTS=`autoninja -C out/Default perfetto_diff_tests && out/Default/bin/run_perfetto_diff_tests` > > Change-Id: Ief2d38f05a204c5b64055cbf53f9084ce6b4476e > Bug: b/287233796 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4774631 > Commit-Queue: Rasika Navarange <rasikan@google.com> > Reviewed-by: Stephen Nusko <nuskos@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1184099} Bug: b/287233796 Change-Id: Iac87ec5bdb2bd3adb125fd7e2fbe686c14d745d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4788748 Reviewed-by: Alexander Timin <altimin@chromium.org> Commit-Queue: Rasika Navarange <rasikan@google.com> Cr-Commit-Position: refs/heads/main@{#1184745}
- Loading branch information
Rasika Navarange
authored and
Chromium LUCI CQ
committed
Aug 17, 2023
1 parent
7016984
commit 22504bc
Showing
4 changed files
with
169 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright 2023 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/util/generate_wrapper.gni") | ||
import("//build_overrides/build.gni") | ||
|
||
if (enable_base_tracing) { | ||
generate_wrapper("perfetto_diff_tests") { | ||
testonly = true | ||
|
||
_protos_path = "$root_gen_dir/third_party/perfetto/protos" | ||
_trace_descriptor = "$_protos_path/perfetto/trace/trace.descriptor" | ||
_rebased_trace_descriptor = rebase_path(_trace_descriptor, root_build_dir) | ||
_test_extensions_descriptor = | ||
"$_protos_path/perfetto/trace/test_extensions.descriptor" | ||
_rebased_test_extensions_descriptor = | ||
rebase_path(_test_extensions_descriptor, root_build_dir) | ||
_metrics_descriptor = "$_protos_path/perfetto/metrics/metrics.descriptor" | ||
_rebased_metrics_descriptor = | ||
rebase_path(_metrics_descriptor, root_build_dir) | ||
_all_chrome_metrics_descriptor = | ||
"$_protos_path/perfetto/metrics/chrome/all_chrome_metrics.descriptor" | ||
_rebased_all_chrome_metrics_descriptor = | ||
rebase_path(_all_chrome_metrics_descriptor, root_build_dir) | ||
_chrome_track_event_descriptor = | ||
"$_protos_path/third_party/chromium/chrome_track_event.descriptor" | ||
_rebased_chrome_track_event_descriptor = | ||
rebase_path(_chrome_track_event_descriptor, root_build_dir) | ||
|
||
_perfetto_script = | ||
rebase_path("//third_party/perfetto/tools/diff_test_trace_processor.py", | ||
root_build_dir) | ||
_chrome_stdlib = rebase_path("//base/tracing/stdlib/chrome", root_build_dir) | ||
_test_dir = rebase_path("//base/tracing", root_build_dir) | ||
|
||
executable = "//base/tracing/test/run_perfetto_diff_tests.py" | ||
wrapper_script = "$root_build_dir/bin/run_perfetto_diff_tests" | ||
|
||
executable_args = [ | ||
"--trace-processor-shell", | ||
"@WrappedPath(./trace_processor_shell)", | ||
"--chrome-stdlib", | ||
"@WrappedPath($_chrome_stdlib)", | ||
"--test-dir", | ||
"@WrappedPath($_test_dir)", | ||
"--trace-descriptor", | ||
"@WrappedPath($_rebased_trace_descriptor)", | ||
"--test-extensions-descriptor", | ||
"@WrappedPath($_rebased_test_extensions_descriptor)", | ||
"--metrics-descriptor", | ||
"@WrappedPath($_rebased_metrics_descriptor)", | ||
"--all-chrome-metrics-descriptor", | ||
"@WrappedPath($_rebased_all_chrome_metrics_descriptor)", | ||
"--chrome-track-event-descriptor", | ||
"@WrappedPath($_rebased_chrome_track_event_descriptor)", | ||
"--script", | ||
"@WrappedPath($_perfetto_script)", | ||
] | ||
|
||
data_deps = [ | ||
"//third_party/perfetto/protos/perfetto/metrics:descriptor", | ||
"//third_party/perfetto/protos/perfetto/metrics/chrome:descriptor", | ||
"//third_party/perfetto/protos/perfetto/trace:descriptor", | ||
"//third_party/perfetto/protos/perfetto/trace:test_extensions_descriptor", | ||
"//third_party/perfetto/protos/third_party/chromium:descriptor", | ||
"//third_party/perfetto/src/trace_processor:trace_processor_shell", | ||
] | ||
|
||
data = [ | ||
"//third_party/perfetto/tools/diff_test_trace_processor.py", | ||
"//third_party/perfetto/python/generators/diff_tests/", | ||
"//base/tracing/", | ||
_trace_descriptor, | ||
_test_extensions_descriptor, | ||
_metrics_descriptor, | ||
_all_chrome_metrics_descriptor, | ||
_chrome_track_event_descriptor, | ||
] | ||
} | ||
} |
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,51 @@ | ||
#!/usr/bin/env vpython3 | ||
# Copyright 2023 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# A wrapper script for //third_party/perfetto/diff_test_trace_processor.py. | ||
|
||
import argparse | ||
import subprocess | ||
import sys | ||
import os | ||
import time | ||
import json | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--trace-descriptor', type=str, required=True) | ||
parser.add_argument('--test-extensions-descriptor', type=str, required=True) | ||
parser.add_argument('--metrics-descriptor', type=str, required=True) | ||
parser.add_argument( | ||
'--all-chrome-metrics-descriptor', type=str, required=True) | ||
parser.add_argument( | ||
'--chrome-track-event-descriptor', type=str, required=True) | ||
parser.add_argument( | ||
'--chrome-stdlib', type=str, required=True) | ||
parser.add_argument('--test-dir', type=str, required=True) | ||
parser.add_argument( | ||
'--trace-processor-shell', type=str, required=True) | ||
parser.add_argument("--script", type=str, required=True) | ||
args, _ = parser.parse_known_args() | ||
|
||
cmd = [ | ||
"vpython3", args.script, | ||
"--trace-descriptor", args.trace_descriptor, | ||
"--test-extensions", args.test_extensions_descriptor, | ||
"--metrics-descriptor", args.metrics_descriptor, | ||
args.all_chrome_metrics_descriptor, | ||
"--chrome-track-event-descriptor", args.chrome_track_event_descriptor, | ||
"--override-sql-module", os.path.abspath(args.chrome_stdlib), | ||
"--test-dir", args.test_dir, | ||
args.trace_processor_shell, | ||
] | ||
|
||
test_start_time = time.time() | ||
completed_process = subprocess.run(cmd, capture_output=True) | ||
|
||
sys.stderr.buffer.write(completed_process.stderr) | ||
return completed_process.returncode | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |