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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 commit = FileToText(TEST_CONFIG[COMMITMSG_FILE]) | 454 commit = FileToText(TEST_CONFIG[COMMITMSG_FILE]) |
455 self.assertTrue(re.search(r"Version 3.22.5", commit)) | 455 self.assertTrue(re.search(r"Version 3.22.5", commit)) |
456 self.assertTrue(re.search(r"Log text 1. \(issue 321\)", commit)) | 456 self.assertTrue(re.search(r"Log text 1. \(issue 321\)", commit)) |
457 version = FileToText(TEST_CONFIG[VERSION_FILE]) | 457 version = FileToText(TEST_CONFIG[VERSION_FILE]) |
458 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) | 458 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) |
459 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) | 459 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) |
460 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version)) | 460 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version)) |
461 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version)) | 461 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version)) |
462 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) | 462 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) |
463 | 463 |
| 464 force_flag = " -f" if force else "" |
464 self._git_recipe = [ | 465 self._git_recipe = [ |
465 ["status -s -uno", ""], | 466 ["status -s -uno", ""], |
466 ["status -s -b -uno", "## some_branch\n"], | 467 ["status -s -b -uno", "## some_branch\n"], |
467 ["svn fetch", ""], | 468 ["svn fetch", ""], |
468 ["branch", " branch1\n* branch2\n"], | 469 ["branch", " branch1\n* branch2\n"], |
469 ["checkout -b %s" % TEST_CONFIG[TEMP_BRANCH], ""], | 470 ["checkout -b %s" % TEST_CONFIG[TEMP_BRANCH], ""], |
470 ["branch", " branch1\n* branch2\n"], | 471 ["branch", " branch1\n* branch2\n"], |
471 ["branch", " branch1\n* branch2\n"], | 472 ["branch", " branch1\n* branch2\n"], |
472 ["checkout -b %s svn/bleeding_edge" % TEST_CONFIG[BRANCHNAME], ""], | 473 ["checkout -b %s svn/bleeding_edge" % TEST_CONFIG[BRANCHNAME], ""], |
473 ["log -1 --format=%H ChangeLog", "1234\n"], | 474 ["log -1 --format=%H ChangeLog", "1234\n"], |
474 ["log -1 1234", "Last push ouput\n"], | 475 ["log -1 1234", "Last push ouput\n"], |
475 ["log 1234..HEAD --format=%H", "rev1\n"], | 476 ["log 1234..HEAD --format=%H", "rev1\n"], |
476 ["log -1 rev1 --format=\"%w(80,8,8)%s\"", " Log text 1.\n"], | 477 ["log -1 rev1 --format=\"%w(80,8,8)%s\"", " Log text 1.\n"], |
477 ["log -1 rev1 --format=\"%B\"", "Text\nBUG=v8:321\nText\n"], | 478 ["log -1 rev1 --format=\"%B\"", "Text\nBUG=v8:321\nText\n"], |
478 ["log -1 rev1 --format=\"%w(80,8,8)(%an)\"", | 479 ["log -1 rev1 --format=\"%w(80,8,8)(%an)\"", |
479 " author1@chromium.org\n"], | 480 " author1@chromium.org\n"], |
480 [("commit -a -m \"Prepare push to trunk. " | 481 [("commit -a -m \"Prepare push to trunk. " |
481 "Now working on version 3.22.6.\""), | 482 "Now working on version 3.22.6.\""), |
482 " 2 files changed\n", | 483 " 2 files changed\n", |
483 CheckPreparePush], | 484 CheckPreparePush], |
484 ["cl upload -r \"reviewer@chromium.org\" --send-mail", "done\n"], | 485 ["cl upload -r \"reviewer@chromium.org\" --send-mail%s" % force_flag, |
| 486 "done\n"], |
485 ["cl dcommit -f", "Closing issue\n"], | 487 ["cl dcommit -f", "Closing issue\n"], |
486 ["svn fetch", "fetch result\n"], | 488 ["svn fetch", "fetch result\n"], |
487 ["checkout svn/bleeding_edge", ""], | 489 ["checkout svn/bleeding_edge", ""], |
488 [("log -1 --format=%H --grep=\"Prepare push to trunk. " | 490 [("log -1 --format=%H --grep=\"Prepare push to trunk. " |
489 "Now working on version 3.22.6.\""), | 491 "Now working on version 3.22.6.\""), |
490 "hash1\n"], | 492 "hash1\n"], |
491 ["diff svn/trunk hash1", "patch content\n"], | 493 ["diff svn/trunk hash1", "patch content\n"], |
492 ["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""], | 494 ["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""], |
493 ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""], | 495 ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""], |
494 ["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""], | 496 ["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""], |
495 ["commit -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit], | 497 ["commit -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit], |
496 ["svn dcommit 2>&1", "Some output\nCommitted r123456\nSome output\n"], | 498 ["svn dcommit 2>&1", "Some output\nCommitted r123456\nSome output\n"], |
497 ["svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""], | 499 ["svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""], |
498 ["status -s -uno", ""], | 500 ["status -s -uno", ""], |
499 ["checkout master", ""], | 501 ["checkout master", ""], |
500 ["pull", ""], | 502 ["pull", ""], |
501 ["checkout -b v8-roll-123456", ""], | 503 ["checkout -b v8-roll-123456", ""], |
502 [("commit -am \"Update V8 to version 3.22.5.\n\n" | 504 [("commit -am \"Update V8 to version 3.22.5.\n\n" |
503 "TBR=reviewer@chromium.org\""), | 505 "TBR=reviewer@chromium.org\""), |
504 ""], | 506 ""], |
505 ["cl upload --send-mail", ""], | 507 ["cl upload --send-mail%s" % force_flag, ""], |
506 ["checkout -f some_branch", ""], | 508 ["checkout -f some_branch", ""], |
507 ["branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""], | 509 ["branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""], |
508 ["branch -D %s" % TEST_CONFIG[BRANCHNAME], ""], | 510 ["branch -D %s" % TEST_CONFIG[BRANCHNAME], ""], |
509 ["branch -D %s" % TEST_CONFIG[TRUNKBRANCH], ""], | 511 ["branch -D %s" % TEST_CONFIG[TRUNKBRANCH], ""], |
510 ] | 512 ] |
511 self._rl_recipe = [ | 513 self._rl_recipe = [ |
512 "Y", # Confirm last push. | 514 "Y", # Confirm last push. |
513 "", # Open editor. | 515 "", # Open editor. |
514 "Y", # Increment build number. | 516 "Y", # Increment build number. |
515 "reviewer@chromium.org", # V8 reviewer. | 517 "reviewer@chromium.org", # V8 reviewer. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 | 549 |
548 # Note: The version file is on build number 5 again in the end of this test | 550 # Note: The version file is on build number 5 again in the end of this test |
549 # since the git command that merges to the bleeding edge branch is mocked | 551 # since the git command that merges to the bleeding edge branch is mocked |
550 # out. | 552 # out. |
551 | 553 |
552 def testPushToTrunk(self): | 554 def testPushToTrunk(self): |
553 self._PushToTrunk() | 555 self._PushToTrunk() |
554 | 556 |
555 def testPushToTrunkForced(self): | 557 def testPushToTrunkForced(self): |
556 self._PushToTrunk(force=True) | 558 self._PushToTrunk(force=True) |
OLD | NEW |