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

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

Issue 225283007: Automatically determine current V8 sheriff in chromium-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tools/push-to-trunk/common_includes.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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 762
763 def testPushToTrunkManual(self): 763 def testPushToTrunkManual(self):
764 self._PushToTrunk(manual=True) 764 self._PushToTrunk(manual=True)
765 765
766 def testPushToTrunkSemiAutomatic(self): 766 def testPushToTrunkSemiAutomatic(self):
767 self._PushToTrunk() 767 self._PushToTrunk()
768 768
769 def testPushToTrunkForced(self): 769 def testPushToTrunkForced(self):
770 self._PushToTrunk(force=True) 770 self._PushToTrunk(force=True)
771 771
772 def _ChromiumRoll(self, force=False, manual=False):
773 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME]
774 with open(googlers_mapping_py, "w") as f:
775 f.write("""
776 def list_to_dict(entries):
777 return {"g_name@google.com": "c_name@chromium.org"}
778 def get_list():
779 pass""")
772 780
773 def _ChromiumRoll(self, force=False, manual=False):
774 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() 781 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
775 if not os.path.exists(TEST_CONFIG[CHROMIUM]): 782 if not os.path.exists(TEST_CONFIG[CHROMIUM]):
776 os.makedirs(TEST_CONFIG[CHROMIUM]) 783 os.makedirs(TEST_CONFIG[CHROMIUM])
777 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", 784 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line",
778 TEST_CONFIG[DEPS_FILE]) 785 TEST_CONFIG[DEPS_FILE])
779 786
780 os.environ["EDITOR"] = "vi" 787 os.environ["EDITOR"] = "vi"
781 force_flag = " -f" if not manual else "" 788 force_flag = " -f" if not manual else ""
782 self.ExpectGit([ 789 self.ExpectGit([
783 Git("status -s -uno", ""), 790 Git("status -s -uno", ""),
784 Git("status -s -b -uno", "## some_branch\n"), 791 Git("status -s -b -uno", "## some_branch\n"),
785 Git("svn fetch", ""), 792 Git("svn fetch", ""),
786 Git(("log -1 --format=%H --grep=" 793 Git(("log -1 --format=%H --grep="
787 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " 794 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
788 "svn/trunk"), "push_hash\n"), 795 "svn/trunk"), "push_hash\n"),
789 Git("svn find-rev push_hash", "123455\n"), 796 Git("svn find-rev push_hash", "123455\n"),
790 Git("log -1 --format=%s push_hash", 797 Git("log -1 --format=%s push_hash",
791 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"), 798 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"),
792 Git("status -s -uno", ""), 799 Git("status -s -uno", ""),
793 Git("checkout -f master", ""), 800 Git("checkout -f master", ""),
794 Git("pull", ""), 801 Git("pull", ""),
795 Git("checkout -b v8-roll-123455", ""), 802 Git("checkout -b v8-roll-123455", ""),
796 Git(("commit -am \"Update V8 to version 3.22.5 " 803 Git(("commit -am \"Update V8 to version 3.22.5 "
797 "(based on bleeding_edge revision r123454).\n\n" 804 "(based on bleeding_edge revision r123454).\n\n"
798 "TBR=reviewer@chromium.org\""), 805 "Please reply to the V8 sheriff c_name@chromium.org in "
806 "case of problems.\n\nTBR=c_name@chromium.org\""),
799 ""), 807 ""),
800 Git(("cl upload --send-mail --email \"author@chromium.org\"%s" 808 Git(("cl upload --send-mail --email \"author@chromium.org\"%s"
801 % force_flag), ""), 809 % force_flag), ""),
802 ]) 810 ])
803 811
812 self.ExpectReadURL([
813 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js",
814 "document.write('g_name')"),
815 ])
816
804 # Expected keyboard input in manual mode: 817 # Expected keyboard input in manual mode:
805 if manual: 818 if manual:
806 self.ExpectReadline([ 819 self.ExpectReadline([
807 RL("reviewer@chromium.org"), # Chromium reviewer. 820 RL("c_name@chromium.org"), # Chromium reviewer.
808 ]) 821 ])
809 822
810 # Expected keyboard input in semi-automatic mode and forced mode: 823 # Expected keyboard input in semi-automatic mode and forced mode:
811 if not manual: 824 if not manual:
812 self.ExpectReadline([]) 825 self.ExpectReadline([])
813 826
814 args = ["-a", "author@chromium.org", "-c", TEST_CONFIG[CHROMIUM]] 827 args = ["-a", "author@chromium.org", "-c", TEST_CONFIG[CHROMIUM],
828 "--sheriff", "--googlers-mapping", googlers_mapping_py]
815 if force: args.append("-f") 829 if force: args.append("-f")
816 if manual: args.append("-m") 830 if manual: args.append("-m")
817 else: args += ["-r", "reviewer@chromium.org"] 831 else: args += ["-r", "reviewer@chromium.org"]
818 ChromiumRoll(TEST_CONFIG, self).Run(args) 832 ChromiumRoll(TEST_CONFIG, self).Run(args)
819 833
820 deps = FileToText(TEST_CONFIG[DEPS_FILE]) 834 deps = FileToText(TEST_CONFIG[DEPS_FILE])
821 self.assertTrue(re.search("\"v8_revision\": \"123455\"", deps)) 835 self.assertTrue(re.search("\"v8_revision\": \"123455\"", deps))
822 836
823 def testChromiumRollManual(self): 837 def testChromiumRollManual(self):
824 self._ChromiumRoll(manual=True) 838 self._ChromiumRoll(manual=True)
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 1131
1118 Review URL: https://codereview.chromium.org/83173002 1132 Review URL: https://codereview.chromium.org/83173002
1119 1133
1120 ------------------------------------------------------------------------""") 1134 ------------------------------------------------------------------------""")
1121 self.assertEquals( 1135 self.assertEquals(
1122 """Prepare push to trunk. Now working on version 3.23.11. 1136 """Prepare push to trunk. Now working on version 3.23.11.
1123 1137
1124 R=danno@chromium.org 1138 R=danno@chromium.org
1125 1139
1126 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1140 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698