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

Side by Side Diff: tools/push-to-trunk/test_scripts.py

Issue 870923003: Push version and changelog as a separate commit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 # The version file on bleeding edge has build level 5, while the version 712 # The version file on bleeding edge has build level 5, while the version
713 # file from trunk has build level 4. 713 # file from trunk has build level 4.
714 self.WriteFakeVersionFile(build=5) 714 self.WriteFakeVersionFile(build=5)
715 715
716 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() 716 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
717 bleeding_edge_change_log = "2014-03-17: Sentinel\n" 717 bleeding_edge_change_log = "2014-03-17: Sentinel\n"
718 TextToFile(bleeding_edge_change_log, 718 TextToFile(bleeding_edge_change_log,
719 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) 719 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
720 os.environ["EDITOR"] = "vi" 720 os.environ["EDITOR"] = "vi"
721 721
722 commit_msg_squashed = """Version 3.22.5 (squashed - based on push_hash)
723
724 Log text 1 (issue 321).
725
726 Performance and stability improvements on all platforms."""
727
728 commit_msg = """Version 3.22.5 (based on push_hash)
729
730 Log text 1 (issue 321).
731
732 Performance and stability improvements on all platforms."""
733
722 def ResetChangeLog(): 734 def ResetChangeLog():
723 """On 'git co -b new_branch svn/trunk', and 'git checkout -- ChangeLog', 735 """On 'git co -b new_branch svn/trunk', and 'git checkout -- ChangeLog',
724 the ChangLog will be reset to its content on trunk.""" 736 the ChangLog will be reset to its content on trunk."""
725 trunk_change_log = """1999-04-05: Version 3.22.4 737 trunk_change_log = """1999-04-05: Version 3.22.4
726 738
727 Performance and stability improvements on all platforms.\n""" 739 Performance and stability improvements on all platforms.\n"""
728 TextToFile(trunk_change_log, 740 TextToFile(trunk_change_log,
729 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) 741 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
730 742
731 def ResetToTrunk(): 743 def ResetToTrunk():
732 ResetChangeLog() 744 ResetChangeLog()
733 self.WriteFakeVersionFile() 745 self.WriteFakeVersionFile()
734 746
735 def CheckSVNCommit(): 747 def CheckVersionCommit():
736 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) 748 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
737 self.assertEquals( 749 self.assertEquals(commit_msg, commit)
738 """Version 3.22.5 (based on push_hash)
739
740 Log text 1 (issue 321).
741
742 Performance and stability improvements on all platforms.""", commit)
743 version = FileToText( 750 version = FileToText(
744 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) 751 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE))
745 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) 752 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version))
746 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) 753 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version))
747 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version)) 754 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version))
748 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version)) 755 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version))
749 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) 756 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
750 757
751 # Check that the change log on the trunk branch got correctly modified. 758 # Check that the change log on the trunk branch got correctly modified.
752 change_log = FileToText( 759 change_log = FileToText(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 if not force: 808 if not force:
802 expectations.append( 809 expectations.append(
803 Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "")) 810 Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], ""))
804 expectations += [ 811 expectations += [
805 Cmd("git fetch", ""), 812 Cmd("git fetch", ""),
806 Cmd("git checkout -f origin/master", ""), 813 Cmd("git checkout -f origin/master", ""),
807 Cmd("git diff origin/candidates push_hash", "patch content\n"), 814 Cmd("git diff origin/candidates push_hash", "patch content\n"),
808 Cmd(("git new-branch %s --upstream origin/candidates" % 815 Cmd(("git new-branch %s --upstream origin/candidates" %
809 TEST_CONFIG["TRUNKBRANCH"]), "", cb=ResetToTrunk), 816 TEST_CONFIG["TRUNKBRANCH"]), "", cb=ResetToTrunk),
810 Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG["PATCH_FILE"], ""), 817 Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG["PATCH_FILE"], ""),
818 Cmd("git commit -am \"%s\"" % commit_msg_squashed, ""),
819 ]
820 if manual:
821 expectations.append(RL("Y")) # Sanity check.
822 expectations += [
823 Cmd("git cl land -f --bypass-hooks", ""),
824 Cmd("git checkout -f master", ""),
825 Cmd("git fetch", ""),
826 Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""),
827 Cmd(("git new-branch %s --upstream origin/candidates" %
828 TEST_CONFIG["TRUNKBRANCH"]), "", cb=ResetToTrunk),
811 Cmd("git checkout -f origin/candidates -- ChangeLog", "", 829 Cmd("git checkout -f origin/candidates -- ChangeLog", "",
812 cb=ResetChangeLog), 830 cb=ResetChangeLog),
813 Cmd("git checkout -f origin/candidates -- src/version.cc", "", 831 Cmd("git checkout -f origin/candidates -- src/version.cc", "",
814 cb=self.WriteFakeVersionFile), 832 cb=self.WriteFakeVersionFile),
815 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", 833 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
816 cb=CheckSVNCommit), 834 cb=CheckVersionCommit),
817 ]
818 if manual:
819 expectations.append(RL("Y")) # Sanity check.
820 expectations += [
821 Cmd("git cl land -f --bypass-hooks", ""), 835 Cmd("git cl land -f --bypass-hooks", ""),
822 Cmd("git fetch", ""), 836 Cmd("git fetch", ""),
823 Cmd("git log -1 --format=%H --grep=" 837 Cmd("git log -1 --format=%H --grep="
824 "\"Version 3.22.5 (based on push_hash)\"" 838 "\"Version 3.22.5 (based on push_hash)\""
825 " origin/candidates", "hsh_to_tag"), 839 " origin/candidates", "hsh_to_tag"),
826 Cmd("git tag 3.22.5 hsh_to_tag", ""), 840 Cmd("git tag 3.22.5 hsh_to_tag", ""),
827 Cmd("git push origin 3.22.5", ""), 841 Cmd("git push origin 3.22.5", ""),
828 Cmd("git checkout -f some_branch", ""), 842 Cmd("git checkout -f some_branch", ""),
829 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), 843 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
830 Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""), 844 Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""),
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 1517
1504 Review URL: https://codereview.chromium.org/83173002 1518 Review URL: https://codereview.chromium.org/83173002
1505 1519
1506 ------------------------------------------------------------------------""") 1520 ------------------------------------------------------------------------""")
1507 self.assertEquals( 1521 self.assertEquals(
1508 """Prepare push to trunk. Now working on version 3.23.11. 1522 """Prepare push to trunk. Now working on version 3.23.11.
1509 1523
1510 R=danno@chromium.org 1524 R=danno@chromium.org
1511 1525
1512 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1526 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« no previous file with comments | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698