Refactor persisting state in push and merge scripts.

- The backed state dict is now persisted and restored in the step template as a json file
- All explicit persist/restore calls are removed
- Added testing an unexpected script failure + restart with state recovery to the merge-to-branch test
- This CL is not changing external behavior of the scripts

BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/170583002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ae76ce8f
...@@ -83,10 +83,10 @@ class CheckTreeStatus(Step): ...@@ -83,10 +83,10 @@ class CheckTreeStatus(Step):
def RunStep(self): def RunStep(self):
status_url = "https://v8-status.appspot.com/current?format=json" status_url = "https://v8-status.appspot.com/current?format=json"
status_json = self.ReadURL(status_url, wait_plan=[5, 20, 300, 300]) status_json = self.ReadURL(status_url, wait_plan=[5, 20, 300, 300])
message = json.loads(status_json)["message"] self["tree_message"] = json.loads(status_json)["message"]
if re.search(r"nopush|no push", message, flags=re.I): if re.search(r"nopush|no push", self["tree_message"], flags=re.I):
self.Die("Push to trunk disabled by tree state: %s" % message) self.Die("Push to trunk disabled by tree state: %s"
self.Persist("tree_message", message) % self["tree_message"])
class FetchLatestRevision(Step): class FetchLatestRevision(Step):
...@@ -97,18 +97,17 @@ class FetchLatestRevision(Step): ...@@ -97,18 +97,17 @@ class FetchLatestRevision(Step):
match = re.match(r"^r(\d+) ", log) match = re.match(r"^r(\d+) ", log)
if not match: if not match:
self.Die("Could not extract current svn revision from log.") self.Die("Could not extract current svn revision from log.")
self.Persist("latest", match.group(1)) self["latest"] = match.group(1)
class CheckLastPush(Step): class CheckLastPush(Step):
MESSAGE = "Checking last V8 push to trunk." MESSAGE = "Checking last V8 push to trunk."
def RunStep(self): def RunStep(self):
self.RestoreIfUnset("latest")
log = self.Git("svn log -1 --oneline ChangeLog").strip() log = self.Git("svn log -1 --oneline ChangeLog").strip()
match = re.match(r"^r(\d+) \| Prepare push to trunk", log) match = re.match(r"^r(\d+) \| Prepare push to trunk", log)
if match: if match:
latest = int(self._state["latest"]) latest = int(self["latest"])
last_push = int(match.group(1)) last_push = int(match.group(1))
# TODO(machebach): This metric counts all revisions. It could be # TODO(machebach): This metric counts all revisions. It could be
# improved by counting only the revisions on bleeding_edge. # improved by counting only the revisions on bleeding_edge.
...@@ -124,7 +123,7 @@ class FetchLKGR(Step): ...@@ -124,7 +123,7 @@ class FetchLKGR(Step):
def RunStep(self): def RunStep(self):
lkgr_url = "https://v8-status.appspot.com/lkgr" lkgr_url = "https://v8-status.appspot.com/lkgr"
# Retry several times since app engine might have issues. # Retry several times since app engine might have issues.
self.Persist("lkgr", self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300])) self["lkgr"] = self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300])
class PushToTrunk(Step): class PushToTrunk(Step):
...@@ -145,11 +144,8 @@ class PushToTrunk(Step): ...@@ -145,11 +144,8 @@ class PushToTrunk(Step):
wait_plan=[5, 20]) wait_plan=[5, 20])
def RunStep(self): def RunStep(self):
self.RestoreIfUnset("latest") latest = int(self["latest"])
self.RestoreIfUnset("lkgr") lkgr = int(self["lkgr"])
self.RestoreIfUnset("tree_message")
latest = int(self._state["latest"])
lkgr = int(self._state["lkgr"])
if latest == lkgr: if latest == lkgr:
print "ToT (r%d) is clean. Pushing to trunk." % latest print "ToT (r%d) is clean. Pushing to trunk." % latest
self.PushTreeStatus("Tree is closed (preparing to push)") self.PushTreeStatus("Tree is closed (preparing to push)")
...@@ -165,7 +161,7 @@ class PushToTrunk(Step): ...@@ -165,7 +161,7 @@ class PushToTrunk(Step):
self._options.c), self._options.c),
self._side_effect_handler) self._side_effect_handler)
finally: finally:
self.PushTreeStatus(self._state["tree_message"]) self.PushTreeStatus(self["tree_message"])
else: else:
print("ToT (r%d) is ahead of the LKGR (r%d). Skipping push to trunk." print("ToT (r%d) is ahead of the LKGR (r%d). Skipping push to trunk."
% (latest, lkgr)) % (latest, lkgr))
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import datetime import datetime
import json
import os import os
import re import re
import subprocess import subprocess
...@@ -246,17 +247,35 @@ class Step(object): ...@@ -246,17 +247,35 @@ class Step(object):
assert self._side_effect_handler is not None assert self._side_effect_handler is not None
assert isinstance(options, CommonOptions) assert isinstance(options, CommonOptions)
def __getitem__(self, key):
# Convenience method to allow direct [] access on step classes for
# manipulating the backed state dict.
return self._state[key]
def __setitem__(self, key, value):
# Convenience method to allow direct [] access on step classes for
# manipulating the backed state dict.
self._state[key] = value
def Config(self, key): def Config(self, key):
return self._config[key] return self._config[key]
def Run(self): def Run(self):
if self._requires: # Restore state.
self.RestoreIfUnset(self._requires) state_file = "%s-state.json" % self._config[PERSISTFILE_BASENAME]
if not self._state[self._requires]: if not self._state and os.path.exists(state_file):
return self._state.update(json.loads(FileToText(state_file)))
# Skip step if requirement is not met.
if self._requires and not self._state.get(self._requires):
return
print ">>> Step %d: %s" % (self._number, self._text) print ">>> Step %d: %s" % (self._number, self._text)
self.RunStep() self.RunStep()
# Persist state.
TextToFile(json.dumps(self._state), state_file)
def RunStep(self): def RunStep(self):
raise NotImplementedError raise NotImplementedError
...@@ -349,19 +368,6 @@ class Step(object): ...@@ -349,19 +368,6 @@ class Step(object):
msg = "Can't continue. Please delete branch %s and try again." % name msg = "Can't continue. Please delete branch %s and try again." % name
self.Die(msg) self.Die(msg)
def Persist(self, var, value):
value = value or "__EMPTY__"
TextToFile(value, "%s-%s" % (self._config[PERSISTFILE_BASENAME], var))
def Restore(self, var):
value = FileToText("%s-%s" % (self._config[PERSISTFILE_BASENAME], var))
value = value or self.Die("Variable '%s' could not be restored." % var)
return "" if value == "__EMPTY__" else value
def RestoreIfUnset(self, var_name):
if self._state.get(var_name) is None:
self._state[var_name] = self.Restore(var_name)
def InitialEnvironmentChecks(self): def InitialEnvironmentChecks(self):
# Cancel if this is not a git checkout. # Cancel if this is not a git checkout.
if not os.path.exists(self._config[DOT_GIT_LOCATION]): if not os.path.exists(self._config[DOT_GIT_LOCATION]):
...@@ -378,14 +384,13 @@ class Step(object): ...@@ -378,14 +384,13 @@ class Step(object):
self.Die("Workspace is not clean. Please commit or undo your changes.") self.Die("Workspace is not clean. Please commit or undo your changes.")
# Persist current branch. # Persist current branch.
current_branch = "" self["current_branch"] = ""
git_result = self.Git("status -s -b -uno").strip() git_result = self.Git("status -s -b -uno").strip()
for line in git_result.splitlines(): for line in git_result.splitlines():
match = re.match(r"^## (.+)", line) match = re.match(r"^## (.+)", line)
if match: if match:
current_branch = match.group(1) self["current_branch"] = match.group(1)
break break
self.Persist("current_branch", current_branch)
# Fetch unfetched revisions. # Fetch unfetched revisions.
if self.Git("svn fetch") is None: if self.Git("svn fetch") is None:
...@@ -393,8 +398,7 @@ class Step(object): ...@@ -393,8 +398,7 @@ class Step(object):
def PrepareBranch(self): def PrepareBranch(self):
# Get ahold of a safe temporary branch and check it out. # Get ahold of a safe temporary branch and check it out.
self.RestoreIfUnset("current_branch") if self["current_branch"] != self._config[TEMP_BRANCH]:
if self._state["current_branch"] != self._config[TEMP_BRANCH]:
self.DeleteBranch(self._config[TEMP_BRANCH]) self.DeleteBranch(self._config[TEMP_BRANCH])
self.Git("checkout -b %s" % self._config[TEMP_BRANCH]) self.Git("checkout -b %s" % self._config[TEMP_BRANCH])
...@@ -402,11 +406,10 @@ class Step(object): ...@@ -402,11 +406,10 @@ class Step(object):
self.DeleteBranch(self._config[BRANCHNAME]) self.DeleteBranch(self._config[BRANCHNAME])
def CommonCleanup(self): def CommonCleanup(self):
self.RestoreIfUnset("current_branch") self.Git("checkout -f %s" % self["current_branch"])
self.Git("checkout -f %s" % self._state["current_branch"]) if self._config[TEMP_BRANCH] != self["current_branch"]:
if self._config[TEMP_BRANCH] != self._state["current_branch"]:
self.Git("branch -D %s" % self._config[TEMP_BRANCH]) self.Git("branch -D %s" % self._config[TEMP_BRANCH])
if self._config[BRANCHNAME] != self._state["current_branch"]: if self._config[BRANCHNAME] != self["current_branch"]:
self.Git("branch -D %s" % self._config[BRANCHNAME]) self.Git("branch -D %s" % self._config[BRANCHNAME])
# Clean up all temporary files. # Clean up all temporary files.
...@@ -417,8 +420,7 @@ class Step(object): ...@@ -417,8 +420,7 @@ class Step(object):
match = re.match(r"^#define %s\s+(\d*)" % def_name, line) match = re.match(r"^#define %s\s+(\d*)" % def_name, line)
if match: if match:
value = match.group(1) value = match.group(1)
self.Persist("%s%s" % (prefix, var_name), value) self["%s%s" % (prefix, var_name)] = value
self._state["%s%s" % (prefix, var_name)] = value
for line in LinesInFile(self._config[VERSION_FILE]): for line in LinesInFile(self._config[VERSION_FILE]):
for (var_name, def_name) in [("major", "MAJOR_VERSION"), for (var_name, def_name) in [("major", "MAJOR_VERSION"),
("minor", "MINOR_VERSION"), ("minor", "MINOR_VERSION"),
...@@ -426,10 +428,6 @@ class Step(object): ...@@ -426,10 +428,6 @@ class Step(object):
("patch", "PATCH_LEVEL")]: ("patch", "PATCH_LEVEL")]:
ReadAndPersist(var_name, def_name) ReadAndPersist(var_name, def_name)
def RestoreVersionIfUnset(self, prefix=""):
for v in ["major", "minor", "build", "patch"]:
self.RestoreIfUnset("%s%s" % (prefix, v))
def WaitForLGTM(self): def WaitForLGTM(self):
print ("Please wait for an LGTM, then type \"LGTM<Return>\" to commit " print ("Please wait for an LGTM, then type \"LGTM<Return>\" to commit "
"your change. (If you need to iterate on the patch or double check " "your change. (If you need to iterate on the patch or double check "
...@@ -509,6 +507,9 @@ def RunScript(step_classes, ...@@ -509,6 +507,9 @@ def RunScript(step_classes,
config, config,
options, options,
side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER):
state_file = "%s-state.json" % config[PERSISTFILE_BASENAME]
if options.s == 0 and os.path.exists(state_file):
os.remove(state_file)
state = {} state = {}
steps = [] steps = []
for (number, step_class) in enumerate(step_classes): for (number, step_class) in enumerate(step_classes):
......
This diff is collapsed.
This diff is collapsed.
...@@ -298,6 +298,7 @@ class ScriptTest(unittest.TestCase): ...@@ -298,6 +298,7 @@ class ScriptTest(unittest.TestCase):
def MakeStep(self, step_class=Step, state=None, options=None): def MakeStep(self, step_class=Step, state=None, options=None):
"""Convenience wrapper.""" """Convenience wrapper."""
options = options or CommonOptions(MakeOptions()) options = options or CommonOptions(MakeOptions())
state = state if state is not None else self._state
return MakeStep(step_class=step_class, number=0, state=state, return MakeStep(step_class=step_class, number=0, state=state,
config=TEST_CONFIG, options=options, config=TEST_CONFIG, options=options,
side_effect_handler=self) side_effect_handler=self)
...@@ -356,6 +357,7 @@ class ScriptTest(unittest.TestCase): ...@@ -356,6 +357,7 @@ class ScriptTest(unittest.TestCase):
self._rl_mock = SimpleMock("readline") self._rl_mock = SimpleMock("readline")
self._url_mock = SimpleMock("readurl") self._url_mock = SimpleMock("readurl")
self._tmp_files = [] self._tmp_files = []
self._state = {}
def tearDown(self): def tearDown(self):
Command("rm", "-rf %s*" % TEST_CONFIG[PERSISTFILE_BASENAME]) Command("rm", "-rf %s*" % TEST_CONFIG[PERSISTFILE_BASENAME])
...@@ -369,12 +371,6 @@ class ScriptTest(unittest.TestCase): ...@@ -369,12 +371,6 @@ class ScriptTest(unittest.TestCase):
self._rl_mock.AssertFinished() self._rl_mock.AssertFinished()
self._url_mock.AssertFinished() self._url_mock.AssertFinished()
def testPersistRestore(self):
self.MakeStep().Persist("test1", "")
self.assertEquals("", self.MakeStep().Restore("test1"))
self.MakeStep().Persist("test2", "AB123")
self.assertEquals("AB123", self.MakeStep().Restore("test2"))
def testGitOrig(self): def testGitOrig(self):
self.assertTrue(Command("git", "--version").startswith("git version")) self.assertTrue(Command("git", "--version").startswith("git version"))
...@@ -396,7 +392,7 @@ class ScriptTest(unittest.TestCase): ...@@ -396,7 +392,7 @@ class ScriptTest(unittest.TestCase):
self.ExpectReadline(["Y"]) self.ExpectReadline(["Y"])
self.MakeStep().CommonPrepare() self.MakeStep().CommonPrepare()
self.MakeStep().PrepareBranch() self.MakeStep().PrepareBranch()
self.assertEquals("some_branch", self.MakeStep().Restore("current_branch")) self.assertEquals("some_branch", self._state["current_branch"])
def testCommonPrepareNoConfirm(self): def testCommonPrepareNoConfirm(self):
self.ExpectGit([ self.ExpectGit([
...@@ -408,7 +404,7 @@ class ScriptTest(unittest.TestCase): ...@@ -408,7 +404,7 @@ class ScriptTest(unittest.TestCase):
self.ExpectReadline(["n"]) self.ExpectReadline(["n"])
self.MakeStep().CommonPrepare() self.MakeStep().CommonPrepare()
self.assertRaises(Exception, self.MakeStep().PrepareBranch) self.assertRaises(Exception, self.MakeStep().PrepareBranch)
self.assertEquals("some_branch", self.MakeStep().Restore("current_branch")) self.assertEquals("some_branch", self._state["current_branch"])
def testCommonPrepareDeleteBranchFailure(self): def testCommonPrepareDeleteBranchFailure(self):
self.ExpectGit([ self.ExpectGit([
...@@ -421,7 +417,7 @@ class ScriptTest(unittest.TestCase): ...@@ -421,7 +417,7 @@ class ScriptTest(unittest.TestCase):
self.ExpectReadline(["Y"]) self.ExpectReadline(["Y"])
self.MakeStep().CommonPrepare() self.MakeStep().CommonPrepare()
self.assertRaises(Exception, self.MakeStep().PrepareBranch) self.assertRaises(Exception, self.MakeStep().PrepareBranch)
self.assertEquals("some_branch", self.MakeStep().Restore("current_branch")) self.assertEquals("some_branch", self._state["current_branch"])
def testInitialEnvironmentChecks(self): def testInitialEnvironmentChecks(self):
TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
...@@ -432,14 +428,10 @@ class ScriptTest(unittest.TestCase): ...@@ -432,14 +428,10 @@ class ScriptTest(unittest.TestCase):
TEST_CONFIG[VERSION_FILE] = self.MakeTempVersionFile() TEST_CONFIG[VERSION_FILE] = self.MakeTempVersionFile()
step = self.MakeStep() step = self.MakeStep()
step.ReadAndPersistVersion() step.ReadAndPersistVersion()
self.assertEquals("3", self.MakeStep().Restore("major")) self.assertEquals("3", step["major"])
self.assertEquals("22", self.MakeStep().Restore("minor")) self.assertEquals("22", step["minor"])
self.assertEquals("5", self.MakeStep().Restore("build")) self.assertEquals("5", step["build"])
self.assertEquals("0", self.MakeStep().Restore("patch")) self.assertEquals("0", step["patch"])
self.assertEquals("3", step._state["major"])
self.assertEquals("22", step._state["minor"])
self.assertEquals("5", step._state["build"])
self.assertEquals("0", step._state["patch"])
def testRegex(self): def testRegex(self):
self.assertEqual("(issue 321)", self.assertEqual("(issue 321)",
...@@ -490,7 +482,7 @@ class ScriptTest(unittest.TestCase): ...@@ -490,7 +482,7 @@ class ScriptTest(unittest.TestCase):
"Title\n\nBUG=456\nLOG=N\n\n"], "Title\n\nBUG=456\nLOG=N\n\n"],
]) ])
self.MakeStep().Persist("last_push", "1234") self._state["last_push"] = "1234"
self.MakeStep(PrepareChangeLog).Run() self.MakeStep(PrepareChangeLog).Run()
actual_cl = FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE]) actual_cl = FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE])
...@@ -522,10 +514,10 @@ class ScriptTest(unittest.TestCase): ...@@ -522,10 +514,10 @@ class ScriptTest(unittest.TestCase):
#""" #"""
self.assertEquals(expected_cl, actual_cl) self.assertEquals(expected_cl, actual_cl)
self.assertEquals("3", self.MakeStep().Restore("major")) self.assertEquals("3", self._state["major"])
self.assertEquals("22", self.MakeStep().Restore("minor")) self.assertEquals("22", self._state["minor"])
self.assertEquals("5", self.MakeStep().Restore("build")) self.assertEquals("5", self._state["build"])
self.assertEquals("0", self.MakeStep().Restore("patch")) self.assertEquals("0", self._state["patch"])
def testEditChangeLog(self): def testEditChangeLog(self):
TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
...@@ -545,7 +537,7 @@ class ScriptTest(unittest.TestCase): ...@@ -545,7 +537,7 @@ class ScriptTest(unittest.TestCase):
def testIncrementVersion(self): def testIncrementVersion(self):
TEST_CONFIG[VERSION_FILE] = self.MakeTempVersionFile() TEST_CONFIG[VERSION_FILE] = self.MakeTempVersionFile()
self.MakeStep().Persist("build", "5") self._state["build"] = "5"
self.ExpectReadline([ self.ExpectReadline([
"Y", # Increment build number. "Y", # Increment build number.
...@@ -553,10 +545,10 @@ class ScriptTest(unittest.TestCase): ...@@ -553,10 +545,10 @@ class ScriptTest(unittest.TestCase):
self.MakeStep(IncrementVersion).Run() self.MakeStep(IncrementVersion).Run()
self.assertEquals("3", self.MakeStep().Restore("new_major")) self.assertEquals("3", self._state["new_major"])
self.assertEquals("22", self.MakeStep().Restore("new_minor")) self.assertEquals("22", self._state["new_minor"])
self.assertEquals("6", self.MakeStep().Restore("new_build")) self.assertEquals("6", self._state["new_build"])
self.assertEquals("0", self.MakeStep().Restore("new_patch")) self.assertEquals("0", self._state["new_patch"])
def testLastChangeLogEntries(self): def testLastChangeLogEntries(self):
TEST_CONFIG[CHANGELOG_FILE] = self.MakeEmptyTempFile() TEST_CONFIG[CHANGELOG_FILE] = self.MakeEmptyTempFile()
...@@ -584,8 +576,8 @@ class ScriptTest(unittest.TestCase): ...@@ -584,8 +576,8 @@ class ScriptTest(unittest.TestCase):
["svn find-rev hash1", "123455\n"], ["svn find-rev hash1", "123455\n"],
]) ])
self.MakeStep().Persist("prepare_commit_hash", "hash1") self._state["prepare_commit_hash"] = "hash1"
self.MakeStep().Persist("date", "1999-11-11") self._state["date"] = "1999-11-11"
self.MakeStep(SquashCommits).Run() self.MakeStep(SquashCommits).Run()
self.assertEquals(FileToText(TEST_CONFIG[COMMITMSG_FILE]), expected_msg) self.assertEquals(FileToText(TEST_CONFIG[COMMITMSG_FILE]), expected_msg)
...@@ -810,8 +802,11 @@ Performance and stability improvements on all platforms.""", commit) ...@@ -810,8 +802,11 @@ Performance and stability improvements on all platforms.""", commit)
auto_roll.RunAutoRoll(TEST_CONFIG, AutoRollOptions( auto_roll.RunAutoRoll(TEST_CONFIG, AutoRollOptions(
MakeOptions(status_password=status_password)), self) MakeOptions(status_password=status_password)), self)
self.assertEquals("100", self.MakeStep().Restore("lkgr")) state = json.loads(FileToText("%s-state.json"
self.assertEquals("100", self.MakeStep().Restore("latest")) % TEST_CONFIG[PERSISTFILE_BASENAME]))
self.assertEquals("100", state["lkgr"])
self.assertEquals("100", state["latest"])
def testAutoRollStoppedBySettings(self): def testAutoRollStoppedBySettings(self):
TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
...@@ -906,6 +901,10 @@ LOG=N ...@@ -906,6 +901,10 @@ LOG=N
["svn find-rev hash3 svn/bleeding_edge", "56789"], ["svn find-rev hash3 svn/bleeding_edge", "56789"],
["log -1 --format=%s hash3", "Title3"], ["log -1 --format=%s hash3", "Title3"],
["svn find-rev \"r12345\" svn/bleeding_edge", "hash4"], ["svn find-rev \"r12345\" svn/bleeding_edge", "hash4"],
# Simulate svn being down which stops the script.
["svn find-rev \"r23456\" svn/bleeding_edge", None],
# Restart script in the failing step.
["svn find-rev \"r12345\" svn/bleeding_edge", "hash4"],
["svn find-rev \"r23456\" svn/bleeding_edge", "hash2"], ["svn find-rev \"r23456\" svn/bleeding_edge", "hash2"],
["svn find-rev \"r34567\" svn/bleeding_edge", "hash3"], ["svn find-rev \"r34567\" svn/bleeding_edge", "hash3"],
["svn find-rev \"r45678\" svn/bleeding_edge", "hash1"], ["svn find-rev \"r45678\" svn/bleeding_edge", "hash1"],
...@@ -964,6 +963,15 @@ LOG=N ...@@ -964,6 +963,15 @@ LOG=N
# ports of r12345. r56789 is the MIPS port of r34567. # ports of r12345. r56789 is the MIPS port of r34567.
args = ["trunk", "12345", "23456", "34567"] args = ["trunk", "12345", "23456", "34567"]
self.assertTrue(merge_to_branch.ProcessOptions(options, args)) self.assertTrue(merge_to_branch.ProcessOptions(options, args))
# The first run of the script stops because of the svn being down.
self.assertRaises(Exception,
lambda: RunMergeToBranch(TEST_CONFIG,
MergeToBranchOptions(options, args),
self))
# Test that state recovery after restarting the script works.
options.s = 3
RunMergeToBranch(TEST_CONFIG, MergeToBranchOptions(options, args), self) RunMergeToBranch(TEST_CONFIG, MergeToBranchOptions(options, args), self)
......
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