Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1778)

Unified Diff: tools/push-to-trunk/auto_roll.py

Issue 77453009: Make auto-roll testable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/auto_roll.py
diff --git a/tools/push-to-trunk/auto_roll.py b/tools/push-to-trunk/auto_roll.py
index 9547301184b9f438f71dbaaa775b245a366be8ba..e068763253c8b8ea05d687f2fca4b187ade8b402 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -29,7 +29,6 @@
import optparse
import re
import sys
-import urllib2
from common_includes import *
@@ -66,15 +65,7 @@ class FetchLKGR(Step):
def RunStep(self):
lkgr_url = "https://v8-status.appspot.com/lkgr"
- try:
- # pylint: disable=E1121
- url_fh = urllib2.urlopen(lkgr_url, None, 60)
- except urllib2.URLError:
- self.Die("URLException while fetching %s" % lkgr_url)
- try:
- self.Persist("lkgr", url_fh.read())
- finally:
- url_fh.close()
+ self.Persist("lkgr", self.ReadURL(lkgr_url))
class PushToTrunk(Step):
@@ -94,6 +85,18 @@ class PushToTrunk(Step):
% (latest, lkgr))
+def RunAutoRoll(config,
+ options,
+ side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER):
+ step_classes = [
+ Preparation,
+ FetchLatestRevision,
+ FetchLKGR,
+ PushToTrunk,
+ ]
+ RunScript(step_classes, config, options, side_effect_handler)
+
+
def BuildOptions():
result = optparse.OptionParser()
result.add_option("-s", "--step", dest="s",
@@ -105,15 +108,7 @@ def BuildOptions():
def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()
-
- step_classes = [
- Preparation,
- FetchLatestRevision,
- FetchLKGR,
- PushToTrunk,
- ]
-
- RunScript(step_classes, CONFIG, options, DEFAULT_SIDE_EFFECT_HANDLER)
+ RunAutoRoll(CONFIG, options)
if __name__ == "__main__":
sys.exit(Main())
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698