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

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

Issue 504793002: Teach chromium_roll script to roll v8 git hashes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 def GitMock(self, cmd, args="", pipe=True): 363 def GitMock(self, cmd, args="", pipe=True):
364 print "%s %s" % (cmd, args) 364 print "%s %s" % (cmd, args)
365 return self._git_mock.Call("git", args) 365 return self._git_mock.Call("git", args)
366 366
367 def LogMock(self, cmd, args=""): 367 def LogMock(self, cmd, args=""):
368 print "Log: %s %s" % (cmd, args) 368 print "Log: %s %s" % (cmd, args)
369 369
370 MOCKS = { 370 MOCKS = {
371 "git": GitMock, 371 "git": GitMock,
372 "roll-dep": GitMock, # TODO(machenbach): Yet another hack. Unify all mocks.
372 # TODO(machenbach): Little hack to reuse the git mock for the one svn call 373 # TODO(machenbach): Little hack to reuse the git mock for the one svn call
373 # in merge-to-branch. The command should be made explicit in the test 374 # in merge-to-branch. The command should be made explicit in the test
374 # expectations. 375 # expectations.
375 "svn": GitMock, 376 "svn": GitMock,
376 "vi": LogMock, 377 "vi": LogMock,
377 } 378 }
378 379
379 def Call(self, fun, *args, **kwargs): 380 def Call(self, fun, *args, **kwargs):
380 print "Calling %s with %s and %s" % (str(fun), str(args), str(kwargs)) 381 print "Calling %s with %s and %s" % (str(fun), str(args), str(kwargs))
381 382
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 def list_to_dict(entries): 828 def list_to_dict(entries):
828 return {"g_name@google.com": "c_name@chromium.org"} 829 return {"g_name@google.com": "c_name@chromium.org"}
829 def get_list(): 830 def get_list():
830 pass""") 831 pass""")
831 832
832 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() 833 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile()
833 if not os.path.exists(TEST_CONFIG[CHROMIUM]): 834 if not os.path.exists(TEST_CONFIG[CHROMIUM]):
834 os.makedirs(TEST_CONFIG[CHROMIUM]) 835 os.makedirs(TEST_CONFIG[CHROMIUM])
835 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", 836 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line",
836 TEST_CONFIG[DEPS_FILE]) 837 TEST_CONFIG[DEPS_FILE])
838 def WriteDeps():
839 TextToFile("Some line\n \"v8_revision\": \"123455\",\n some line",
840 TEST_CONFIG[DEPS_FILE])
837 841
838 os.environ["EDITOR"] = "vi" 842 os.environ["EDITOR"] = "vi"
839 force_flag = " -f" if not manual else "" 843 force_flag = " -f" if not manual else ""
840 self.ExpectGit([ 844 self.ExpectGit([
841 Git("status -s -uno", ""), 845 Git("status -s -uno", ""),
842 Git("status -s -b -uno", "## some_branch\n"), 846 Git("status -s -b -uno", "## some_branch\n"),
843 Git("svn fetch", ""), 847 Git("svn fetch", ""),
844 Git(("log -1 --format=%H --grep=" 848 Git(("log -1 --format=%H --grep="
845 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " 849 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
846 "svn/trunk"), "push_hash\n"), 850 "svn/trunk"), "push_hash\n"),
847 Git("svn find-rev push_hash", "123455\n"), 851 Git("svn find-rev push_hash", "123455\n"),
848 Git("log -1 --format=%s push_hash", 852 Git("log -1 --format=%s push_hash",
849 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"), 853 "Version 3.22.5 (based on bleeding_edge revision r123454)\n"),
850 Git("status -s -uno", ""), 854 Git("status -s -uno", ""),
851 Git("checkout -f master", ""), 855 Git("checkout -f master", ""),
852 Git("pull", ""), 856 Git("pull", ""),
853 Git("checkout -b v8-roll-123455", ""), 857 Git("checkout -b v8-roll-123455", ""),
858 Git("v8 123455", "rolled", cb=WriteDeps),
854 Git(("commit -am \"Update V8 to version 3.22.5 " 859 Git(("commit -am \"Update V8 to version 3.22.5 "
855 "(based on bleeding_edge revision r123454).\n\n" 860 "(based on bleeding_edge revision r123454).\n\n"
856 "Please reply to the V8 sheriff c_name@chromium.org in " 861 "Please reply to the V8 sheriff c_name@chromium.org in "
857 "case of problems.\n\nTBR=c_name@chromium.org\""), 862 "case of problems.\n\nTBR=c_name@chromium.org\""),
858 ""), 863 ""),
859 Git(("cl upload --send-mail --email \"author@chromium.org\"%s" 864 Git(("cl upload --send-mail --email \"author@chromium.org\"%s"
860 % force_flag), ""), 865 % force_flag), ""),
861 ]) 866 ])
862 867
863 self.ExpectReadURL([ 868 self.ExpectReadURL([
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 1511
1507 Review URL: https://codereview.chromium.org/83173002 1512 Review URL: https://codereview.chromium.org/83173002
1508 1513
1509 ------------------------------------------------------------------------""") 1514 ------------------------------------------------------------------------""")
1510 self.assertEquals( 1515 self.assertEquals(
1511 """Prepare push to trunk. Now working on version 3.23.11. 1516 """Prepare push to trunk. Now working on version 3.23.11.
1512 1517
1513 R=danno@chromium.org 1518 R=danno@chromium.org
1514 1519
1515 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1520 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« tools/push-to-trunk/chromium_roll.py ('K') | « tools/push-to-trunk/chromium_roll.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698