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 "os": "win", |
| 1424 "versions": [{ |
| 1425 "version": "1.1.1.1", |
| 1426 "v8_version": "2.2.2.2", |
| 1427 "current_reldate": "04/09/15", |
| 1428 "os": "win", |
| 1429 "channel": "canary" |
| 1430 }] |
| 1431 }]"""), |
1422 Cmd("git checkout -f origin/master", ""), | 1432 Cmd("git checkout -f origin/master", ""), |
1423 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), | 1433 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "") |
1424 ]) | 1434 ]) |
1425 | 1435 |
1426 args = ["-c", TEST_CONFIG["CHROMIUM"], | 1436 args = ["-c", TEST_CONFIG["CHROMIUM"], |
1427 "--json", json_output, | 1437 "--json", json_output, |
1428 "--csv", csv_output, | 1438 "--csv", csv_output, |
1429 "--max-releases", "1"] | 1439 "--max-releases", "1"] |
1430 Releases(TEST_CONFIG, self).Run(args) | 1440 Releases(TEST_CONFIG, self).Run(args) |
1431 | 1441 |
1432 # Check expected output. | 1442 # Check expected output. |
1433 csv = ("4.2.71,4.2.71,1,5678,\r\n" | 1443 csv = ("4.2.71,4.2.71,1,5678,\r\n" |
1434 "3.22.3,candidates,345,4567:5677,\r\n" | 1444 "3.22.3,candidates,345,4567:5677,\r\n" |
1435 "3.21.2,3.21,123,,\r\n" | 1445 "3.21.2,3.21,123,,\r\n" |
1436 "3.3.1.1,3.3,234,,abc12\r\n") | 1446 "3.3.1.1,3.3,234,,abc12\r\n") |
1437 self.assertEquals(csv, FileToText(csv_output)) | 1447 self.assertEquals(csv, FileToText(csv_output)) |
1438 | 1448 |
1439 expected_json = [ | 1449 expected_json = {"chrome_releases":{ |
| 1450 "canaries": [ |
| 1451 { |
| 1452 "chrome_version": "1.1.1.1", |
| 1453 "os": "win", |
| 1454 "release_date": "04/09/15", |
| 1455 "v8_version": "2.2.2.2", |
| 1456 }]}, |
| 1457 "releases":[ |
1440 { | 1458 { |
1441 "revision": "1", | 1459 "revision": "1", |
1442 "revision_git": "hash_456", | 1460 "revision_git": "hash_456", |
1443 "master_position": "456", | 1461 "master_position": "456", |
1444 "master_hash": "master_456", | 1462 "master_hash": "master_456", |
1445 "patches_merged": "", | 1463 "patches_merged": "", |
1446 "version": "4.2.71", | 1464 "version": "4.2.71", |
1447 "chromium_revision": "5678", | 1465 "chromium_revision": "5678", |
1448 "branch": "4.2.71", | 1466 "branch": "4.2.71", |
1449 "review_link": "", | 1467 "review_link": "", |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 "patches_merged": "abc12", | 1504 "patches_merged": "abc12", |
1487 "master_position": "", | 1505 "master_position": "", |
1488 "master_hash": "", | 1506 "master_hash": "", |
1489 "version": "3.3.1.1", | 1507 "version": "3.3.1.1", |
1490 "chromium_revision": "", | 1508 "chromium_revision": "", |
1491 "branch": "3.3", | 1509 "branch": "3.3", |
1492 "review_link": "fake.com", | 1510 "review_link": "fake.com", |
1493 "date": "18:15", | 1511 "date": "18:15", |
1494 "chromium_branch": "", | 1512 "chromium_branch": "", |
1495 "revision_link": "https://code.google.com/p/v8/source/detail?r=234", | 1513 "revision_link": "https://code.google.com/p/v8/source/detail?r=234", |
1496 }, | 1514 },], |
1497 ] | 1515 } |
1498 self.assertEquals(expected_json, json.loads(FileToText(json_output))) | 1516 self.assertEquals(expected_json, json.loads(FileToText(json_output))) |
1499 | 1517 |
1500 | 1518 |
1501 class SystemTest(unittest.TestCase): | 1519 class SystemTest(unittest.TestCase): |
1502 def testReload(self): | 1520 def testReload(self): |
1503 options = ScriptsBase( | 1521 options = ScriptsBase( |
1504 TEST_CONFIG, DEFAULT_SIDE_EFFECT_HANDLER, {}).MakeOptions([]) | 1522 TEST_CONFIG, DEFAULT_SIDE_EFFECT_HANDLER, {}).MakeOptions([]) |
1505 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, | 1523 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, |
1506 options=options, | 1524 options=options, |
1507 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) | 1525 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) |
1508 body = step.Reload( | 1526 body = step.Reload( |
1509 """------------------------------------------------------------------------ | 1527 """------------------------------------------------------------------------ |
1510 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines | 1528 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines |
1511 | 1529 |
1512 Prepare push to trunk. Now working on version 3.23.11. | 1530 Prepare push to trunk. Now working on version 3.23.11. |
1513 | 1531 |
1514 R=danno@chromium.org | 1532 R=danno@chromium.org |
1515 | 1533 |
1516 Review URL: https://codereview.chromium.org/83173002 | 1534 Review URL: https://codereview.chromium.org/83173002 |
1517 | 1535 |
1518 ------------------------------------------------------------------------""") | 1536 ------------------------------------------------------------------------""") |
1519 self.assertEquals( | 1537 self.assertEquals( |
1520 """Prepare push to trunk. Now working on version 3.23.11. | 1538 """Prepare push to trunk. Now working on version 3.23.11. |
1521 | 1539 |
1522 R=danno@chromium.org | 1540 R=danno@chromium.org |
1523 | 1541 |
1524 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1542 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |