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

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

Issue 870903003: Refactor version increment in release scripts. (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
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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 TAGS = """ 616 TAGS = """
617 4425.0 617 4425.0
618 0.0.0.0 618 0.0.0.0
619 3.9.6 619 3.9.6
620 3.22.4 620 3.22.4
621 test_tag 621 test_tag
622 """ 622 """
623 623
624 # Version as tag: 3.22.4.0. Version on master: 3.22.6. 624 # Version as tag: 3.22.4.0. Version on master: 3.22.6.
625 # Make sure that the latest version is 3.22.6.0. 625 # Make sure that the latest version is 3.22.6.0.
626 def testGetLatestVersion(self): 626 def testIncrementVersion(self):
627 self.Expect([ 627 self.Expect([
628 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""),
628 Cmd("git tag", self.TAGS), 629 Cmd("git tag", self.TAGS),
629 Cmd("git checkout -f origin/master -- src/version.cc", 630 Cmd("git checkout -f origin/master -- src/version.cc",
630 "", cb=lambda: self.WriteFakeVersionFile(22, 6)), 631 "", cb=lambda: self.WriteFakeVersionFile(22, 6)),
631 ]) 632 ])
632 633
633 self.RunStep(PushToCandidates, GetLatestVersion) 634 self.RunStep(PushToCandidates, IncrementVersion)
634 635
635 self.assertEquals("3", self._state["latest_major"]) 636 self.assertEquals("3", self._state["new_major"])
636 self.assertEquals("22", self._state["latest_minor"]) 637 self.assertEquals("22", self._state["new_minor"])
637 self.assertEquals("6", self._state["latest_build"]) 638 self.assertEquals("7", self._state["new_build"])
638 self.assertEquals("0", self._state["latest_patch"]) 639 self.assertEquals("0", self._state["new_patch"])
639 640
640 def _TestSquashCommits(self, change_log, expected_msg): 641 def _TestSquashCommits(self, change_log, expected_msg):
641 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() 642 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile()
642 with open(TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "w") as f: 643 with open(TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "w") as f:
643 f.write(change_log) 644 f.write(change_log)
644 645
645 self.Expect([ 646 self.Expect([
646 Cmd("git diff origin/candidates hash1", "patch content"), 647 Cmd("git diff origin/candidates hash1", "patch content"),
647 ]) 648 ])
648 649
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 change_log) 772 change_log)
772 773
773 force_flag = " -f" if not manual else "" 774 force_flag = " -f" if not manual else ""
774 expectations = [] 775 expectations = []
775 if not force: 776 if not force:
776 expectations.append(Cmd("which vi", "/usr/bin/vi")) 777 expectations.append(Cmd("which vi", "/usr/bin/vi"))
777 expectations += [ 778 expectations += [
778 Cmd("git status -s -uno", ""), 779 Cmd("git status -s -uno", ""),
779 Cmd("git status -s -b -uno", "## some_branch\n"), 780 Cmd("git status -s -b -uno", "## some_branch\n"),
780 Cmd("git fetch", ""), 781 Cmd("git fetch", ""),
781 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""),
782 Cmd("git branch", " branch1\n* branch2\n"), 782 Cmd("git branch", " branch1\n* branch2\n"),
783 Cmd("git branch", " branch1\n* branch2\n"), 783 Cmd("git branch", " branch1\n* branch2\n"),
784 Cmd(("git new-branch %s --upstream origin/master" % 784 Cmd(("git new-branch %s --upstream origin/master" %
785 TEST_CONFIG["BRANCHNAME"]), 785 TEST_CONFIG["BRANCHNAME"]),
786 ""), 786 ""),
787 Cmd(("git log -1 --format=%H --grep=" 787 Cmd(("git log -1 --format=%H --grep="
788 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" " 788 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" "
789 "origin/candidates"), "hash2\n"), 789 "origin/candidates"), "hash2\n"),
790 Cmd("git log -1 hash2", "Log message\n"), 790 Cmd("git log -1 hash2", "Log message\n"),
791 ] 791 ]
792 if manual: 792 if manual:
793 expectations.append(RL("Y")) # Confirm last push. 793 expectations.append(RL("Y")) # Confirm last push.
794 expectations += [ 794 expectations += [
795 Cmd("git log -1 --format=%s hash2", 795 Cmd("git log -1 --format=%s hash2",
796 "Version 3.4.5 (based on abc3)\n"), 796 "Version 3.4.5 (based on abc3)\n"),
797 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""),
797 Cmd("git tag", self.TAGS), 798 Cmd("git tag", self.TAGS),
798 Cmd("git checkout -f origin/master -- src/version.cc", 799 Cmd("git checkout -f origin/master -- src/version.cc",
799 "", cb=self.WriteFakeVersionFile), 800 "", cb=self.WriteFakeVersionFile),
800 Cmd("git log --format=%H abc3..push_hash", "rev1\n"), 801 Cmd("git log --format=%H abc3..push_hash", "rev1\n"),
801 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), 802 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"),
802 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"), 803 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"),
803 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), 804 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"),
804 ] 805 ]
805 if manual: 806 if manual:
806 expectations.append(RL("")) # Open editor. 807 expectations.append(RL("")) # Open editor.
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 1392
1392 Review URL: https://codereview.chromium.org/83173002 1393 Review URL: https://codereview.chromium.org/83173002
1393 1394
1394 ------------------------------------------------------------------------""") 1395 ------------------------------------------------------------------------""")
1395 self.assertEquals( 1396 self.assertEquals(
1396 """Prepare push to trunk. Now working on version 3.23.11. 1397 """Prepare push to trunk. Now working on version 3.23.11.
1397 1398
1398 R=danno@chromium.org 1399 R=danno@chromium.org
1399 1400
1400 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1401 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« tools/release/common_includes.py ('K') | « tools/release/push_to_candidates.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698