(self)
| 430 | FakeScript(fake_config, self).Run(["--work-dir", work_dir]) |
| 431 | |
| 432 | def testCreateRelease(self): |
| 433 | TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 434 | |
| 435 | # The version file on main has build level 5. |
| 436 | self.WriteFakeVersionFile(build=5) |
| 437 | |
| 438 | commit_msg = """Version 3.22.5""" |
| 439 | |
| 440 | def CheckVersionCommit(): |
| 441 | commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
| 442 | self.assertEquals(commit_msg, commit) |
| 443 | version = FileToText( |
| 444 | os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) |
| 445 | self.assertTrue(re.search(r"#define V8_MINOR_VERSION\s+22", version)) |
| 446 | self.assertTrue(re.search(r"#define V8_BUILD_NUMBER\s+5", version)) |
| 447 | self.assertFalse(re.search(r"#define V8_BUILD_NUMBER\s+6", version)) |
| 448 | self.assertTrue(re.search(r"#define V8_PATCH_LEVEL\s+0", version)) |
| 449 | self.assertTrue( |
| 450 | re.search(r"#define V8_IS_CANDIDATE_VERSION\s+0", version)) |
| 451 | |
| 452 | expectations = [ |
| 453 | Cmd("git checkout -f origin/main", "", cb=self.WriteFakeWatchlistsFile), |
| 454 | Cmd("git fetch origin +refs/heads/*:refs/heads/*", ""), |
| 455 | Cmd("git branch", ""), |
| 456 | Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), |
| 457 | Cmd("git tag", self.TAGS), |
| 458 | Cmd("git checkout -f origin/main -- include/v8-version.h", |
| 459 | "", cb=self.WriteFakeVersionFile), |
| 460 | Cmd("git log -1 --format=%H 3.22.4", "release_hash\n"), |
| 461 | Cmd("git log -1 --format=%s release_hash", "Version 3.22.4\n"), |
| 462 | Cmd("git log -1 --format=%H release_hash^", "abc3\n"), |
| 463 | Cmd("git log --format=%H abc3..push_hash", "rev1\n"), |
| 464 | Cmd("git push origin push_hash:refs/heads/3.22.5", ""), |
| 465 | Cmd("git reset --hard origin/main", ""), |
| 466 | Cmd("git new-branch work-branch --upstream origin/3.22.5", ""), |
| 467 | Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", |
| 468 | cb=self.WriteFakeVersionFile), |
| 469 | Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", |
| 470 | cb=CheckVersionCommit), |
| 471 | Cmd("git cl upload --send-mail " |
| 472 | "-f --set-bot-commit --bypass-hooks --no-autocc --message-file " |
| 473 | "\"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""), |
| 474 | Cmd("git cl land --bypass-hooks -f", ""), |
| 475 | Cmd("git fetch", ""), |
| 476 | Cmd("git log -1 --format=%H --grep=" |
| 477 | "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), |
| 478 | Cmd("git tag 3.22.5 hsh_to_tag", ""), |
| 479 | Cmd("git push origin refs/tags/3.22.5:refs/tags/3.22.5", ""), |
| 480 | Cmd("git checkout -f origin/main", ""), |
| 481 | Cmd("git branch", "* main\n work-branch\n"), |
| 482 | Cmd("git branch -D work-branch", ""), |
| 483 | Cmd("git gc", ""), |
| 484 | ] |
| 485 | self.Expect(expectations) |
| 486 | |
| 487 | args = ["-a", "author@chromium.org", |
| 488 | "-r", "reviewer@chromium.org", |
| 489 | "--revision", "push_hash"] |
nothing calls this directly
no test coverage detected