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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 | 799 |
800 def testPushToTrunkForced(self): | 800 def testPushToTrunkForced(self): |
801 self._PushToTrunk(force=True) | 801 self._PushToTrunk(force=True) |
802 | 802 |
803 C_V8_22624_LOG = """V8 CL. | 803 C_V8_22624_LOG = """V8 CL. |
804 | 804 |
805 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 | 805 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 |
806 | 806 |
807 """ | 807 """ |
808 | 808 |
| 809 C_V8_123455_LOG = """V8 CL. |
| 810 |
| 811 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 |
| 812 |
| 813 """ |
| 814 |
809 C_V8_123456_LOG = """V8 CL. | 815 C_V8_123456_LOG = """V8 CL. |
810 | 816 |
811 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 | 817 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 |
812 | 818 |
813 """ | 819 """ |
814 | 820 |
815 def testChromiumRoll(self): | 821 def testChromiumRoll(self): |
816 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME] | 822 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME] |
817 with open(googlers_mapping_py, "w") as f: | 823 with open(googlers_mapping_py, "w") as f: |
818 f.write(""" | 824 f.write(""" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 "{\"subject\": \"Update V8 to Version...\"}]}")), | 953 "{\"subject\": \"Update V8 to Version...\"}]}")), |
948 ]) | 954 ]) |
949 | 955 |
950 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 956 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
951 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) | 957 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) |
952 self.assertEquals(1, result) | 958 self.assertEquals(1, result) |
953 | 959 |
954 # Snippet from the original DEPS file. | 960 # Snippet from the original DEPS file. |
955 FAKE_DEPS = """ | 961 FAKE_DEPS = """ |
956 vars = { | 962 vars = { |
957 "v8_revision": "123455", | 963 "v8_revision": "abcd123455", |
958 } | 964 } |
959 deps = { | 965 deps = { |
960 "src/v8": | 966 "src/v8": |
961 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + | 967 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + |
962 Var("v8_revision"), | 968 Var("v8_revision"), |
963 } | 969 } |
964 """ | 970 """ |
965 | 971 |
966 def testAutoRollUpToDate(self): | 972 def testAutoRollUpToDate(self): |
| 973 os.makedirs(TEST_CONFIG[CHROMIUM]) |
| 974 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS")) |
967 self.Expect([ | 975 self.Expect([ |
968 URL("https://codereview.chromium.org/search", | 976 URL("https://codereview.chromium.org/search", |
969 "owner=author%40chromium.org&limit=30&closed=3&format=json", | 977 "owner=author%40chromium.org&limit=30&closed=3&format=json", |
970 ("{\"results\": [{\"subject\": \"different\"}]}")), | 978 ("{\"results\": [{\"subject\": \"different\"}]}")), |
971 Cmd(("git log -1 --format=%H --grep=" | 979 Cmd(("git log -1 --format=%H --grep=" |
972 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 980 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
973 "origin/master"), "push_hash\n"), | 981 "origin/master"), "push_hash\n"), |
974 Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG), | 982 Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG), |
975 URL("http://src.chromium.org/svn/trunk/src/DEPS", | 983 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), |
976 self.FAKE_DEPS), | |
977 ]) | 984 ]) |
978 | 985 |
979 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 986 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
980 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) | 987 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) |
981 self.assertEquals(1, result) | 988 self.assertEquals(1, result) |
982 | 989 |
983 def testAutoRoll(self): | 990 def testAutoRoll(self): |
| 991 os.makedirs(TEST_CONFIG[CHROMIUM]) |
| 992 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS")) |
984 TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile() | 993 TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile() |
985 TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE]) | 994 TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE]) |
986 | 995 |
987 self.Expect([ | 996 self.Expect([ |
988 URL("https://codereview.chromium.org/search", | 997 URL("https://codereview.chromium.org/search", |
989 "owner=author%40chromium.org&limit=30&closed=3&format=json", | 998 "owner=author%40chromium.org&limit=30&closed=3&format=json", |
990 ("{\"results\": [{\"subject\": \"different\"}]}")), | 999 ("{\"results\": [{\"subject\": \"different\"}]}")), |
991 Cmd(("git log -1 --format=%H --grep=" | 1000 Cmd(("git log -1 --format=%H --grep=" |
992 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 1001 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
993 "origin/master"), "push_hash\n"), | 1002 "origin/master"), "push_hash\n"), |
994 Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG), | 1003 Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG), |
995 URL("http://src.chromium.org/svn/trunk/src/DEPS", | 1004 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), |
996 self.FAKE_DEPS), | |
997 ]) | 1005 ]) |
998 | 1006 |
999 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 1007 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
1000 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM], "--roll"]) | 1008 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM], "--roll"]) |
1001 self.assertEquals(0, result) | 1009 self.assertEquals(0, result) |
1002 | 1010 |
1003 def testMergeToBranch(self): | 1011 def testMergeToBranch(self): |
1004 TEST_CONFIG[ALREADY_MERGING_SENTINEL_FILE] = self.MakeEmptyTempFile() | 1012 TEST_CONFIG[ALREADY_MERGING_SENTINEL_FILE] = self.MakeEmptyTempFile() |
1005 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() | 1013 TEST_CONFIG[DOT_GIT_LOCATION] = self.MakeEmptyTempFile() |
1006 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() | 1014 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 | 1485 |
1478 Review URL: https://codereview.chromium.org/83173002 | 1486 Review URL: https://codereview.chromium.org/83173002 |
1479 | 1487 |
1480 ------------------------------------------------------------------------""") | 1488 ------------------------------------------------------------------------""") |
1481 self.assertEquals( | 1489 self.assertEquals( |
1482 """Prepare push to trunk. Now working on version 3.23.11. | 1490 """Prepare push to trunk. Now working on version 3.23.11. |
1483 | 1491 |
1484 R=danno@chromium.org | 1492 R=danno@chromium.org |
1485 | 1493 |
1486 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1494 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |