summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 17:43:41 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 17:43:41 +0000
commitde00d5bf4bafd9e507fc554a06fc406600a2b9be (patch)
treedd3265e9c8a1ec4a4e2b1c1eb99895f2548af7b4
parent5ee6a422067f594d25c1687f1265ca9f9607c0fa (diff)
downloadchromium_src-de00d5bf4bafd9e507fc554a06fc406600a2b9be.zip
chromium_src-de00d5bf4bafd9e507fc554a06fc406600a2b9be.tar.gz
chromium_src-de00d5bf4bafd9e507fc554a06fc406600a2b9be.tar.bz2
If good..bad range is all before or after the recent build cutoff, use the appropriate server.
If good..bad straddles the recent build cutoff, test out the oldest recent build. If that build is good, bisect only recent builds from build.chromium.org. If that build is bad, bisect only old builds. BUG=89974 TEST=(1) run bisect-builds.py with defaults; (2) accept default good/bad args; when chrome starts, close it and specify good; verify that further downloads come from build.chromium.org domain. Repeat (1) and (2); specify bad; verify that further downloads come from commondatastorage.googleapis.com. Review URL: http://codereview.chromium.org/7468020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93432 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/bisect-builds.py49
1 files changed, 32 insertions, 17 deletions
diff --git a/tools/bisect-builds.py b/tools/bisect-builds.py
index 11711cd..68ceb3c 100644
--- a/tools/bisect-builds.py
+++ b/tools/bisect-builds.py
@@ -204,17 +204,11 @@ def ParseDirectoryIndexRecent(context):
return re.findall(r"<a href=\"(\d+)/\">\1/</a>", document)
-def GetRevList(context):
- """Gets the list of revision numbers between |good_revision| and
+def FilterRevList(context, revlist):
+ """Filter revlist to the revisions between |good_revision| and
|bad_revision| of the |context|."""
# Download the revlist and filter for just the range between good and bad.
rev_range = range(context.good_revision, context.bad_revision)
- revisions = []
- if context.use_recent:
- revisions = ParseDirectoryIndexRecent(context)
- else:
- revisions = ParseDirectoryIndex(context)
- revlist = map(int, revisions)
revlist = filter(lambda r: r in rev_range, revlist)
revlist.sort()
return revlist
@@ -345,12 +339,6 @@ def main():
parser.add_option('-p', '--profile', '--user-data-dir', type = 'str',
help = 'Profile to use; this will not reset every run. ' +
'Defaults to a clean profile.', default = 'profile')
- parser.add_option('-r', '--recent',
- dest = "recent",
- default = False,
- action = "store_true",
- help = 'Use recent builds from about the last 2 months ' +
- 'for higher granularity bisecting.')
(opts, args) = parser.parse_args()
if opts.archive is None:
@@ -366,7 +354,7 @@ def main():
return 1
# Create the context. Initialize 0 for the revisions as they are set below.
- context = PathContext(opts.archive, 0, 0, opts.recent)
+ context = PathContext(opts.archive, 0, 0, use_recent=False)
# Pick a starting point, try to get HEAD for this.
if opts.bad:
@@ -400,8 +388,35 @@ def main():
context.good_revision = good_rev
context.bad_revision = bad_rev
- # Get a list of revisions to bisect across.
- revlist = GetRevList(context)
+ # Get recent revision list and check whether it's sufficient.
+ all_revs_recent = map(int, ParseDirectoryIndexRecent(context))
+ all_revs_recent.sort()
+ # Skipping 0 since it might be deleted off the server soon:
+ all_revs_recent = all_revs_recent[1:]
+ oldest_recent_rev = all_revs_recent[0]
+ if good_rev >= oldest_recent_rev:
+ # The range is within recent builds, so switch on use_recent.
+ context.use_recent = True
+ elif bad_rev >= oldest_recent_rev:
+ # The range spans both old and recent builds.
+ # If oldest_recent_rev is good, we bisect the recent builds.
+ context.use_recent = True
+ TryRevision(context, oldest_recent_rev, opts.profile, args)
+ if AskIsGoodBuild(oldest_recent_rev):
+ # context.use_recent is True
+ context.good_revision = oldest_recent_rev
+ else:
+ context.use_recent = False
+ context.bad_revision = oldest_recent_rev
+
+ all_revs = []
+ if context.use_recent:
+ all_revs = all_revs_recent
+ else:
+ all_revs = map(int, ParseDirectoryIndex(context))
+
+ # Filter list of revisions to bisect across.
+ revlist = FilterRevList(context, all_revs)
if len(revlist) < 2: # Don't have enough builds to bisect
print 'We don\'t have enough builds to bisect. revlist: %s' % revlist
sys.exit(1)