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

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

Issue 113973003: Add better remote control to push-to-trunk auto-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/auto_roll.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 cd65a2bdbbb65f3efe9b0aefc36f1ed3d953b546..334983cdbc4b44ee131db23de4bcdc8053b6fa86 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -38,6 +38,7 @@ import auto_roll
from auto_roll import AutoRollOptions
from auto_roll import CheckLastPush
from auto_roll import FetchLatestRevision
+from auto_roll import SETTINGS_LOCATION
TEST_CONFIG = {
@@ -53,6 +54,7 @@ TEST_CONFIG = {
COMMITMSG_FILE: "/tmp/test-v8-push-to-trunk-tempfile-commitmsg",
CHROMIUM: "/tmp/test-v8-push-to-trunk-tempfile-chromium",
DEPS_FILE: "/tmp/test-v8-push-to-trunk-tempfile-chromium/DEPS",
+ SETTINGS_LOCATION: None,
}
@@ -746,8 +748,11 @@ Performance and stability improvements on all platforms."""
def testAutoRoll(self):
TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
+ TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist"
self.ExpectReadURL([
+ ["https://v8-status.appspot.com/current?format=json",
+ "{\"message\": \"Tree is throttled\"}"],
["https://v8-status.appspot.com/lkgr", Exception("Network problem")],
["https://v8-status.appspot.com/lkgr", "100"],
])
@@ -760,13 +765,46 @@ Performance and stability improvements on all platforms."""
["svn log -1 --oneline ChangeLog", "r65 | Prepare push to trunk..."],
])
- auto_roll.RunAutoRoll(TEST_CONFIG,
- AutoRollOptions(MakeOptions(m=False, f=True)),
- self)
+ auto_roll.RunAutoRoll(TEST_CONFIG, AutoRollOptions(MakeOptions()), self)
self.assertEquals("100", self.MakeStep().Restore("lkgr"))
self.assertEquals("101", self.MakeStep().Restore("latest"))
+ def testAutoRollStoppedBySettings(self):
+ TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
+ TEST_CONFIG[SETTINGS_LOCATION] = self.MakeEmptyTempFile()
+ TextToFile("{\"enable_auto_roll\": false}", TEST_CONFIG[SETTINGS_LOCATION])
+
+ self.ExpectReadURL([])
+
+ self.ExpectGit([
+ ["status -s -uno", ""],
+ ["status -s -b -uno", "## some_branch\n"],
+ ["svn fetch", ""],
+ ])
+
+ def RunAutoRoll():
+ auto_roll.RunAutoRoll(TEST_CONFIG, AutoRollOptions(MakeOptions()), self)
+ self.assertRaises(Exception, RunAutoRoll)
+
+ def testAutoRollStoppedByTreeStatus(self):
+ TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
+ TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist"
+
+ self.ExpectReadURL([
+ ["https://v8-status.appspot.com/current?format=json",
+ "{\"message\": \"Tree is throttled (no push)\"}"],
+ ])
+
+ self.ExpectGit([
+ ["status -s -uno", ""],
+ ["status -s -b -uno", "## some_branch\n"],
+ ["svn fetch", ""],
+ ])
+
+ def RunAutoRoll():
+ auto_roll.RunAutoRoll(TEST_CONFIG, AutoRollOptions(MakeOptions()), self)
+ self.assertRaises(Exception, RunAutoRoll)
class SystemTest(unittest.TestCase):
def testReload(self):
« no previous file with comments | « tools/push-to-trunk/auto_roll.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698