Commit 3379baf7 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Generalize specifying revisions for VR bisect script

Generalizes the ability to specify specific revisions for other
repositories when using the VR bisect script. Previously, this was only
available as an option for specifying a clank revision, but can now be
used if some other repository is causing compile errors in the
regression range.

Change-Id: Ieb5045b21989541102a1f57bcf17e0b0e18f710c
Reviewed-on: https://chromium-review.googlesource.com/956562
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541944}
parent c3123cb9
...@@ -66,10 +66,22 @@ def ParseArgsAndAssertValid(): ...@@ -66,10 +66,22 @@ def ParseArgsAndAssertValid():
help='The value of the metric at the bad revision. If ' help='The value of the metric at the bad revision. If '
'not defined, an extra test iteration will be run ' 'not defined, an extra test iteration will be run '
'to determine the value') 'to determine the value')
parser.add_argument('--clank-revision', def comma_separated(arg):
help='The Clank revision to sync to during the bisect. ' split_arg = arg.split(',')
'Only necessary if the revision on ToT is not ' if len(split_arg) != 2:
'compatible with the revision range of the bisect') raise argparse.ArgumentError(
'Expected two comma-separated strings but '
'received %d' % len(split_arg))
return {split_arg[0]: split_arg[1]}
parser.add_argument('--checkout-override', action='append',
type=comma_separated, dest='checkout_overrides',
help='A comma-separated path/revision key/value pair. '
'Each git checkout at the specified path will be '
'synced to the specified revision after the normal '
'sync. For example, passing '
'third_party/android_ndk,abcdefg would cause the '
'checkout in //third_party/android_ndk to be synced '
'to revision abcdefg.')
parser.add_argument('--reset-before-sync', action='store_true', parser.add_argument('--reset-before-sync', action='store_true',
default=False, default=False,
help='When set, runs "git reset --hard HEAD" before ' help='When set, runs "git reset --hard HEAD" before '
...@@ -82,14 +94,7 @@ def ParseArgsAndAssertValid(): ...@@ -82,14 +94,7 @@ def ParseArgsAndAssertValid():
help='The swarming server to trigger the test on') help='The swarming server to trigger the test on')
parser.add_argument('--isolate-server', required=True, parser.add_argument('--isolate-server', required=True,
help='The isolate server to upload the test to') help='The isolate server to upload the test to')
def dimension(arg): parser.add_argument('--dimension', action='append', type=comma_separated,
split_arg = arg.split(',')
if len(split_arg) != 2:
raise argparse.ArgumentError(
'Expected two comma-separated strings for --dimension, '
'received %d' % len(split_arg))
return {split_arg[0]: split_arg[1]}
parser.add_argument('--dimension', action='append', type=dimension,
default=[], dest='dimensions', default=[], dest='dimensions',
help='A comma-separated swarming dimension key/value ' help='A comma-separated swarming dimension key/value '
'pair. At least one must be provided.') 'pair. At least one must be provided.')
...@@ -151,6 +156,10 @@ def VerifyInput(args, unknown_args): ...@@ -151,6 +156,10 @@ def VerifyInput(args, unknown_args):
else: else:
print 'Changing from %f at %s to %f at %s' % (args.good_value, print 'Changing from %f at %s to %f at %s' % (args.good_value,
args.good_revision, args.bad_value, args.bad_revision) args.good_revision, args.bad_value, args.bad_revision)
if args.checkout_overrides:
for pair in args.checkout_overrides:
for key, val in pair.iteritems():
print '%s will be synced to revision %s' % (key, val)
print '======' print '======'
print 'The test target %s will be built to %s' % (args.build_target, print 'The test target %s will be built to %s' % (args.build_target,
args.build_output_dir) args.build_output_dir)
...@@ -363,10 +372,14 @@ def SyncAndBuild(args, unknown_args, revision): ...@@ -363,10 +372,14 @@ def SyncAndBuild(args, unknown_args, revision):
'If these changes are actually yours, please commit or stash them. If ' 'If these changes are actually yours, please commit or stash them. If '
'they are not, remove them and try again. If the issue persists, try ' 'they are not, remove them and try again. If the issue persists, try '
'running with --reset-before-sync') 'running with --reset-before-sync')
if args.clank_revision:
os.chdir('clank') # Checkout any specified revisions.
subprocess.check_output(['git', 'checkout', args.clank_revision]) cwd = os.getcwd()
os.chdir('..') for override in args.checkout_overrides:
for repo, rev in override.iteritems():
os.chdir(repo)
subprocess.check_output(['git', 'checkout', rev])
os.chdir(cwd)
print 'Building' print 'Building'
subprocess.check_output(['ninja', '-C', args.build_output_dir, subprocess.check_output(['ninja', '-C', args.build_output_dir,
'-j', str(args.parallel_jobs), '-j', str(args.parallel_jobs),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment