Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: tools/push-to-trunk/test_scripts.py

Issue 658033005: Add v8 git hashes to releases script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/push-to-trunk/releases.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 return lambda: self.WriteFakeVersionFile(minor=minor, 1506 return lambda: self.WriteFakeVersionFile(minor=minor,
1507 build=build, 1507 build=build,
1508 patch=patch) 1508 patch=patch)
1509 1509
1510 def ResetDEPS(revision): 1510 def ResetDEPS(revision):
1511 return lambda: WriteDEPS(revision) 1511 return lambda: WriteDEPS(revision)
1512 1512
1513 self.Expect([ 1513 self.Expect([
1514 Cmd("git status -s -uno", ""), 1514 Cmd("git status -s -uno", ""),
1515 Cmd("git status -s -b -uno", "## some_branch\n"), 1515 Cmd("git status -s -b -uno", "## some_branch\n"),
1516 Cmd("git svn fetch", ""), 1516 Cmd("git fetch", ""),
1517 Cmd("git branch", " branch1\n* branch2\n"), 1517 Cmd("git branch", " branch1\n* branch2\n"),
1518 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], ""), 1518 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], ""),
1519 Cmd("git branch -r", " svn/3.21\n svn/3.3\n"), 1519 Cmd("git branch -r", " branch-heads/3.21\n branch-heads/3.3\n"),
1520 Cmd("git reset --hard svn/3.3", ""), 1520 Cmd("git reset --hard branch-heads/3.3", ""),
1521 Cmd("git log --format=%H", "hash1\nhash2"), 1521 Cmd("git log --format=%H", "hash1\nhash_234"),
1522 Cmd("git diff --name-only hash1 hash1^", ""), 1522 Cmd("git diff --name-only hash1 hash1^", ""),
1523 Cmd("git diff --name-only hash2 hash2^", VERSION_FILE), 1523 Cmd("git diff --name-only hash_234 hash_234^", VERSION_FILE),
1524 Cmd("git checkout -f hash2 -- %s" % VERSION_FILE, "", 1524 Cmd("git checkout -f hash_234 -- %s" % VERSION_FILE, "",
1525 cb=ResetVersion(3, 1, 1)), 1525 cb=ResetVersion(3, 1, 1)),
1526 Cmd("git log -1 --format=%B hash2", 1526 Cmd("git log -1 --format=%B hash_234",
1527 "Version 3.3.1.1 (merged 12)\n\nReview URL: fake.com\n"), 1527 "Version 3.3.1.1 (merged 12)\n\nReview URL: fake.com\n"),
1528 Cmd("git log -1 --format=%s hash2", ""), 1528 Cmd("git log -1 --format=%s hash_234", ""),
1529 Cmd("git svn find-rev hash2", "234"), 1529 Cmd("git svn find-rev hash_234", "234"),
1530 Cmd("git log -1 --format=%ci hash2", "18:15"), 1530 Cmd("git log -1 --format=%ci hash_234", "18:15"),
1531 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", 1531 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
1532 cb=ResetVersion(22, 5)), 1532 cb=ResetVersion(22, 5)),
1533 Cmd("git reset --hard svn/3.21", ""), 1533 Cmd("git reset --hard branch-heads/3.21", ""),
1534 Cmd("git log --format=%H", "hash3\nhash4\nhash5\n"), 1534 Cmd("git log --format=%H", "hash_123\nhash4\nhash5\n"),
1535 Cmd("git diff --name-only hash3 hash3^", VERSION_FILE), 1535 Cmd("git diff --name-only hash_123 hash_123^", VERSION_FILE),
1536 Cmd("git checkout -f hash3 -- %s" % VERSION_FILE, "", 1536 Cmd("git checkout -f hash_123 -- %s" % VERSION_FILE, "",
1537 cb=ResetVersion(21, 2)), 1537 cb=ResetVersion(21, 2)),
1538 Cmd("git log -1 --format=%B hash3", ""), 1538 Cmd("git log -1 --format=%B hash_123", ""),
1539 Cmd("git log -1 --format=%s hash3", ""), 1539 Cmd("git log -1 --format=%s hash_123", ""),
1540 Cmd("git svn find-rev hash3", "123"), 1540 Cmd("git svn find-rev hash_123", "123"),
1541 Cmd("git log -1 --format=%ci hash3", "03:15"), 1541 Cmd("git log -1 --format=%ci hash_123", "03:15"),
1542 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", 1542 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
1543 cb=ResetVersion(22, 5)), 1543 cb=ResetVersion(22, 5)),
1544 Cmd("git reset --hard svn/trunk", ""), 1544 Cmd("git reset --hard origin/candidates", ""),
1545 Cmd("git log --format=%H", "hash6\n"), 1545 Cmd("git log --format=%H", "hash_345\n"),
1546 Cmd("git diff --name-only hash6 hash6^", VERSION_FILE), 1546 Cmd("git diff --name-only hash_345 hash_345^", VERSION_FILE),
1547 Cmd("git checkout -f hash6 -- %s" % VERSION_FILE, "", 1547 Cmd("git checkout -f hash_345 -- %s" % VERSION_FILE, "",
1548 cb=ResetVersion(22, 3)), 1548 cb=ResetVersion(22, 3)),
1549 Cmd("git log -1 --format=%B hash6", ""), 1549 Cmd("git log -1 --format=%B hash_345", ""),
1550 Cmd("git log -1 --format=%s hash6", ""), 1550 Cmd("git log -1 --format=%s hash_345", ""),
1551 Cmd("git svn find-rev hash6", "345"), 1551 Cmd("git svn find-rev hash_345", "345"),
1552 Cmd("git log -1 --format=%ci hash6", ""), 1552 Cmd("git log -1 --format=%ci hash_345", ""),
1553 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", 1553 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "",
1554 cb=ResetVersion(22, 5)), 1554 cb=ResetVersion(22, 5)),
1555 Cmd("git reset --hard svn/bleeding_edge", ""), 1555 Cmd("git reset --hard origin/master", ""),
1556 Cmd("svn log https://v8.googlecode.com/svn/tags -v --limit 20", 1556 Cmd("svn log https://v8.googlecode.com/svn/tags -v --limit 20",
1557 tag_response_text), 1557 tag_response_text),
1558 Cmd("git svn find-rev r22626", "hash_22626"), 1558 Cmd("git svn find-rev r22626", "hash_22626"),
1559 Cmd("git svn find-rev hash_22626", "22626"), 1559 Cmd("git svn find-rev hash_22626", "22626"),
1560 Cmd("git log -1 --format=%ci hash_22626", "01:23"), 1560 Cmd("git log -1 --format=%ci hash_22626", "01:23"),
1561 Cmd("git svn find-rev r22624", "hash_22624"), 1561 Cmd("git svn find-rev r22624", "hash_22624"),
1562 Cmd("git svn find-rev hash_22624", "22624"), 1562 Cmd("git svn find-rev hash_22624", "22624"),
1563 Cmd("git log -1 --format=%ci hash_22624", "02:34"), 1563 Cmd("git log -1 --format=%ci hash_22624", "02:34"),
1564 Cmd("git status -s -uno", "", cwd=chrome_dir), 1564 Cmd("git status -s -uno", "", cwd=chrome_dir),
1565 Cmd("git checkout -f master", "", cwd=chrome_dir), 1565 Cmd("git checkout -f master", "", cwd=chrome_dir),
1566 Cmd("git pull", "", cwd=chrome_dir), 1566 Cmd("git pull", "", cwd=chrome_dir),
1567 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir), 1567 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "",
1568 cwd=chrome_dir),
1568 Cmd("git fetch origin", "", cwd=chrome_v8_dir), 1569 Cmd("git fetch origin", "", cwd=chrome_v8_dir),
1569 Cmd("git log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\nc_hash3\n", 1570 Cmd("git log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\nc_hash3\n",
1570 cwd=chrome_dir), 1571 cwd=chrome_dir),
1571 Cmd("git diff --name-only c_hash1 c_hash1^", "", cwd=chrome_dir), 1572 Cmd("git diff --name-only c_hash1 c_hash1^", "", cwd=chrome_dir),
1572 Cmd("git diff --name-only c_hash2 c_hash2^", "DEPS", cwd=chrome_dir), 1573 Cmd("git diff --name-only c_hash2 c_hash2^", "DEPS", cwd=chrome_dir),
1573 Cmd("git checkout -f c_hash2 -- DEPS", "", 1574 Cmd("git checkout -f c_hash2 -- DEPS", "",
1574 cb=ResetDEPS("0123456789012345678901234567890123456789"), 1575 cb=ResetDEPS("0123456789012345678901234567890123456789"),
1575 cwd=chrome_dir), 1576 cwd=chrome_dir),
1576 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log, 1577 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log,
1577 cwd=chrome_dir), 1578 cwd=chrome_dir),
(...skipping 13 matching lines...) Expand all
1591 cwd=chrome_dir), 1592 cwd=chrome_dir),
1592 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567), 1593 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567),
1593 cwd=chrome_dir), 1594 cwd=chrome_dir),
1594 Cmd("git checkout -f master", "", cwd=chrome_dir), 1595 Cmd("git checkout -f master", "", cwd=chrome_dir),
1595 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir), 1596 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir),
1596 Cmd("git checkout -f some_branch", ""), 1597 Cmd("git checkout -f some_branch", ""),
1597 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), 1598 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
1598 ]) 1599 ])
1599 1600
1600 args = ["-c", TEST_CONFIG["CHROMIUM"], 1601 args = ["-c", TEST_CONFIG["CHROMIUM"],
1602 "--vc-interface", "git_read_svn_write",
1601 "--json", json_output, 1603 "--json", json_output,
1602 "--csv", csv_output, 1604 "--csv", csv_output,
1603 "--max-releases", "1"] 1605 "--max-releases", "1"]
1604 Releases(TEST_CONFIG, self).Run(args) 1606 Releases(TEST_CONFIG, self).Run(args)
1605 1607
1606 # Check expected output. 1608 # Check expected output.
1607 csv = ("3.28.41,bleeding_edge,22626,,\r\n" 1609 csv = ("3.28.41,master,22626,,\r\n"
1608 "3.28.40,bleeding_edge,22624,4567,\r\n" 1610 "3.28.40,master,22624,4567,\r\n"
1609 "3.22.3,trunk,345,3456:4566,\r\n" 1611 "3.22.3,candidates,345,3456:4566,\r\n"
1610 "3.21.2,3.21,123,,\r\n" 1612 "3.21.2,3.21,123,,\r\n"
1611 "3.3.1.1,3.3,234,,12\r\n") 1613 "3.3.1.1,3.3,234,,12\r\n")
1612 self.assertEquals(csv, FileToText(csv_output)) 1614 self.assertEquals(csv, FileToText(csv_output))
1613 1615
1614 expected_json = [ 1616 expected_json = [
1615 {"bleeding_edge": "22626", "patches_merged": "", "version": "3.28.41", 1617 {
1616 "chromium_revision": "", "branch": "bleeding_edge", "revision": "22626", 1618 "revision": "22626",
1617 "review_link": "", "date": "01:23", "chromium_branch": "", 1619 "revision_git": "hash_22626",
1618 "revision_link": "https://code.google.com/p/v8/source/detail?r=22626"}, 1620 "bleeding_edge": "22626",
1619 {"bleeding_edge": "22624", "patches_merged": "", "version": "3.28.40", 1621 "bleeding_edge_git": "hash_22626",
1620 "chromium_revision": "4567", "branch": "bleeding_edge", 1622 "patches_merged": "",
1621 "revision": "22624", "review_link": "", "date": "02:34", 1623 "version": "3.28.41",
1622 "chromium_branch": "", 1624 "chromium_revision": "",
1623 "revision_link": "https://code.google.com/p/v8/source/detail?r=22624"}, 1625 "branch": "master",
1624 {"bleeding_edge": "", "patches_merged": "", "version": "3.22.3", 1626 "review_link": "",
1625 "chromium_revision": "3456:4566", "branch": "trunk", "revision": "345", 1627 "date": "01:23",
1626 "review_link": "", "date": "", "chromium_branch": "7", 1628 "chromium_branch": "",
1627 "revision_link": "https://code.google.com/p/v8/source/detail?r=345"}, 1629 "revision_link": "https://code.google.com/p/v8/source/detail?r=22626",
1628 {"patches_merged": "", "bleeding_edge": "", "version": "3.21.2", 1630 },
1629 "chromium_revision": "", "branch": "3.21", "revision": "123", 1631 {
1630 "review_link": "", "date": "03:15", "chromium_branch": "", 1632 "revision": "22624",
1631 "revision_link": "https://code.google.com/p/v8/source/detail?r=123"}, 1633 "revision_git": "hash_22624",
1632 {"patches_merged": "12", "bleeding_edge": "", "version": "3.3.1.1", 1634 "bleeding_edge": "22624",
1633 "chromium_revision": "", "branch": "3.3", "revision": "234", 1635 "bleeding_edge_git": "hash_22624",
1634 "review_link": "fake.com", "date": "18:15", "chromium_branch": "", 1636 "patches_merged": "",
1635 "revision_link": "https://code.google.com/p/v8/source/detail?r=234"}, 1637 "version": "3.28.40",
1638 "chromium_revision": "4567",
1639 "branch": "master",
1640 "review_link": "",
1641 "date": "02:34",
1642 "chromium_branch": "",
1643 "revision_link": "https://code.google.com/p/v8/source/detail?r=22624",
1644 },
1645 {
1646 "revision": "345",
1647 "revision_git": "hash_345",
1648 "bleeding_edge": "",
1649 "bleeding_edge_git": "",
1650 "patches_merged": "",
1651 "version": "3.22.3",
1652 "chromium_revision": "3456:4566",
1653 "branch": "candidates",
1654 "review_link": "",
1655 "date": "",
1656 "chromium_branch": "7",
1657 "revision_link": "https://code.google.com/p/v8/source/detail?r=345",
1658 },
1659 {
1660 "revision": "123",
1661 "revision_git": "hash_123",
1662 "patches_merged": "",
1663 "bleeding_edge": "",
1664 "bleeding_edge_git": "",
1665 "version": "3.21.2",
1666 "chromium_revision": "",
1667 "branch": "3.21",
1668 "review_link": "",
1669 "date": "03:15",
1670 "chromium_branch": "",
1671 "revision_link": "https://code.google.com/p/v8/source/detail?r=123",
1672 },
1673 {
1674 "revision": "234",
1675 "revision_git": "hash_234",
1676 "patches_merged": "12",
1677 "bleeding_edge": "",
1678 "bleeding_edge_git": "",
1679 "version": "3.3.1.1",
1680 "chromium_revision": "",
1681 "branch": "3.3",
1682 "review_link": "fake.com",
1683 "date": "18:15",
1684 "chromium_branch": "",
1685 "revision_link": "https://code.google.com/p/v8/source/detail?r=234",
1686 },
1636 ] 1687 ]
1637 self.assertEquals(expected_json, json.loads(FileToText(json_output))) 1688 self.assertEquals(expected_json, json.loads(FileToText(json_output)))
1638 1689
1639 1690
1640 def _bumpUpVersion(self): 1691 def _bumpUpVersion(self):
1641 self.WriteFakeVersionFile() 1692 self.WriteFakeVersionFile()
1642 1693
1643 def ResetVersion(minor, build, patch=0): 1694 def ResetVersion(minor, build, patch=0):
1644 return lambda: self.WriteFakeVersionFile(minor=minor, 1695 return lambda: self.WriteFakeVersionFile(minor=minor,
1645 build=build, 1696 build=build,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 1869
1819 Review URL: https://codereview.chromium.org/83173002 1870 Review URL: https://codereview.chromium.org/83173002
1820 1871
1821 ------------------------------------------------------------------------""") 1872 ------------------------------------------------------------------------""")
1822 self.assertEquals( 1873 self.assertEquals(
1823 """Prepare push to trunk. Now working on version 3.23.11. 1874 """Prepare push to trunk. Now working on version 3.23.11.
1824 1875
1825 R=danno@chromium.org 1876 R=danno@chromium.org
1826 1877
1827 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1878 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« no previous file with comments | « tools/push-to-trunk/releases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698