| 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 Cmd("git log --format=%H abc3..abc123", "some_stuff\n"), | 1096 Cmd("git log --format=%H abc3..abc123", "some_stuff\n"), |
| 1097 ]) | 1097 ]) |
| 1098 | 1098 |
| 1099 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) | 1099 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) |
| 1100 | 1100 |
| 1101 state = json.loads(FileToText("%s-state.json" | 1101 state = json.loads(FileToText("%s-state.json" |
| 1102 % TEST_CONFIG["PERSISTFILE_BASENAME"])) | 1102 % TEST_CONFIG["PERSISTFILE_BASENAME"])) |
| 1103 | 1103 |
| 1104 self.assertEquals("abc123", state["candidate"]) | 1104 self.assertEquals("abc123", state["candidate"]) |
| 1105 | 1105 |
| 1106 def testAutoRollExistingRoll(self): | |
| 1107 self.Expect([ | |
| 1108 URL("https://codereview.chromium.org/search", | |
| 1109 "owner=author%40chromium.org&limit=30&closed=3&format=json", | |
| 1110 ("{\"results\": [{\"subject\": \"different\"}," | |
| 1111 "{\"subject\": \"Update V8 to Version...\"}]}")), | |
| 1112 ]) | |
| 1113 | |
| 1114 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | |
| 1115 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]]) | |
| 1116 self.assertEquals(0, result) | |
| 1117 | |
| 1118 # Snippet from the original DEPS file. | 1106 # Snippet from the original DEPS file. |
| 1119 FAKE_DEPS = """ | 1107 FAKE_DEPS = """ |
| 1120 vars = { | 1108 vars = { |
| 1121 "v8_revision": "abcd123455", | 1109 "v8_revision": "abcd123455", |
| 1122 } | 1110 } |
| 1123 deps = { | 1111 deps = { |
| 1124 "src/v8": | 1112 "src/v8": |
| 1125 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + | 1113 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + |
| 1126 Var("v8_revision"), | 1114 Var("v8_revision"), |
| 1127 } | 1115 } |
| 1128 """ | 1116 """ |
| 1129 | 1117 |
| 1130 def testAutoRollUpToDate(self): | 1118 def testAutoRollUpToDate(self): |
| 1131 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() | 1119 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 1132 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) | 1120 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) |
| 1133 self.Expect([ | 1121 self.Expect([ |
| 1134 URL("https://codereview.chromium.org/search", | |
| 1135 "owner=author%40chromium.org&limit=30&closed=3&format=json", | |
| 1136 ("{\"results\": [{\"subject\": \"different\"}]}")), | |
| 1137 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), | 1122 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), |
| 1138 Cmd("git rev-list --max-age=740800 --tags", | 1123 Cmd("git rev-list --max-age=740800 --tags", |
| 1139 "bad_tag\nhash_234\nhash_123"), | 1124 "bad_tag\nhash_234\nhash_123"), |
| 1140 Cmd("git describe --tags bad_tag", ""), | 1125 Cmd("git describe --tags bad_tag", ""), |
| 1141 Cmd("git describe --tags hash_234", "3.22.4"), | 1126 Cmd("git describe --tags hash_234", "3.22.4"), |
| 1142 Cmd("git describe --tags hash_123", "3.22.3"), | 1127 Cmd("git describe --tags hash_123", "3.22.3"), |
| 1143 Cmd("git describe --tags abcd123455", "3.22.4"), | 1128 Cmd("git describe --tags abcd123455", "3.22.4"), |
| 1144 Cmd("git describe --tags hash_234", "3.22.4"), | 1129 Cmd("git describe --tags hash_234", "3.22.4"), |
| 1145 Cmd("git describe --tags hash_123", "3.22.3"), | 1130 Cmd("git describe --tags hash_123", "3.22.3"), |
| 1146 ]) | 1131 ]) |
| 1147 | 1132 |
| 1148 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 1133 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
| 1149 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]]) | 1134 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]]) |
| 1150 self.assertEquals(0, result) | 1135 self.assertEquals(0, result) |
| 1151 | 1136 |
| 1152 def testAutoRoll(self): | 1137 def testAutoRoll(self): |
| 1153 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() | 1138 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 1154 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) | 1139 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) |
| 1155 | 1140 |
| 1156 self.Expect([ | 1141 self.Expect([ |
| 1157 URL("https://codereview.chromium.org/search", | |
| 1158 "owner=author%40chromium.org&limit=30&closed=3&format=json", | |
| 1159 ("{\"results\": [{\"subject\": \"different\"}]}")), | |
| 1160 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), | 1142 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), |
| 1161 Cmd("git rev-list --max-age=740800 --tags", | 1143 Cmd("git rev-list --max-age=740800 --tags", |
| 1162 "bad_tag\nhash_234\nhash_123"), | 1144 "bad_tag\nhash_234\nhash_123"), |
| 1163 Cmd("git describe --tags bad_tag", ""), | 1145 Cmd("git describe --tags bad_tag", ""), |
| 1164 Cmd("git describe --tags hash_234", "3.22.4"), | 1146 Cmd("git describe --tags hash_234", "3.22.4"), |
| 1165 Cmd("git describe --tags hash_123", "3.22.3"), | 1147 Cmd("git describe --tags hash_123", "3.22.3"), |
| 1166 Cmd("git describe --tags abcd123455", "3.22.3.1"), | 1148 Cmd("git describe --tags abcd123455", "3.22.3.1"), |
| 1167 Cmd("git describe --tags hash_234", "3.22.4"), | 1149 Cmd("git describe --tags hash_234", "3.22.4"), |
| 1168 ]) | 1150 ]) |
| 1169 | 1151 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 | 1553 |
| 1572 Review URL: https://codereview.chromium.org/83173002 | 1554 Review URL: https://codereview.chromium.org/83173002 |
| 1573 | 1555 |
| 1574 ------------------------------------------------------------------------""") | 1556 ------------------------------------------------------------------------""") |
| 1575 self.assertEquals( | 1557 self.assertEquals( |
| 1576 """Prepare push to trunk. Now working on version 3.23.11. | 1558 """Prepare push to trunk. Now working on version 3.23.11. |
| 1577 | 1559 |
| 1578 R=danno@chromium.org | 1560 R=danno@chromium.org |
| 1579 | 1561 |
| 1580 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1562 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
| OLD | NEW |