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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1412 cwd=chrome_dir), | 1412 cwd=chrome_dir), |
1413 Cmd("git show c_hash2:DEPS", c_deps % "hash_345", cwd=chrome_dir), | 1413 Cmd("git show c_hash2:DEPS", c_deps % "hash_345", cwd=chrome_dir), |
1414 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log, | 1414 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log, |
1415 cwd=chrome_dir), | 1415 cwd=chrome_dir), |
1416 Cmd("git show c_hash3:DEPS", c_deps % "deadbeef", cwd=chrome_dir), | 1416 Cmd("git show c_hash3:DEPS", c_deps % "deadbeef", cwd=chrome_dir), |
1417 Cmd("git log -1 --format=%B c_hash3", c_hash3_commit_log, | 1417 Cmd("git log -1 --format=%B c_hash3", c_hash3_commit_log, |
1418 cwd=chrome_dir), | 1418 cwd=chrome_dir), |
1419 Cmd("git branch -r", " weird/123\n branch-heads/7\n", cwd=chrome_dir), | 1419 Cmd("git branch -r", " weird/123\n branch-heads/7\n", cwd=chrome_dir), |
1420 Cmd("git show refs/branch-heads/7:DEPS", c_deps % "hash_345", | 1420 Cmd("git show refs/branch-heads/7:DEPS", c_deps % "hash_345", |
1421 cwd=chrome_dir), | 1421 cwd=chrome_dir), |
1422 URL("http://omahaproxy.appspot.com/all.json", | |
1423 "{}"), | |
Michael Achenbach
2015/04/15 09:35:39
Looks good, could you provide some dummy test data
Michael Hablich
2015/04/15 09:37:18
Yep. Wanted to make the tests pass first.
| |
1422 Cmd("git checkout -f origin/master", ""), | 1424 Cmd("git checkout -f origin/master", ""), |
1423 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), | 1425 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "") |
1424 ]) | 1426 ]) |
1425 | 1427 |
1426 args = ["-c", TEST_CONFIG["CHROMIUM"], | 1428 args = ["-c", TEST_CONFIG["CHROMIUM"], |
1427 "--json", json_output, | 1429 "--json", json_output, |
1428 "--csv", csv_output, | 1430 "--csv", csv_output, |
1429 "--max-releases", "1"] | 1431 "--max-releases", "1"] |
1430 Releases(TEST_CONFIG, self).Run(args) | 1432 Releases(TEST_CONFIG, self).Run(args) |
1431 | 1433 |
1432 # Check expected output. | 1434 # Check expected output. |
1433 csv = ("4.2.71,4.2.71,1,5678,\r\n" | 1435 csv = ("4.2.71,4.2.71,1,5678,\r\n" |
1434 "3.22.3,candidates,345,4567:5677,\r\n" | 1436 "3.22.3,candidates,345,4567:5677,\r\n" |
1435 "3.21.2,3.21,123,,\r\n" | 1437 "3.21.2,3.21,123,,\r\n" |
1436 "3.3.1.1,3.3,234,,abc12\r\n") | 1438 "3.3.1.1,3.3,234,,abc12\r\n") |
1437 self.assertEquals(csv, FileToText(csv_output)) | 1439 self.assertEquals(csv, FileToText(csv_output)) |
1438 | 1440 |
1439 expected_json = [ | 1441 expected_json = {'chrome_releases':{'canaries':[]}, |
Michael Achenbach
2015/04/15 09:35:38
nit: please keep indentation levels at a minimum -
Michael Achenbach
2015/04/15 09:35:39
nit: Always space after :
Michael Hablich
2015/04/15 09:37:18
Acknowledged.
| |
1440 { | 1442 'releases':[ |
1441 "revision": "1", | 1443 { |
1442 "revision_git": "hash_456", | 1444 "revision": "1", |
1443 "master_position": "456", | 1445 "revision_git": "hash_456", |
1444 "master_hash": "master_456", | 1446 "master_position": "456", |
1445 "patches_merged": "", | 1447 "master_hash": "master_456", |
1446 "version": "4.2.71", | 1448 "patches_merged": "", |
1447 "chromium_revision": "5678", | 1449 "version": "4.2.71", |
1448 "branch": "4.2.71", | 1450 "chromium_revision": "5678", |
1449 "review_link": "", | 1451 "branch": "4.2.71", |
1450 "date": "02:15", | 1452 "review_link": "", |
1451 "chromium_branch": "", | 1453 "date": "02:15", |
1452 # FIXME(machenbach): Fix revisions link for git. | 1454 "chromium_branch": "", |
1453 "revision_link": "https://code.google.com/p/v8/source/detail?r=1", | 1455 # FIXME(machenbach): Fix revisions link for git. |
1454 }, | 1456 "revision_link": "https://code.google.com/p/v8/source/ detail?r=1", |
1455 { | 1457 }, |
1456 "revision": "345", | 1458 { |
1457 "revision_git": "hash_345", | 1459 "revision": "345", |
1458 "master_position": "", | 1460 "revision_git": "hash_345", |
1459 "master_hash": "", | 1461 "master_position": "", |
1460 "patches_merged": "", | 1462 "master_hash": "", |
1461 "version": "3.22.3", | 1463 "patches_merged": "", |
1462 "chromium_revision": "4567:5677", | 1464 "version": "3.22.3", |
1463 "branch": "candidates", | 1465 "chromium_revision": "4567:5677", |
1464 "review_link": "", | 1466 "branch": "candidates", |
1465 "date": "", | 1467 "review_link": "", |
1466 "chromium_branch": "7", | 1468 "date": "", |
1467 "revision_link": "https://code.google.com/p/v8/source/detail?r=345", | 1469 "chromium_branch": "7", |
1468 }, | 1470 "revision_link": "https://code.google.com/p/v8/source/ detail?r=345", |
1469 { | 1471 }, |
1470 "revision": "123", | 1472 { |
1471 "revision_git": "hash_123", | 1473 "revision": "123", |
1472 "patches_merged": "", | 1474 "revision_git": "hash_123", |
1473 "master_position": "", | 1475 "patches_merged": "", |
1474 "master_hash": "", | 1476 "master_position": "", |
1475 "version": "3.21.2", | 1477 "master_hash": "", |
1476 "chromium_revision": "", | 1478 "version": "3.21.2", |
1477 "branch": "3.21", | 1479 "chromium_revision": "", |
1478 "review_link": "", | 1480 "branch": "3.21", |
1479 "date": "03:15", | 1481 "review_link": "", |
1480 "chromium_branch": "", | 1482 "date": "03:15", |
1481 "revision_link": "https://code.google.com/p/v8/source/detail?r=123", | 1483 "chromium_branch": "", |
1482 }, | 1484 "revision_link": "https://code.google.com/p/v8/source/ detail?r=123", |
1483 { | 1485 }, |
1484 "revision": "234", | 1486 { |
1485 "revision_git": "hash_234", | 1487 "revision": "234", |
1486 "patches_merged": "abc12", | 1488 "revision_git": "hash_234", |
1487 "master_position": "", | 1489 "patches_merged": "abc12", |
1488 "master_hash": "", | 1490 "master_position": "", |
1489 "version": "3.3.1.1", | 1491 "master_hash": "", |
1490 "chromium_revision": "", | 1492 "version": "3.3.1.1", |
1491 "branch": "3.3", | 1493 "chromium_revision": "", |
1492 "review_link": "fake.com", | 1494 "branch": "3.3", |
1493 "date": "18:15", | 1495 "review_link": "fake.com", |
1494 "chromium_branch": "", | 1496 "date": "18:15", |
1495 "revision_link": "https://code.google.com/p/v8/source/detail?r=234", | 1497 "chromium_branch": "", |
1496 }, | 1498 "revision_link": "https://code.google.com/p/v8/source/ detail?r=234", |
1497 ] | 1499 }] |
Michael Achenbach
2015/04/15 09:35:39
nit:
},
]
Michael Hablich
2015/04/15 09:37:18
Acknowledged.
| |
1500 } | |
1498 self.assertEquals(expected_json, json.loads(FileToText(json_output))) | 1501 self.assertEquals(expected_json, json.loads(FileToText(json_output))) |
1499 | 1502 |
1500 | 1503 |
1501 class SystemTest(unittest.TestCase): | 1504 class SystemTest(unittest.TestCase): |
1502 def testReload(self): | 1505 def testReload(self): |
1503 options = ScriptsBase( | 1506 options = ScriptsBase( |
1504 TEST_CONFIG, DEFAULT_SIDE_EFFECT_HANDLER, {}).MakeOptions([]) | 1507 TEST_CONFIG, DEFAULT_SIDE_EFFECT_HANDLER, {}).MakeOptions([]) |
1505 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, | 1508 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, |
1506 options=options, | 1509 options=options, |
1507 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) | 1510 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) |
1508 body = step.Reload( | 1511 body = step.Reload( |
1509 """------------------------------------------------------------------------ | 1512 """------------------------------------------------------------------------ |
1510 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines | 1513 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines |
1511 | 1514 |
1512 Prepare push to trunk. Now working on version 3.23.11. | 1515 Prepare push to trunk. Now working on version 3.23.11. |
1513 | 1516 |
1514 R=danno@chromium.org | 1517 R=danno@chromium.org |
1515 | 1518 |
1516 Review URL: https://codereview.chromium.org/83173002 | 1519 Review URL: https://codereview.chromium.org/83173002 |
1517 | 1520 |
1518 ------------------------------------------------------------------------""") | 1521 ------------------------------------------------------------------------""") |
1519 self.assertEquals( | 1522 self.assertEquals( |
1520 """Prepare push to trunk. Now working on version 3.23.11. | 1523 """Prepare push to trunk. Now working on version 3.23.11. |
1521 | 1524 |
1522 R=danno@chromium.org | 1525 R=danno@chromium.org |
1523 | 1526 |
1524 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1527 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |