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

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

Issue 212983003: Implement auto-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 9 months 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 | « tools/push-to-trunk/common_includes.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/test_scripts.py
diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py
index 9107db97ec5762a8783f21536e935df1e2aade25..f1fe46f106629bea9dd9d300e5f218232f401f91 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -34,6 +34,7 @@ import unittest
import auto_push
from auto_push import CheckLastPush
from auto_push import SETTINGS_LOCATION
+import auto_roll
import common_includes
from common_includes import *
import merge_to_branch
@@ -261,7 +262,7 @@ class SimpleMock(object):
# arguments.
if len(args) > len(expected_call['args']):
raise NoRetryException("When calling %s with arguments, the "
- "expectations must consist of at least as many arguments.")
+ "expectations must consist of at least as many arguments." % name)
# Compare expected and actual arguments.
for (expected_arg, actual_arg) in zip(expected_call['args'], args):
@@ -908,6 +909,70 @@ Performance and stability improvements on all platforms.""", commit)
auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS)
self.assertRaises(Exception, RunAutoPush)
+ def testAutoRollExistingRoll(self):
+ self.ExpectReadURL([
+ URL("https://codereview.chromium.org/search",
+ "owner=author%40chromium.org&limit=30&closed=3&format=json",
+ ("{\"results\": [{\"subject\": \"different\"},"
+ "{\"subject\": \"Update V8 to Version...\"}]}")),
+ ])
+
+ result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
+ AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]])
+ self.assertEquals(1, result)
+
+ # Snippet from the original DEPS file.
+ FAKE_DEPS = """
+vars = {
+ "v8_revision": "123455",
+}
+deps = {
+ "src/v8":
+ (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" +
+ Var("v8_revision"),
+}
+"""
+
+ def testAutoRollUpToDate(self):
+ self.ExpectReadURL([
+ URL("https://codereview.chromium.org/search",
+ "owner=author%40chromium.org&limit=30&closed=3&format=json",
+ ("{\"results\": [{\"subject\": \"different\"}]}")),
+ URL("http://src.chromium.org/svn/trunk/src/DEPS",
+ self.FAKE_DEPS),
+ ])
+
+ self.ExpectGit([
+ Git(("log -1 --format=%H --grep="
+ "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
+ "svn/trunk"), "push_hash\n"),
+ Git("svn find-rev push_hash", "123455\n"),
+ ])
+
+ result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
+ AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]])
+ self.assertEquals(1, result)
+
+ def testAutoRoll(self):
+ self.ExpectReadURL([
+ URL("https://codereview.chromium.org/search",
+ "owner=author%40chromium.org&limit=30&closed=3&format=json",
+ ("{\"results\": [{\"subject\": \"different\"}]}")),
+ URL("http://src.chromium.org/svn/trunk/src/DEPS",
+ self.FAKE_DEPS),
+ ])
+
+ self.ExpectGit([
+ Git(("log -1 --format=%H --grep="
+ "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
+ "svn/trunk"), "push_hash\n"),
+ Git("svn find-rev push_hash", "123456\n"),
+ ])
+
+ result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
+ AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM], "--roll"])
+ self.assertEquals(0, result)
+
def testMergeToBranch(self):
TEST_CONFIG[ALREADY_MERGING_SENTINEL_FILE] = self.MakeEmptyTempFile()
TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698