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

Side by Side Diff: tools/release/test_scripts.py

Issue 881683004: Add new script to create release branches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
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 19 matching lines...) Expand all
30 import shutil 30 import shutil
31 import tempfile 31 import tempfile
32 import traceback 32 import traceback
33 import unittest 33 import unittest
34 34
35 import auto_push 35 import auto_push
36 from auto_push import LastReleaseBailout 36 from auto_push import LastReleaseBailout
37 import auto_roll 37 import auto_roll
38 import common_includes 38 import common_includes
39 from common_includes import * 39 from common_includes import *
40 import create_release
41 from create_release import CreateRelease
40 import merge_to_branch 42 import merge_to_branch
41 from merge_to_branch import * 43 from merge_to_branch import *
42 import push_to_candidates 44 import push_to_candidates
43 from push_to_candidates import * 45 from push_to_candidates import *
44 import chromium_roll 46 import chromium_roll
45 from chromium_roll import ChromiumRoll 47 from chromium_roll import ChromiumRoll
46 import releases 48 import releases
47 from releases import Releases 49 from releases import Releases
48 from auto_tag import AutoTag 50 from auto_tag import AutoTag
49 51
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 855
854 def testPushToCandidatesManual(self): 856 def testPushToCandidatesManual(self):
855 self._PushToCandidates(manual=True) 857 self._PushToCandidates(manual=True)
856 858
857 def testPushToCandidatesSemiAutomatic(self): 859 def testPushToCandidatesSemiAutomatic(self):
858 self._PushToCandidates() 860 self._PushToCandidates()
859 861
860 def testPushToCandidatesForced(self): 862 def testPushToCandidatesForced(self):
861 self._PushToCandidates(force=True) 863 self._PushToCandidates(force=True)
862 864
865 def testCreateRelease(self):
866 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
867
868 # The version file on master has build level 5.
869 self.WriteFakeVersionFile(build=5)
870
871 master_change_log = "2014-03-17: Sentinel\n"
872 TextToFile(master_change_log,
873 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
874
875 commit_msg = """Version 3.22.5
876
877 Log text 1 (issue 321).
878
879 Performance and stability improvements on all platforms."""
880
881 def ResetChangeLog():
882 last_change_log = """1999-04-05: Version 3.22.4
883
884 Performance and stability improvements on all platforms.\n"""
885 TextToFile(last_change_log,
886 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
887
888
889 def CheckVersionCommit():
890 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
891 self.assertEquals(commit_msg, commit)
892 version = FileToText(
893 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE))
894 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version))
895 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version))
896 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version))
897 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version))
898 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
899
900 # Check that the change log on the candidates branch got correctly
901 # modified.
902 change_log = FileToText(
903 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
904 self.assertEquals(
905 """1999-07-31: Version 3.22.5
906
907 Log text 1 (issue 321).
908
909 Performance and stability improvements on all platforms.
910
911
912 1999-04-05: Version 3.22.4
913
914 Performance and stability improvements on all platforms.\n""",
915 change_log)
916
917 expectations = [
918 Cmd("git fetch origin +refs/heads/*:refs/heads/*", ""),
919 Cmd("git fetch origin +refs/branch-heads/*:refs/branch-heads/*", ""),
920 Cmd("git fetch origin +refs/pending/*:refs/pending/*", ""),
921 Cmd("git fetch origin +refs/pending-tags/*:refs/pending-tags/*", ""),
922 Cmd("git checkout -f origin/master", ""),
923 Cmd("git branch", ""),
924 Cmd("git log -1 --format=\"%H %T\" push_hash", "push_hash tree_hash"),
925 Cmd("git log -200 --format=\"%H %T\" refs/pending/heads/master",
926 "not_right wrong\npending_hash tree_hash\nsome other\n"),
927 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""),
928 Cmd("git tag", self.TAGS),
929 Cmd("git checkout -f origin/master -- src/version.cc",
930 "", cb=self.WriteFakeVersionFile),
931 Cmd("git log -1 --format=%H 3.22.4", "release_hash\n"),
932 Cmd("git log -1 --format=%s release_hash",
933 "Version 3.22.4 (based on abc3)\n"),
934 Cmd("git log --format=%H abc3..push_hash", "rev1\n"),
935 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"),
936 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"),
937 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"),
938 Cmd("git reset --hard origin/master", ""),
939 Cmd("git checkout -b work-branch pending_hash", ""),
940 Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog),
941 Cmd("git checkout -f 3.22.4 -- src/version.cc", "",
942 cb=self.WriteFakeVersionFile),
943 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
944 cb=CheckVersionCommit),
945 Cmd("git push origin "
946 "refs/heads/work-branch:refs/pending/branch-heads/3.22.5 "
947 "pending_hash:refs/pending-tags/branch-heads/3.22.5 "
948 "push_hash:refs/branch-heads/3.22.5", ""),
949 Cmd("git fetch", ""),
950 Cmd("git log -1 --format=%H --grep="
951 "\"Version 3.22.5\" branch-heads/3.22.5", "hsh_to_tag"),
952 Cmd("git tag 3.22.5 hsh_to_tag", ""),
953 Cmd("git push origin 3.22.5", ""),
954 Cmd("git checkout -f origin/master", ""),
955 Cmd("git branch", "* master\n work-branch\n"),
956 Cmd("git branch -D work-branch", ""),
957 ]
958 self.Expect(expectations)
959
960 args = ["-a", "author@chromium.org",
961 "-r", "reviewer@chromium.org",
962 "--revision", "push_hash"]
963 CreateRelease(TEST_CONFIG, self).Run(args)
964
965 cl = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE))
966 self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl))
967 self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl))
968 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl))
969
970 # Note: The version file is on build number 5 again in the end of this test
971 # since the git command that merges to master is mocked out.
972
863 C_V8_22624_LOG = """V8 CL. 973 C_V8_22624_LOG = """V8 CL.
864 974
865 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 975 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123
866 976
867 """ 977 """
868 978
869 C_V8_123455_LOG = """V8 CL. 979 C_V8_123455_LOG = """V8 CL.
870 980
871 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 981 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123
872 982
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 1493
1384 Review URL: https://codereview.chromium.org/83173002 1494 Review URL: https://codereview.chromium.org/83173002
1385 1495
1386 ------------------------------------------------------------------------""") 1496 ------------------------------------------------------------------------""")
1387 self.assertEquals( 1497 self.assertEquals(
1388 """Prepare push to trunk. Now working on version 3.23.11. 1498 """Prepare push to trunk. Now working on version 3.23.11.
1389 1499
1390 R=danno@chromium.org 1500 R=danno@chromium.org
1391 1501
1392 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1502 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« tools/release/create_release.py ('K') | « tools/release/create_release.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698