| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 import os | 29 import os |
| 30 import tempfile | 30 import tempfile |
| 31 import unittest | 31 import unittest |
| 32 | 32 |
| 33 import common_includes | 33 import common_includes |
| 34 from common_includes import * | 34 from common_includes import * |
| 35 import push_to_trunk | 35 import push_to_trunk |
| 36 from push_to_trunk import * | 36 from push_to_trunk import * |
| 37 import auto_roll | 37 import auto_roll |
| 38 from auto_roll import FetchLatestRevision |
| 39 from auto_roll import CheckLastPush |
| 38 | 40 |
| 39 | 41 |
| 40 TEST_CONFIG = { | 42 TEST_CONFIG = { |
| 41 BRANCHNAME: "test-prepare-push", | 43 BRANCHNAME: "test-prepare-push", |
| 42 TRUNKBRANCH: "test-trunk-push", | 44 TRUNKBRANCH: "test-trunk-push", |
| 43 PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile", | 45 PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile", |
| 44 TEMP_BRANCH: "test-prepare-push-temporary-branch-created-by-script", | 46 TEMP_BRANCH: "test-prepare-push-temporary-branch-created-by-script", |
| 45 DOT_GIT_LOCATION: None, | 47 DOT_GIT_LOCATION: None, |
| 46 VERSION_FILE: None, | 48 VERSION_FILE: None, |
| 47 CHANGELOG_FILE: None, | 49 CHANGELOG_FILE: None, |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 704 |
| 703 def testPushToTrunkManual(self): | 705 def testPushToTrunkManual(self): |
| 704 self._PushToTrunk(manual=True) | 706 self._PushToTrunk(manual=True) |
| 705 | 707 |
| 706 def testPushToTrunkSemiAutomatic(self): | 708 def testPushToTrunkSemiAutomatic(self): |
| 707 self._PushToTrunk() | 709 self._PushToTrunk() |
| 708 | 710 |
| 709 def testPushToTrunkForced(self): | 711 def testPushToTrunkForced(self): |
| 710 self._PushToTrunk(force=True) | 712 self._PushToTrunk(force=True) |
| 711 | 713 |
| 714 def testCheckLastPushRecently(self): |
| 715 self.ExpectGit([ |
| 716 ["svn log -1 --oneline", "r101 | Text"], |
| 717 ["svn log -1 --oneline ChangeLog", "r99 | Prepare push to trunk..."], |
| 718 ]) |
| 719 |
| 720 state = {} |
| 721 self.MakeStep(FetchLatestRevision, state=state).Run() |
| 722 self.assertRaises(Exception, self.MakeStep(CheckLastPush, state=state).Run) |
| 723 |
| 712 def testAutoRoll(self): | 724 def testAutoRoll(self): |
| 713 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() | 725 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() |
| 714 | 726 |
| 715 self.ExpectReadURL([ | 727 self.ExpectReadURL([ |
| 716 ["https://v8-status.appspot.com/lkgr", Exception("Network problem")], | 728 ["https://v8-status.appspot.com/lkgr", Exception("Network problem")], |
| 717 ["https://v8-status.appspot.com/lkgr", "100"], | 729 ["https://v8-status.appspot.com/lkgr", "100"], |
| 718 ]) | 730 ]) |
| 719 | 731 |
| 720 self.ExpectGit([ | 732 self.ExpectGit([ |
| 721 ["status -s -uno", ""], | 733 ["status -s -uno", ""], |
| 722 ["status -s -b -uno", "## some_branch\n"], | 734 ["status -s -b -uno", "## some_branch\n"], |
| 723 ["svn fetch", ""], | 735 ["svn fetch", ""], |
| 724 ["svn log -1 --oneline", "r101 | Text"], | 736 ["svn log -1 --oneline", "r101 | Text"], |
| 737 ["svn log -1 --oneline ChangeLog", "r65 | Prepare push to trunk..."], |
| 725 ]) | 738 ]) |
| 726 | 739 |
| 727 auto_roll.RunAutoRoll(TEST_CONFIG, MakeOptions(m=False, f=True), self) | 740 auto_roll.RunAutoRoll(TEST_CONFIG, MakeOptions(m=False, f=True), self) |
| 728 | 741 |
| 729 self.assertEquals("100", self.MakeStep().Restore("lkgr")) | 742 self.assertEquals("100", self.MakeStep().Restore("lkgr")) |
| 730 self.assertEquals("101", self.MakeStep().Restore("latest")) | 743 self.assertEquals("101", self.MakeStep().Restore("latest")) |
| 731 | 744 |
| 732 | 745 |
| 733 class SystemTest(unittest.TestCase): | 746 class SystemTest(unittest.TestCase): |
| 734 def testReload(self): | 747 def testReload(self): |
| (...skipping 10 matching lines...) Expand all Loading... |
| 745 | 758 |
| 746 Review URL: https://codereview.chromium.org/83173002 | 759 Review URL: https://codereview.chromium.org/83173002 |
| 747 | 760 |
| 748 ------------------------------------------------------------------------""") | 761 ------------------------------------------------------------------------""") |
| 749 self.assertEquals( | 762 self.assertEquals( |
| 750 """Prepare push to trunk. Now working on version 3.23.11. | 763 """Prepare push to trunk. Now working on version 3.23.11. |
| 751 | 764 |
| 752 R=danno@chromium.org | 765 R=danno@chromium.org |
| 753 | 766 |
| 754 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 767 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
| OLD | NEW |