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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 Git("pull", ""), | 1221 Git("pull", ""), |
1222 Git("checkout -b %s" % TEST_CONFIG[BRANCHNAME], ""), | 1222 Git("checkout -b %s" % TEST_CONFIG[BRANCHNAME], ""), |
1223 Git("log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\n"), | 1223 Git("log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\n"), |
1224 Git("diff --name-only c_hash1 c_hash1^", ""), | 1224 Git("diff --name-only c_hash1 c_hash1^", ""), |
1225 Git("diff --name-only c_hash2 c_hash2^", TEST_CONFIG[DEPS_FILE]), | 1225 Git("diff --name-only c_hash2 c_hash2^", TEST_CONFIG[DEPS_FILE]), |
1226 Git("checkout -f c_hash2 -- %s" % TEST_CONFIG[DEPS_FILE], "", | 1226 Git("checkout -f c_hash2 -- %s" % TEST_CONFIG[DEPS_FILE], "", |
1227 cb=ResetDEPS(345)), | 1227 cb=ResetDEPS(345)), |
1228 Git("svn find-rev c_hash2", "4567"), | 1228 Git("svn find-rev c_hash2", "4567"), |
1229 Git("checkout -f HEAD -- %s" % TEST_CONFIG[DEPS_FILE], "", | 1229 Git("checkout -f HEAD -- %s" % TEST_CONFIG[DEPS_FILE], "", |
1230 cb=ResetDEPS(567)), | 1230 cb=ResetDEPS(567)), |
| 1231 Git("branch -r", " weird/123\n branch-heads/7\n"), |
| 1232 Git("checkout -f branch-heads/7 -- %s" % TEST_CONFIG[DEPS_FILE], "", |
| 1233 cb=ResetDEPS(345)), |
| 1234 Git("checkout -f HEAD -- %s" % TEST_CONFIG[DEPS_FILE], "", |
| 1235 cb=ResetDEPS(567)), |
1231 Git("checkout -f master", ""), | 1236 Git("checkout -f master", ""), |
1232 Git("branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 1237 Git("branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), |
1233 Git("checkout -f some_branch", ""), | 1238 Git("checkout -f some_branch", ""), |
1234 Git("branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""), | 1239 Git("branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""), |
1235 Git("branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 1240 Git("branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), |
1236 ]) | 1241 ]) |
1237 | 1242 |
1238 args = ["-c", TEST_CONFIG[CHROMIUM], | 1243 args = ["-c", TEST_CONFIG[CHROMIUM], |
1239 "--json", json_output, | 1244 "--json", json_output, |
1240 "--csv", csv_output, | 1245 "--csv", csv_output, |
1241 "--max-releases", "1"] | 1246 "--max-releases", "1"] |
1242 Releases(TEST_CONFIG, self).Run(args) | 1247 Releases(TEST_CONFIG, self).Run(args) |
1243 | 1248 |
1244 # Check expected output. | 1249 # Check expected output. |
1245 csv = ("3.22.3,trunk,345,4567,\r\n" | 1250 csv = ("3.22.3,trunk,345,4567,\r\n" |
1246 "3.21.2,3.21,123,,\r\n" | 1251 "3.21.2,3.21,123,,\r\n" |
1247 "3.3.1.1,3.3,234,,12\r\n") | 1252 "3.3.1.1,3.3,234,,12\r\n") |
1248 self.assertEquals(csv, FileToText(csv_output)) | 1253 self.assertEquals(csv, FileToText(csv_output)) |
1249 | 1254 |
1250 expected_json = [ | 1255 expected_json = [ |
1251 {"bleeding_edge": "", "patches_merged": "", "version": "3.22.3", | 1256 {"bleeding_edge": "", "patches_merged": "", "version": "3.22.3", |
1252 "chromium_revision": "4567", "branch": "trunk", "revision": "345", | 1257 "chromium_revision": "4567", "branch": "trunk", "revision": "345", |
1253 "review_link": "", "date": "", | 1258 "review_link": "", "date": "", "chromium_branch": "7", |
1254 "revision_link": "https://code.google.com/p/v8/source/detail?r=345"}, | 1259 "revision_link": "https://code.google.com/p/v8/source/detail?r=345"}, |
1255 {"patches_merged": "", "bleeding_edge": "", "version": "3.21.2", | 1260 {"patches_merged": "", "bleeding_edge": "", "version": "3.21.2", |
1256 "chromium_revision": "", "branch": "3.21", "revision": "123", | 1261 "chromium_revision": "", "branch": "3.21", "revision": "123", |
1257 "review_link": "", "date": "03:15", | 1262 "review_link": "", "date": "03:15", "chromium_branch": "", |
1258 "revision_link": "https://code.google.com/p/v8/source/detail?r=123"}, | 1263 "revision_link": "https://code.google.com/p/v8/source/detail?r=123"}, |
1259 {"patches_merged": "12", "bleeding_edge": "", "version": "3.3.1.1", | 1264 {"patches_merged": "12", "bleeding_edge": "", "version": "3.3.1.1", |
1260 "chromium_revision": "", "branch": "3.3", "revision": "234", | 1265 "chromium_revision": "", "branch": "3.3", "revision": "234", |
1261 "review_link": "fake.com", "date": "18:15", | 1266 "review_link": "fake.com", "date": "18:15", "chromium_branch": "", |
1262 "revision_link": "https://code.google.com/p/v8/source/detail?r=234"}, | 1267 "revision_link": "https://code.google.com/p/v8/source/detail?r=234"}, |
1263 ] | 1268 ] |
1264 self.assertEquals(expected_json, json.loads(FileToText(json_output))) | 1269 self.assertEquals(expected_json, json.loads(FileToText(json_output))) |
1265 | 1270 |
1266 | 1271 |
1267 class SystemTest(unittest.TestCase): | 1272 class SystemTest(unittest.TestCase): |
1268 def testReload(self): | 1273 def testReload(self): |
1269 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, | 1274 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, |
1270 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) | 1275 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) |
1271 body = step.Reload( | 1276 body = step.Reload( |
1272 """------------------------------------------------------------------------ | 1277 """------------------------------------------------------------------------ |
1273 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines | 1278 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines |
1274 | 1279 |
1275 Prepare push to trunk. Now working on version 3.23.11. | 1280 Prepare push to trunk. Now working on version 3.23.11. |
1276 | 1281 |
1277 R=danno@chromium.org | 1282 R=danno@chromium.org |
1278 | 1283 |
1279 Review URL: https://codereview.chromium.org/83173002 | 1284 Review URL: https://codereview.chromium.org/83173002 |
1280 | 1285 |
1281 ------------------------------------------------------------------------""") | 1286 ------------------------------------------------------------------------""") |
1282 self.assertEquals( | 1287 self.assertEquals( |
1283 """Prepare push to trunk. Now working on version 3.23.11. | 1288 """Prepare push to trunk. Now working on version 3.23.11. |
1284 | 1289 |
1285 R=danno@chromium.org | 1290 R=danno@chromium.org |
1286 | 1291 |
1287 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1292 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |