OLD | NEW |
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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 793 |
794 def testPushToTrunkManual(self): | 794 def testPushToTrunkManual(self): |
795 self._PushToTrunk(manual=True) | 795 self._PushToTrunk(manual=True) |
796 | 796 |
797 def testPushToTrunkSemiAutomatic(self): | 797 def testPushToTrunkSemiAutomatic(self): |
798 self._PushToTrunk() | 798 self._PushToTrunk() |
799 | 799 |
800 def testPushToTrunkForced(self): | 800 def testPushToTrunkForced(self): |
801 self._PushToTrunk(force=True) | 801 self._PushToTrunk(force=True) |
802 | 802 |
803 def _ChromiumRoll(self, force=False, manual=False): | 803 def testChromiumRoll(self): |
804 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME] | 804 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME] |
805 with open(googlers_mapping_py, "w") as f: | 805 with open(googlers_mapping_py, "w") as f: |
806 f.write(""" | 806 f.write(""" |
807 def list_to_dict(entries): | 807 def list_to_dict(entries): |
808 return {"g_name@google.com": "c_name@chromium.org"} | 808 return {"g_name@google.com": "c_name@chromium.org"} |
809 def get_list(): | 809 def get_list(): |
810 pass""") | 810 pass""") |
811 | 811 |
812 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() | 812 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() |
813 if not os.path.exists(TEST_CONFIG[CHROMIUM]): | 813 if not os.path.exists(TEST_CONFIG[CHROMIUM]): |
814 os.makedirs(TEST_CONFIG[CHROMIUM]) | 814 os.makedirs(TEST_CONFIG[CHROMIUM]) |
815 if not os.path.exists(os.path.join(TEST_CONFIG[CHROMIUM], "v8")): | 815 if not os.path.exists(os.path.join(TEST_CONFIG[CHROMIUM], "v8")): |
816 os.makedirs(os.path.join(TEST_CONFIG[CHROMIUM], "v8")) | 816 os.makedirs(os.path.join(TEST_CONFIG[CHROMIUM], "v8")) |
817 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", | 817 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", |
818 TEST_CONFIG[DEPS_FILE]) | 818 TEST_CONFIG[DEPS_FILE]) |
819 def WriteDeps(): | 819 def WriteDeps(): |
820 TextToFile("Some line\n \"v8_revision\": \"123455\",\n some line", | 820 TextToFile("Some line\n \"v8_revision\": \"123455\",\n some line", |
821 TEST_CONFIG[DEPS_FILE]) | 821 TEST_CONFIG[DEPS_FILE]) |
822 | 822 |
823 os.environ["EDITOR"] = "vi" | |
824 force_flag = " -f" if not manual else "" | |
825 expectations = [ | 823 expectations = [ |
826 Cmd("git status -s -uno", ""), | 824 Cmd("git status -s -uno", ""), |
827 Cmd("git status -s -b -uno", "## some_branch\n"), | 825 Cmd("git status -s -b -uno", "## some_branch\n"), |
828 Cmd("git svn fetch", ""), | 826 Cmd("git svn fetch", ""), |
829 Cmd(("git log -1 --format=%H --grep=" | 827 Cmd(("git log -1 --format=%H --grep=" |
830 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 828 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
831 "svn/trunk"), "push_hash\n"), | 829 "svn/trunk"), "push_hash\n"), |
832 Cmd("git svn find-rev push_hash", "123455\n"), | 830 Cmd("git svn find-rev push_hash", "123455\n"), |
833 Cmd("git log -1 --format=%s push_hash", | 831 Cmd("git log -1 --format=%s push_hash", |
834 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"), | 832 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"), |
835 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", | 833 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", |
836 "document.write('g_name')"), | 834 "document.write('g_name')"), |
837 Cmd("git status -s -uno", ""), | 835 Cmd("git status -s -uno", ""), |
838 Cmd("git checkout -f master", ""), | 836 Cmd("git checkout -f master", ""), |
839 Cmd("gclient sync --nohooks", "syncing..."), | 837 Cmd("gclient sync --nohooks", "syncing..."), |
840 Cmd("git pull", ""), | 838 Cmd("git pull", ""), |
841 Cmd("git fetch origin", ""), | 839 Cmd("git fetch origin", ""), |
842 Cmd("git checkout -b v8-roll-123455", ""), | 840 Cmd("git checkout -b v8-roll-123455", ""), |
843 Cmd("roll-dep v8 123455", "rolled", cb=WriteDeps), | 841 Cmd("roll-dep v8 123455", "rolled", cb=WriteDeps), |
844 ] | |
845 if manual: | |
846 expectations.append(RL("c_name@chromium.org")) # Chromium reviewer. | |
847 expectations += [ | |
848 Cmd(("git commit -am \"Update V8 to version 3.22.5 " | 842 Cmd(("git commit -am \"Update V8 to version 3.22.5 " |
849 "(based on bleeding_edge revision r123454).\n\n" | 843 "(based on bleeding_edge revision r123454).\n\n" |
850 "Please reply to the V8 sheriff c_name@chromium.org in " | 844 "Please reply to the V8 sheriff c_name@chromium.org in " |
851 "case of problems.\n\nTBR=c_name@chromium.org\""), | 845 "case of problems.\n\nTBR=c_name@chromium.org\""), |
852 ""), | 846 ""), |
853 Cmd(("git cl upload --send-mail --email \"author@chromium.org\"%s" | 847 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f", ""), |
854 % force_flag), ""), | |
855 ] | 848 ] |
856 self.Expect(expectations) | 849 self.Expect(expectations) |
857 | 850 |
858 args = ["-a", "author@chromium.org", "-c", TEST_CONFIG[CHROMIUM], | 851 args = ["-a", "author@chromium.org", "-c", TEST_CONFIG[CHROMIUM], |
859 "--sheriff", "--googlers-mapping", googlers_mapping_py] | 852 "--sheriff", "--googlers-mapping", googlers_mapping_py, |
860 if force: args.append("-f") | 853 "-r", "reviewer@chromium.org"] |
861 if manual: args.append("-m") | |
862 else: args += ["-r", "reviewer@chromium.org"] | |
863 ChromiumRoll(TEST_CONFIG, self).Run(args) | 854 ChromiumRoll(TEST_CONFIG, self).Run(args) |
864 | 855 |
865 deps = FileToText(TEST_CONFIG[DEPS_FILE]) | 856 deps = FileToText(TEST_CONFIG[DEPS_FILE]) |
866 self.assertTrue(re.search("\"v8_revision\": \"123455\"", deps)) | 857 self.assertTrue(re.search("\"v8_revision\": \"123455\"", deps)) |
867 | 858 |
868 def testChromiumRollManual(self): | |
869 self._ChromiumRoll(manual=True) | |
870 | |
871 def testChromiumRollSemiAutomatic(self): | |
872 self._ChromiumRoll() | |
873 | |
874 def testChromiumRollForced(self): | |
875 self._ChromiumRoll(force=True) | |
876 | |
877 def testCheckLastPushRecently(self): | 859 def testCheckLastPushRecently(self): |
878 self.Expect([ | 860 self.Expect([ |
879 Cmd(("git log -1 --format=%H --grep=" | 861 Cmd(("git log -1 --format=%H --grep=" |
880 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" " | 862 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" " |
881 "svn/trunk"), "hash2\n"), | 863 "svn/trunk"), "hash2\n"), |
882 Cmd("git log -1 --format=%s hash2", | 864 Cmd("git log -1 --format=%s hash2", |
883 "Version 3.4.5 (based on bleeding_edge revision r99)\n"), | 865 "Version 3.4.5 (based on bleeding_edge revision r99)\n"), |
884 ]) | 866 ]) |
885 | 867 |
886 self._state["lkgr"] = "101" | 868 self._state["lkgr"] = "101" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 | 1471 |
1490 Review URL: https://codereview.chromium.org/83173002 | 1472 Review URL: https://codereview.chromium.org/83173002 |
1491 | 1473 |
1492 ------------------------------------------------------------------------""") | 1474 ------------------------------------------------------------------------""") |
1493 self.assertEquals( | 1475 self.assertEquals( |
1494 """Prepare push to trunk. Now working on version 3.23.11. | 1476 """Prepare push to trunk. Now working on version 3.23.11. |
1495 | 1477 |
1496 R=danno@chromium.org | 1478 R=danno@chromium.org |
1497 | 1479 |
1498 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1480 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |