[tools] Add an option to checkout v8-perf repo before running perf tests

R=machenbach@chromium.org

No-Try: true
Bug: chromium:838864
Change-Id: I02e38778ec4c33a20f4b2e93fb22615baa316883
Reviewed-on: https://chromium-review.googlesource.com/1151295
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54723}
This commit is contained in:
Sergiy Byelozyorov 2018-07-26 15:11:27 +02:00 committed by Commit Bot
parent 7995eccf74
commit ba02337157

View File

@ -126,6 +126,7 @@ RESULT_LIST_RE = re.compile(r"^\[([^\]]+)\]$")
TOOLS_BASE = os.path.abspath(os.path.dirname(__file__))
ANDROID_BUILD_TOOLS = os.path.join(
os.path.dirname(TOOLS_BASE), 'build', 'android')
V8_PERF_INTERNAL_REPO = 'https://chrome-internal.googlesource.com/v8/v8-perf'
def LoadAndroidBuildTools(path): # pragma: no cover
@ -1042,6 +1043,11 @@ def Main(args):
"--filter=JSTests/TypedArrays/ will run only TypedArray "
"benchmarks from the JSTests suite.",
default="")
parser.add_option('--checkout-internal-perf-at',
help="When specified the script will clone V8 repository "
"with internal perf tests at the specified revision to "
"v8-perf subdirectory in current working directory. The "
"caller must have read access to the repo.")
(options, args) = parser.parse_args(args)
@ -1096,6 +1102,15 @@ def Main(args):
options.json_test_results_secondary = os.path.abspath(
options.json_test_results_secondary)
if options.checkout_internal_perf_at:
v8_perf_internal_path = os.path.abspath('v8-perf')
# TODO(sergiyb): Add logic to reuse Git cache on the bot if available.
subprocess.check_call(
['git', 'clone', V8_PERF_INTERNAL_REPO, v8_perf_internal_path])
subprocess.check_call(
['git', 'reset', '--hard', options.checkout_internal_perf_at],
cwd=v8_perf_internal_path)
# Ensure all arguments have absolute path before we start changing current
# directory.
args = map(os.path.abspath, args)