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 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 "review_link": "", "date": "03:15", "chromium_branch": "", | 1363 "review_link": "", "date": "03:15", "chromium_branch": "", |
1364 "revision_link": "https://code.google.com/p/v8/source/detail?r=123"}, | 1364 "revision_link": "https://code.google.com/p/v8/source/detail?r=123"}, |
1365 {"patches_merged": "12", "bleeding_edge": "", "version": "3.3.1.1", | 1365 {"patches_merged": "12", "bleeding_edge": "", "version": "3.3.1.1", |
1366 "chromium_revision": "", "branch": "3.3", "revision": "234", | 1366 "chromium_revision": "", "branch": "3.3", "revision": "234", |
1367 "review_link": "fake.com", "date": "18:15", "chromium_branch": "", | 1367 "review_link": "fake.com", "date": "18:15", "chromium_branch": "", |
1368 "revision_link": "https://code.google.com/p/v8/source/detail?r=234"}, | 1368 "revision_link": "https://code.google.com/p/v8/source/detail?r=234"}, |
1369 ] | 1369 ] |
1370 self.assertEquals(expected_json, json.loads(FileToText(json_output))) | 1370 self.assertEquals(expected_json, json.loads(FileToText(json_output))) |
1371 | 1371 |
1372 | 1372 |
1373 def testBumpUpVersion(self): | 1373 def _bumpUpVersion(self): |
1374 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() | 1374 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() |
1375 self.WriteFakeVersionFile() | 1375 self.WriteFakeVersionFile() |
1376 | 1376 |
1377 def ResetVersion(minor, build, patch=0): | 1377 def ResetVersion(minor, build, patch=0): |
1378 return lambda: self.WriteFakeVersionFile(minor=minor, | 1378 return lambda: self.WriteFakeVersionFile(minor=minor, |
1379 build=build, | 1379 build=build, |
1380 patch=patch) | 1380 patch=patch) |
1381 | 1381 |
1382 self.Expect([ | 1382 return [ |
1383 Cmd("git status -s -uno", ""), | 1383 Cmd("git status -s -uno", ""), |
1384 Cmd("git checkout -f bleeding_edge", "", cb=ResetVersion(11, 4)), | 1384 Cmd("git checkout -f bleeding_edge", "", cb=ResetVersion(11, 4)), |
1385 Cmd("git pull", ""), | 1385 Cmd("git pull", ""), |
1386 Cmd("git branch", ""), | 1386 Cmd("git branch", ""), |
1387 Cmd("git checkout -f bleeding_edge", ""), | 1387 Cmd("git checkout -f bleeding_edge", ""), |
1388 Cmd("git log -1 --format=%H", "latest_hash"), | 1388 Cmd("git log -1 --format=%H", "latest_hash"), |
1389 Cmd("git diff --name-only latest_hash latest_hash^", ""), | 1389 Cmd("git diff --name-only latest_hash latest_hash^", ""), |
1390 URL("https://v8-status.appspot.com/lkgr", "12345"), | 1390 URL("https://v8-status.appspot.com/lkgr", "12345"), |
1391 Cmd("git checkout -f bleeding_edge", ""), | 1391 Cmd("git checkout -f bleeding_edge", ""), |
1392 Cmd(("git log --format=%H --grep=" | 1392 Cmd(("git log --format=%H --grep=" |
1393 "\"^git-svn-id: [^@]*@12345 [A-Za-z0-9-]*$\""), | 1393 "\"^git-svn-id: [^@]*@12345 [A-Za-z0-9-]*$\""), |
1394 "lkgr_hash"), | 1394 "lkgr_hash"), |
1395 Cmd("git checkout -b auto-bump-up-version lkgr_hash", ""), | 1395 Cmd("git checkout -b auto-bump-up-version lkgr_hash", ""), |
1396 Cmd("git checkout -f bleeding_edge", ""), | 1396 Cmd("git checkout -f bleeding_edge", ""), |
1397 Cmd("git branch", ""), | 1397 Cmd("git branch", ""), |
1398 Cmd("git diff --name-only lkgr_hash lkgr_hash^", ""), | 1398 Cmd("git diff --name-only lkgr_hash lkgr_hash^", ""), |
1399 Cmd("git checkout -f master", "", cb=ResetVersion(11, 5)), | 1399 Cmd("git checkout -f master", "", cb=ResetVersion(11, 5)), |
1400 Cmd("git pull", ""), | 1400 Cmd("git pull", ""), |
1401 URL("https://v8-status.appspot.com/current?format=json", | 1401 URL("https://v8-status.appspot.com/current?format=json", |
1402 "{\"message\": \"Tree is open\"}"), | 1402 "{\"message\": \"Tree is open\"}"), |
1403 Cmd("git checkout -b auto-bump-up-version bleeding_edge", "", | 1403 Cmd("git checkout -b auto-bump-up-version bleeding_edge", "", |
1404 cb=ResetVersion(11, 4)), | 1404 cb=ResetVersion(11, 4)), |
1405 Cmd("git commit -am \"[Auto-roll] Bump up version to 3.11.6.0\n\n" | 1405 Cmd("git commit -am \"[Auto-roll] Bump up version to 3.11.6.0\n\n" |
1406 "TBR=author@chromium.org\"", ""), | 1406 "TBR=author@chromium.org\" " |
| 1407 "--author \"author@chromium.org <author@chromium.org>\"", ""), |
| 1408 ] |
| 1409 |
| 1410 def testBumpUpVersionGit(self): |
| 1411 expectations = self._bumpUpVersion() |
| 1412 expectations += [ |
1407 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f " | 1413 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f " |
1408 "--bypass-hooks", ""), | 1414 "--bypass-hooks", ""), |
1409 Cmd("git cl dcommit -f --bypass-hooks", ""), | 1415 Cmd("git cl dcommit -f --bypass-hooks", ""), |
1410 Cmd("git checkout -f bleeding_edge", ""), | 1416 Cmd("git checkout -f bleeding_edge", ""), |
1411 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), | 1417 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), |
1412 Cmd("git branch -D auto-bump-up-version", ""), | 1418 Cmd("git branch -D auto-bump-up-version", ""), |
1413 ]) | 1419 ] |
| 1420 self.Expect(expectations) |
1414 | 1421 |
1415 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) | 1422 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) |
1416 | 1423 |
| 1424 def testBumpUpVersionSvn(self): |
| 1425 expectations = self._bumpUpVersion() |
| 1426 expectations += [ |
| 1427 Cmd("git diff HEAD^ HEAD", "patch content"), |
| 1428 Cmd("patch -d branches/bleeding_edge -p1 -i %s" % |
| 1429 TEST_CONFIG[PATCH_FILE], "Applied patch...", cwd="[SVN_ROOT]"), |
| 1430 Cmd("svn commit --non-interactive --username=author@chromium.org " |
| 1431 "--config-dir=[CONFIG_DIR] " |
| 1432 "-m \"[Auto-roll] Bump up version to 3.11.6.0\"", |
| 1433 "", cwd="[SVN_ROOT]"), |
| 1434 Cmd("git checkout -f bleeding_edge", ""), |
| 1435 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), |
| 1436 Cmd("git branch -D auto-bump-up-version", ""), |
| 1437 ] |
| 1438 self.Expect(expectations) |
| 1439 |
| 1440 BumpUpVersion(TEST_CONFIG, self).Run( |
| 1441 ["-a", "author@chromium.org", |
| 1442 "--svn", "[SVN_ROOT]", |
| 1443 "--svn-config", "[CONFIG_DIR]"]) |
| 1444 |
1417 def testAutoTag(self): | 1445 def testAutoTag(self): |
1418 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() | 1446 TEST_CONFIG[VERSION_FILE] = self.MakeEmptyTempFile() |
1419 self.WriteFakeVersionFile() | 1447 self.WriteFakeVersionFile() |
1420 | 1448 |
1421 def ResetVersion(minor, build, patch=0): | 1449 def ResetVersion(minor, build, patch=0): |
1422 return lambda: self.WriteFakeVersionFile(minor=minor, | 1450 return lambda: self.WriteFakeVersionFile(minor=minor, |
1423 build=build, | 1451 build=build, |
1424 patch=patch) | 1452 patch=patch) |
1425 | 1453 |
1426 self.Expect([ | 1454 self.Expect([ |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 | 1549 |
1522 Review URL: https://codereview.chromium.org/83173002 | 1550 Review URL: https://codereview.chromium.org/83173002 |
1523 | 1551 |
1524 ------------------------------------------------------------------------""") | 1552 ------------------------------------------------------------------------""") |
1525 self.assertEquals( | 1553 self.assertEquals( |
1526 """Prepare push to trunk. Now working on version 3.23.11. | 1554 """Prepare push to trunk. Now working on version 3.23.11. |
1527 | 1555 |
1528 R=danno@chromium.org | 1556 R=danno@chromium.org |
1529 | 1557 |
1530 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1558 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |