| 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 38c644e408c372b356c295e3204555a6d1fbd3fe..b0d1c5813c0257dfd0d505d3743585cd4302bfc4 100644
|
| --- a/tools/push-to-trunk/test_scripts.py
|
| +++ b/tools/push-to-trunk/test_scripts.py
|
| @@ -34,9 +34,7 @@ import unittest
|
|
|
| import auto_push
|
| from auto_push import CheckLastPush
|
| -from auto_push import SETTINGS_LOCATION
|
| import auto_roll
|
| -from auto_roll import CLUSTERFUZZ_API_KEY_FILE
|
| import common_includes
|
| from common_includes import *
|
| import merge_to_branch
|
| @@ -44,7 +42,6 @@ from merge_to_branch import *
|
| import push_to_trunk
|
| from push_to_trunk import *
|
| import chromium_roll
|
| -from chromium_roll import CHROMIUM
|
| from chromium_roll import ChromiumRoll
|
| import releases
|
| from releases import Releases
|
| @@ -57,20 +54,19 @@ from auto_tag import AutoTag
|
|
|
| TEST_CONFIG = {
|
| "DEFAULT_CWD": None,
|
| - BRANCHNAME: "test-prepare-push",
|
| - TRUNKBRANCH: "test-trunk-push",
|
| - PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile",
|
| - CHANGELOG_FILE: None,
|
| - CHANGELOG_ENTRY_FILE: "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry",
|
| - PATCH_FILE: "/tmp/test-v8-push-to-trunk-tempfile-patch",
|
| - COMMITMSG_FILE: "/tmp/test-v8-push-to-trunk-tempfile-commitmsg",
|
| - CHROMIUM: "/tmp/test-v8-push-to-trunk-tempfile-chromium",
|
| - SETTINGS_LOCATION: None,
|
| - ALREADY_MERGING_SENTINEL_FILE:
|
| + "BRANCHNAME": "test-prepare-push",
|
| + "TRUNKBRANCH": "test-trunk-push",
|
| + "PERSISTFILE_BASENAME": "/tmp/test-v8-push-to-trunk-tempfile",
|
| + "CHANGELOG_FILE": None,
|
| + "CHANGELOG_ENTRY_FILE": "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry",
|
| + "PATCH_FILE": "/tmp/test-v8-push-to-trunk-tempfile-patch",
|
| + "COMMITMSG_FILE": "/tmp/test-v8-push-to-trunk-tempfile-commitmsg",
|
| + "CHROMIUM": "/tmp/test-v8-push-to-trunk-tempfile-chromium",
|
| + "SETTINGS_LOCATION": None,
|
| + "ALREADY_MERGING_SENTINEL_FILE":
|
| "/tmp/test-merge-to-branch-tempfile-already-merging",
|
| - COMMIT_HASHES_FILE: "/tmp/test-merge-to-branch-tempfile-PATCH_COMMIT_HASHES",
|
| - TEMPORARY_PATCH_FILE: "/tmp/test-merge-to-branch-tempfile-temporary-patch",
|
| - CLUSTERFUZZ_API_KEY_FILE: "/tmp/test-fake-cf-api-key",
|
| + "TEMPORARY_PATCH_FILE": "/tmp/test-merge-to-branch-tempfile-temporary-patch",
|
| + "CLUSTERFUZZ_API_KEY_FILE": "/tmp/test-fake-cf-api-key",
|
| }
|
|
|
|
|
| @@ -428,8 +424,8 @@ class ScriptTest(unittest.TestCase):
|
| TEST_CONFIG["DEFAULT_CWD"] = self.MakeEmptyTempDirectory()
|
|
|
| def tearDown(self):
|
| - if os.path.exists(TEST_CONFIG[PERSISTFILE_BASENAME]):
|
| - shutil.rmtree(TEST_CONFIG[PERSISTFILE_BASENAME])
|
| + if os.path.exists(TEST_CONFIG["PERSISTFILE_BASENAME"]):
|
| + shutil.rmtree(TEST_CONFIG["PERSISTFILE_BASENAME"])
|
|
|
| # Clean up temps. Doesn't work automatically.
|
| for name in self._tmp_files:
|
| @@ -451,9 +447,9 @@ class ScriptTest(unittest.TestCase):
|
| Cmd("git status -s -uno", ""),
|
| Cmd("git status -s -b -uno", "## some_branch"),
|
| Cmd("git svn fetch", ""),
|
| - Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]),
|
| + Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
|
| RL("Y"),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| ])
|
| self.MakeStep().CommonPrepare()
|
| self.MakeStep().PrepareBranch()
|
| @@ -464,7 +460,7 @@ class ScriptTest(unittest.TestCase):
|
| Cmd("git status -s -uno", ""),
|
| Cmd("git status -s -b -uno", "## some_branch"),
|
| Cmd("git svn fetch", ""),
|
| - Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]),
|
| + Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
|
| RL("n"),
|
| ])
|
| self.MakeStep().CommonPrepare()
|
| @@ -476,9 +472,9 @@ class ScriptTest(unittest.TestCase):
|
| Cmd("git status -s -uno", ""),
|
| Cmd("git status -s -b -uno", "## some_branch"),
|
| Cmd("git svn fetch", ""),
|
| - Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]),
|
| + Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]),
|
| RL("Y"),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], None),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], None),
|
| ])
|
| self.MakeStep().CommonPrepare()
|
| self.assertRaises(Exception, self.MakeStep().PrepareBranch)
|
| @@ -533,7 +529,7 @@ class ScriptTest(unittest.TestCase):
|
|
|
| def testPrepareChangeLog(self):
|
| self.WriteFakeVersionFile()
|
| - TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
|
| + TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
|
|
|
| self.Expect([
|
| Cmd("git log --format=%H 1234..push_hash", "rev1\nrev2\nrev3\nrev4"),
|
| @@ -560,7 +556,7 @@ class ScriptTest(unittest.TestCase):
|
| self._state["version"] = "3.22.5"
|
| self.RunStep(PushToTrunk, PrepareChangeLog)
|
|
|
| - actual_cl = FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE])
|
| + actual_cl = FileToText(TEST_CONFIG["CHANGELOG_ENTRY_FILE"])
|
|
|
| expected_cl = """1999-07-31: Version 3.22.5
|
|
|
| @@ -591,18 +587,18 @@ class ScriptTest(unittest.TestCase):
|
| self.assertEquals(expected_cl, actual_cl)
|
|
|
| def testEditChangeLog(self):
|
| - TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
|
| - TextToFile(" New \n\tLines \n", TEST_CONFIG[CHANGELOG_ENTRY_FILE])
|
| + TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
|
| + TextToFile(" New \n\tLines \n", TEST_CONFIG["CHANGELOG_ENTRY_FILE"])
|
| os.environ["EDITOR"] = "vi"
|
| self.Expect([
|
| RL(""), # Open editor.
|
| - Cmd("vi %s" % TEST_CONFIG[CHANGELOG_ENTRY_FILE], ""),
|
| + Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], ""),
|
| ])
|
|
|
| self.RunStep(PushToTrunk, EditChangeLog)
|
|
|
| self.assertEquals("New\n Lines",
|
| - FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE]))
|
| + FileToText(TEST_CONFIG["CHANGELOG_ENTRY_FILE"]))
|
|
|
| # Version on trunk: 3.22.4.0. Version on master (bleeding_edge): 3.22.6.
|
| # Make sure that the increment is 3.22.7.0.
|
| @@ -627,8 +623,8 @@ class ScriptTest(unittest.TestCase):
|
| self.assertEquals("0", self._state["new_patch"])
|
|
|
| def _TestSquashCommits(self, change_log, expected_msg):
|
| - TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
|
| - with open(TEST_CONFIG[CHANGELOG_ENTRY_FILE], "w") as f:
|
| + TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
|
| + with open(TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "w") as f:
|
| f.write(change_log)
|
|
|
| self.Expect([
|
| @@ -640,9 +636,9 @@ class ScriptTest(unittest.TestCase):
|
| self._state["date"] = "1999-11-11"
|
|
|
| self.RunStep(PushToTrunk, SquashCommits)
|
| - self.assertEquals(FileToText(TEST_CONFIG[COMMITMSG_FILE]), expected_msg)
|
| + self.assertEquals(FileToText(TEST_CONFIG["COMMITMSG_FILE"]), expected_msg)
|
|
|
| - patch = FileToText(TEST_CONFIG[ PATCH_FILE])
|
| + patch = FileToText(TEST_CONFIG["PATCH_FILE"])
|
| self.assertTrue(re.search(r"patch content", patch))
|
|
|
| def testSquashCommitsUnformatted(self):
|
| @@ -685,10 +681,10 @@ Performance and stability improvements on all platforms."""
|
| # file from trunk has build level 4.
|
| self.WriteFakeVersionFile(build=5)
|
|
|
| - TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile()
|
| - TEST_CONFIG[CHANGELOG_FILE] = self.MakeEmptyTempFile()
|
| + TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
|
| + TEST_CONFIG["CHANGELOG_FILE"] = self.MakeEmptyTempFile()
|
| bleeding_edge_change_log = "2014-03-17: Sentinel\n"
|
| - TextToFile(bleeding_edge_change_log, TEST_CONFIG[CHANGELOG_FILE])
|
| + TextToFile(bleeding_edge_change_log, TEST_CONFIG["CHANGELOG_FILE"])
|
| os.environ["EDITOR"] = "vi"
|
|
|
| def ResetChangeLog():
|
| @@ -697,14 +693,14 @@ Performance and stability improvements on all platforms."""
|
| trunk_change_log = """1999-04-05: Version 3.22.4
|
|
|
| Performance and stability improvements on all platforms.\n"""
|
| - TextToFile(trunk_change_log, TEST_CONFIG[CHANGELOG_FILE])
|
| + TextToFile(trunk_change_log, TEST_CONFIG["CHANGELOG_FILE"])
|
|
|
| def ResetToTrunk():
|
| ResetChangeLog()
|
| self.WriteFakeVersionFile()
|
|
|
| def CheckSVNCommit():
|
| - commit = FileToText(TEST_CONFIG[COMMITMSG_FILE])
|
| + commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
|
| self.assertEquals(
|
| """Version 3.22.5 (based on bleeding_edge revision r123455)
|
|
|
| @@ -720,7 +716,7 @@ Performance and stability improvements on all platforms.""", commit)
|
| self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
|
|
|
| # Check that the change log on the trunk branch got correctly modified.
|
| - change_log = FileToText(TEST_CONFIG[CHANGELOG_FILE])
|
| + change_log = FileToText(TEST_CONFIG["CHANGELOG_FILE"])
|
| self.assertEquals(
|
| """1999-07-31: Version 3.22.5
|
|
|
| @@ -744,7 +740,7 @@ Performance and stability improvements on all platforms.""", commit)
|
| Cmd("git svn fetch", ""),
|
| Cmd("git branch", " branch1\n* branch2\n"),
|
| Cmd("git branch", " branch1\n* branch2\n"),
|
| - Cmd("git checkout -b %s svn/bleeding_edge" % TEST_CONFIG[BRANCHNAME],
|
| + Cmd("git checkout -b %s svn/bleeding_edge" % TEST_CONFIG["BRANCHNAME"],
|
| ""),
|
| Cmd("git svn find-rev r123455", "push_hash\n"),
|
| Cmd(("git log -1 --format=%H --grep="
|
| @@ -774,20 +770,21 @@ Performance and stability improvements on all platforms.""", commit)
|
| if manual:
|
| expectations.append(RL("")) # Open editor.
|
| if not force:
|
| - expectations.append(Cmd("vi %s" % TEST_CONFIG[CHANGELOG_ENTRY_FILE], ""))
|
| + expectations.append(
|
| + Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], ""))
|
| expectations += [
|
| Cmd("git svn fetch", "fetch result\n"),
|
| Cmd("git checkout -f svn/bleeding_edge", ""),
|
| Cmd("git diff svn/trunk push_hash", "patch content\n"),
|
| Cmd("git svn find-rev push_hash", "123455\n"),
|
| - Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], "",
|
| + Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG["TRUNKBRANCH"], "",
|
| cb=ResetToTrunk),
|
| - Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""),
|
| - Cmd("git checkout -f svn/trunk -- %s" % TEST_CONFIG[CHANGELOG_FILE], "",
|
| + Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG["PATCH_FILE"], ""),
|
| + Cmd("git checkout -f svn/trunk -- %s" % TEST_CONFIG["CHANGELOG_FILE"], "",
|
| cb=ResetChangeLog),
|
| Cmd("git checkout -f svn/trunk -- src/version.cc", "",
|
| cb=self.WriteFakeVersionFile),
|
| - Cmd("git commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "",
|
| + Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
|
| cb=CheckSVNCommit),
|
| ]
|
| if manual:
|
| @@ -797,8 +794,8 @@ Performance and stability improvements on all platforms.""", commit)
|
| "Some output\nCommitted r123456\nSome output\n"),
|
| Cmd("git svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""),
|
| Cmd("git checkout -f some_branch", ""),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[TRUNKBRANCH], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""),
|
| ]
|
| self.Expect(expectations)
|
|
|
| @@ -808,7 +805,7 @@ Performance and stability improvements on all platforms.""", commit)
|
| else: args += ["-r", "reviewer@chromium.org"]
|
| PushToTrunk(TEST_CONFIG, self).Run(args)
|
|
|
| - cl = FileToText(TEST_CONFIG[CHANGELOG_FILE])
|
| + cl = FileToText(TEST_CONFIG["CHANGELOG_FILE"])
|
| self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl))
|
| self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl))
|
| self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl))
|
| @@ -845,7 +842,7 @@ git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123
|
| """
|
|
|
| def testChromiumRoll(self):
|
| - googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME]
|
| + googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG["PERSISTFILE_BASENAME"]
|
| with open(googlers_mapping_py, "w") as f:
|
| f.write("""
|
| def list_to_dict(entries):
|
| @@ -854,9 +851,9 @@ def get_list():
|
| pass""")
|
|
|
| # Setup fake directory structures.
|
| - TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory()
|
| - TextToFile("", os.path.join(TEST_CONFIG[CHROMIUM], ".git"))
|
| - chrome_dir = TEST_CONFIG[CHROMIUM]
|
| + TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory()
|
| + TextToFile("", os.path.join(TEST_CONFIG["CHROMIUM"], ".git"))
|
| + chrome_dir = TEST_CONFIG["CHROMIUM"]
|
| os.makedirs(os.path.join(chrome_dir, "v8"))
|
|
|
| # Write fake deps file.
|
| @@ -919,7 +916,7 @@ def get_list():
|
|
|
| def testAutoPush(self):
|
| TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
|
| - TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist"
|
| + TEST_CONFIG["SETTINGS_LOCATION"] = "~/.doesnotexist"
|
|
|
| self.Expect([
|
| Cmd("git status -s -uno", ""),
|
| @@ -939,14 +936,15 @@ def get_list():
|
| auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"])
|
|
|
| state = json.loads(FileToText("%s-state.json"
|
| - % TEST_CONFIG[PERSISTFILE_BASENAME]))
|
| + % TEST_CONFIG["PERSISTFILE_BASENAME"]))
|
|
|
| self.assertEquals("100", state["lkgr"])
|
|
|
| def testAutoPushStoppedBySettings(self):
|
| TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
|
| - TEST_CONFIG[SETTINGS_LOCATION] = self.MakeEmptyTempFile()
|
| - TextToFile("{\"enable_auto_push\": false}", TEST_CONFIG[SETTINGS_LOCATION])
|
| + TEST_CONFIG["SETTINGS_LOCATION"] = self.MakeEmptyTempFile()
|
| + TextToFile("{\"enable_auto_push\": false}",
|
| + TEST_CONFIG["SETTINGS_LOCATION"])
|
|
|
| self.Expect([
|
| Cmd("git status -s -uno", ""),
|
| @@ -960,7 +958,7 @@ def get_list():
|
|
|
| def testAutoPushStoppedByTreeStatus(self):
|
| TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
|
| - TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist"
|
| + TEST_CONFIG["SETTINGS_LOCATION"] = "~/.doesnotexist"
|
|
|
| self.Expect([
|
| Cmd("git status -s -uno", ""),
|
| @@ -983,7 +981,7 @@ def get_list():
|
| ])
|
|
|
| result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
|
| - AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]])
|
| + AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]])
|
| self.assertEquals(0, result)
|
|
|
| # Snippet from the original DEPS file.
|
| @@ -999,8 +997,8 @@ deps = {
|
| """
|
|
|
| def testAutoRollUpToDate(self):
|
| - TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory()
|
| - TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS"))
|
| + TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory()
|
| + TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS"))
|
| self.Expect([
|
| URL("https://codereview.chromium.org/search",
|
| "owner=author%40chromium.org&limit=30&closed=3&format=json",
|
| @@ -1013,14 +1011,14 @@ deps = {
|
| ])
|
|
|
| result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
|
| - AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]])
|
| + AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]])
|
| self.assertEquals(0, result)
|
|
|
| def testAutoRoll(self):
|
| - TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory()
|
| - TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS"))
|
| - TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile()
|
| - TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE])
|
| + TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory()
|
| + TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS"))
|
| + TEST_CONFIG["CLUSTERFUZZ_API_KEY_FILE"] = self.MakeEmptyTempFile()
|
| + TextToFile("fake key", TEST_CONFIG["CLUSTERFUZZ_API_KEY_FILE"])
|
|
|
| self.Expect([
|
| URL("https://codereview.chromium.org/search",
|
| @@ -1034,11 +1032,11 @@ deps = {
|
| ])
|
|
|
| result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
|
| - AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM], "--roll"])
|
| + 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["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile()
|
| TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
|
| self.WriteFakeVersionFile(build=5)
|
| os.environ["EDITOR"] = "vi"
|
| @@ -1046,7 +1044,7 @@ deps = {
|
|
|
| def VerifyPatch(patch):
|
| return lambda: self.assertEquals(patch,
|
| - FileToText(TEST_CONFIG[TEMPORARY_PATCH_FILE]))
|
| + FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"]))
|
|
|
| msg = """Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789)
|
|
|
| @@ -1065,7 +1063,7 @@ LOG=N
|
| """
|
|
|
| def VerifySVNCommit():
|
| - commit = FileToText(TEST_CONFIG[COMMITMSG_FILE])
|
| + commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
|
| self.assertEquals(msg, commit)
|
| version = FileToText(
|
| os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE))
|
| @@ -1079,7 +1077,7 @@ LOG=N
|
| Cmd("git status -s -b -uno", "## some_branch\n"),
|
| Cmd("git svn fetch", ""),
|
| Cmd("git branch", " branch1\n* branch2\n"),
|
| - Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG["BRANCHNAME"], ""),
|
| Cmd(("git log --format=%H --grep=\"Port r12345\" "
|
| "--reverse svn/bleeding_edge"),
|
| "hash1\nhash2"),
|
| @@ -1117,31 +1115,31 @@ LOG=N
|
| Cmd("git log -1 hash5", "Revert \"Something\"\nBUG=none"),
|
| Cmd("git log -1 -p hash4", "patch4"),
|
| Cmd(("git apply --index --reject \"%s\"" %
|
| - TEST_CONFIG[TEMPORARY_PATCH_FILE]),
|
| + TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
|
| "", cb=VerifyPatch("patch4")),
|
| Cmd("git log -1 -p hash2", "patch2"),
|
| Cmd(("git apply --index --reject \"%s\"" %
|
| - TEST_CONFIG[TEMPORARY_PATCH_FILE]),
|
| + TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
|
| "", cb=VerifyPatch("patch2")),
|
| Cmd("git log -1 -p hash3", "patch3"),
|
| Cmd(("git apply --index --reject \"%s\"" %
|
| - TEST_CONFIG[TEMPORARY_PATCH_FILE]),
|
| + TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
|
| "", cb=VerifyPatch("patch3")),
|
| Cmd("git log -1 -p hash1", "patch1"),
|
| Cmd(("git apply --index --reject \"%s\"" %
|
| - TEST_CONFIG[TEMPORARY_PATCH_FILE]),
|
| + TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
|
| "", cb=VerifyPatch("patch1")),
|
| Cmd("git log -1 -p hash5", "patch5\n"),
|
| Cmd(("git apply --index --reject \"%s\"" %
|
| - TEST_CONFIG[TEMPORARY_PATCH_FILE]),
|
| + TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
|
| "", cb=VerifyPatch("patch5\n")),
|
| Cmd("git apply --index --reject \"%s\"" % extra_patch, ""),
|
| RL("Y"), # Automatically increment patch level?
|
| - Cmd("git commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], ""),
|
| + Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""),
|
| RL("reviewer@chromium.org"), # V8 reviewer.
|
| Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" "
|
| "--bypass-hooks", ""),
|
| - Cmd("git checkout -f %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| RL("LGTM"), # Enter LGTM for V8 CL.
|
| Cmd("git cl presubmit", "Presubmit successfull\n"),
|
| Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n",
|
| @@ -1154,7 +1152,7 @@ LOG=N
|
| "https://v8.googlecode.com/svn/tags/3.22.5.1 -m "
|
| "\"Tagging version 3.22.5.1\""), ""),
|
| Cmd("git checkout -f some_branch", ""),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| ])
|
|
|
| # r12345 and r34567 are patches. r23456 (included) and r45678 are the MIPS
|
| @@ -1222,8 +1220,8 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| csv_output = self.MakeEmptyTempFile()
|
| self.WriteFakeVersionFile()
|
|
|
| - TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory()
|
| - chrome_dir = TEST_CONFIG[CHROMIUM]
|
| + TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory()
|
| + chrome_dir = TEST_CONFIG["CHROMIUM"]
|
| chrome_v8_dir = os.path.join(chrome_dir, "v8")
|
| os.makedirs(chrome_v8_dir)
|
| def WriteDEPS(revision):
|
| @@ -1244,7 +1242,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| Cmd("git status -s -b -uno", "## some_branch\n"),
|
| Cmd("git svn fetch", ""),
|
| Cmd("git branch", " branch1\n* branch2\n"),
|
| - Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| Cmd("git branch -r", " svn/3.21\n svn/3.3\n"),
|
| Cmd("git reset --hard svn/3.3", ""),
|
| Cmd("git log --format=%H", "hash1\nhash2"),
|
| @@ -1293,7 +1291,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| Cmd("git status -s -uno", "", cwd=chrome_dir),
|
| Cmd("git checkout -f master", "", cwd=chrome_dir),
|
| Cmd("git pull", "", cwd=chrome_dir),
|
| - Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], "", cwd=chrome_dir),
|
| + Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir),
|
| Cmd("git fetch origin", "", cwd=chrome_v8_dir),
|
| Cmd("git log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\nc_hash3\n",
|
| cwd=chrome_dir),
|
| @@ -1321,12 +1319,12 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567),
|
| cwd=chrome_dir),
|
| Cmd("git checkout -f master", "", cwd=chrome_dir),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], "", cwd=chrome_dir),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir),
|
| Cmd("git checkout -f some_branch", ""),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| ])
|
|
|
| - args = ["-c", TEST_CONFIG[CHROMIUM],
|
| + args = ["-c", TEST_CONFIG["CHROMIUM"],
|
| "--json", json_output,
|
| "--csv", csv_output,
|
| "--max-releases", "1"]
|
| @@ -1417,17 +1415,18 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"])
|
|
|
| def testBumpUpVersionSvn(self):
|
| + svn_root = self.MakeEmptyTempDirectory()
|
| expectations = self._bumpUpVersion()
|
| expectations += [
|
| Cmd("git diff HEAD^ HEAD", "patch content"),
|
| - Cmd("svn update", "", cwd="[SVN_ROOT]"),
|
| - Cmd("svn status", "", cwd="[SVN_ROOT]"),
|
| + Cmd("svn update", "", cwd=svn_root),
|
| + Cmd("svn status", "", cwd=svn_root),
|
| Cmd("patch -d branches/bleeding_edge -p1 -i %s" %
|
| - TEST_CONFIG[PATCH_FILE], "Applied patch...", cwd="[SVN_ROOT]"),
|
| + TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root),
|
| Cmd("svn commit --non-interactive --username=author@chromium.org "
|
| "--config-dir=[CONFIG_DIR] "
|
| "-m \"[Auto-roll] Bump up version to 3.11.6.0\"",
|
| - "", cwd="[SVN_ROOT]"),
|
| + "", cwd=svn_root),
|
| Cmd("git checkout -f bleeding_edge", ""),
|
| Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"),
|
| Cmd("git branch -D auto-bump-up-version", ""),
|
| @@ -1436,7 +1435,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
|
|
| BumpUpVersion(TEST_CONFIG, self).Run(
|
| ["-a", "author@chromium.org",
|
| - "--svn", "[SVN_ROOT]",
|
| + "--svn", svn_root,
|
| "--svn-config", "[CONFIG_DIR]"])
|
|
|
| def testAutoTag(self):
|
| @@ -1454,7 +1453,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| Cmd("git branch", " branch1\n* branch2\n"),
|
| Cmd("git checkout -f master", ""),
|
| Cmd("git svn rebase", ""),
|
| - Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], "",
|
| + Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "",
|
| cb=ResetVersion(4, 5)),
|
| Cmd("git branch -r",
|
| "svn/tags/3.4.2\nsvn/tags/3.2.1.0\nsvn/branches/3.4"),
|
| @@ -1484,7 +1483,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
|
| Cmd("git reset --hard hash123", ""),
|
| Cmd("git svn tag 3.4.3 -m \"Tagging version 3.4.3\"", ""),
|
| Cmd("git checkout -f some_branch", ""),
|
| - Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""),
|
| + Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
|
| ])
|
|
|
| AutoTag(TEST_CONFIG, self).Run(["-a", "author@chromium.org"])
|
|
|