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 21 matching lines...) Expand all Loading... |
32 import traceback | 32 import traceback |
33 import unittest | 33 import unittest |
34 | 34 |
35 import auto_push | 35 import auto_push |
36 from auto_push import CheckLastPush | 36 from auto_push import CheckLastPush |
37 import auto_roll | 37 import auto_roll |
38 import common_includes | 38 import common_includes |
39 from common_includes import * | 39 from common_includes import * |
40 import merge_to_branch | 40 import merge_to_branch |
41 from merge_to_branch import * | 41 from merge_to_branch import * |
42 import push_to_trunk | 42 import push_to_candidates |
43 from push_to_trunk import * | 43 from push_to_candidates import * |
44 import chromium_roll | 44 import chromium_roll |
45 from chromium_roll import ChromiumRoll | 45 from chromium_roll import ChromiumRoll |
46 import releases | 46 import releases |
47 from releases import Releases | 47 from releases import Releases |
48 from auto_tag import AutoTag | 48 from auto_tag import AutoTag |
49 | 49 |
50 | 50 |
51 TEST_CONFIG = { | 51 TEST_CONFIG = { |
52 "DEFAULT_CWD": None, | 52 "DEFAULT_CWD": None, |
53 "BRANCHNAME": "test-prepare-push", | 53 "BRANCHNAME": "test-prepare-push", |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 def WriteDeps(): | 906 def WriteDeps(): |
907 TextToFile("Some line\n \"v8_revision\": \"22624\",\n some line", | 907 TextToFile("Some line\n \"v8_revision\": \"22624\",\n some line", |
908 os.path.join(chrome_dir, "DEPS")) | 908 os.path.join(chrome_dir, "DEPS")) |
909 | 909 |
910 expectations = [ | 910 expectations = [ |
911 Cmd("git fetch origin", ""), | 911 Cmd("git fetch origin", ""), |
912 Cmd(("git log -1 --format=%H --grep=" | 912 Cmd(("git log -1 --format=%H --grep=" |
913 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 913 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
914 "origin/candidates"), "push_hash\n"), | 914 "origin/candidates"), "push_hash\n"), |
915 Cmd("git log -1 --format=%s push_hash", | 915 Cmd("git log -1 --format=%s push_hash", |
916 "Version 3.22.5 (based on bleeding_edge revision r22622)\n"), | 916 "Version 3.22.5 (based on abc)\n"), |
917 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", | 917 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", |
918 "document.write('g_name')"), | 918 "document.write('g_name')"), |
919 Cmd("git status -s -uno", "", cwd=chrome_dir), | 919 Cmd("git status -s -uno", "", cwd=chrome_dir), |
920 Cmd("git checkout -f master", "", cwd=chrome_dir), | 920 Cmd("git checkout -f master", "", cwd=chrome_dir), |
921 Cmd("gclient sync --nohooks", "syncing...", cwd=chrome_dir), | 921 Cmd("gclient sync --nohooks", "syncing...", cwd=chrome_dir), |
922 Cmd("git pull", "", cwd=chrome_dir), | 922 Cmd("git pull", "", cwd=chrome_dir), |
923 Cmd("git fetch origin", ""), | 923 Cmd("git fetch origin", ""), |
924 Cmd("git new-branch v8-roll-push_hash", "", cwd=chrome_dir), | 924 Cmd("git new-branch v8-roll-push_hash", "", cwd=chrome_dir), |
925 Cmd("roll-dep v8 push_hash", "rolled", cb=WriteDeps, cwd=chrome_dir), | 925 Cmd("roll-dep v8 push_hash", "rolled", cb=WriteDeps, cwd=chrome_dir), |
926 Cmd(("git commit -am \"Update V8 to version 3.22.5 " | 926 Cmd(("git commit -am \"Update V8 to version 3.22.5 " |
927 "(based on bleeding_edge revision r22622).\n\n" | 927 "(based on abc).\n\n" |
928 "Please reply to the V8 sheriff c_name@chromium.org in " | 928 "Please reply to the V8 sheriff c_name@chromium.org in " |
929 "case of problems.\n\nTBR=c_name@chromium.org\" " | 929 "case of problems.\n\nTBR=c_name@chromium.org\" " |
930 "--author \"author@chromium.org <author@chromium.org>\""), | 930 "--author \"author@chromium.org <author@chromium.org>\""), |
931 "", cwd=chrome_dir), | 931 "", cwd=chrome_dir), |
932 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f", "", | 932 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f", "", |
933 cwd=chrome_dir), | 933 cwd=chrome_dir), |
934 ] | 934 ] |
935 self.Expect(expectations) | 935 self.Expect(expectations) |
936 | 936 |
937 args = ["-a", "author@chromium.org", "-c", chrome_dir, | 937 args = ["-a", "author@chromium.org", "-c", chrome_dir, |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 # Check expected output. | 1324 # Check expected output. |
1325 csv = ("3.22.3,candidates,345,3456:4566,\r\n" | 1325 csv = ("3.22.3,candidates,345,3456:4566,\r\n" |
1326 "3.21.2,3.21,123,,\r\n" | 1326 "3.21.2,3.21,123,,\r\n" |
1327 "3.3.1.1,3.3,234,,abc12\r\n") | 1327 "3.3.1.1,3.3,234,,abc12\r\n") |
1328 self.assertEquals(csv, FileToText(csv_output)) | 1328 self.assertEquals(csv, FileToText(csv_output)) |
1329 | 1329 |
1330 expected_json = [ | 1330 expected_json = [ |
1331 { | 1331 { |
1332 "revision": "345", | 1332 "revision": "345", |
1333 "revision_git": "hash_345", | 1333 "revision_git": "hash_345", |
1334 "bleeding_edge": "", | 1334 "master_position": "", |
1335 "bleeding_edge_git": "", | 1335 "master_hash": "", |
1336 "patches_merged": "", | 1336 "patches_merged": "", |
1337 "version": "3.22.3", | 1337 "version": "3.22.3", |
1338 "chromium_revision": "3456:4566", | 1338 "chromium_revision": "3456:4566", |
1339 "branch": "candidates", | 1339 "branch": "candidates", |
1340 "review_link": "", | 1340 "review_link": "", |
1341 "date": "", | 1341 "date": "", |
1342 "chromium_branch": "7", | 1342 "chromium_branch": "7", |
1343 "revision_link": "https://code.google.com/p/v8/source/detail?r=345", | 1343 "revision_link": "https://code.google.com/p/v8/source/detail?r=345", |
1344 }, | 1344 }, |
1345 { | 1345 { |
1346 "revision": "123", | 1346 "revision": "123", |
1347 "revision_git": "hash_123", | 1347 "revision_git": "hash_123", |
1348 "patches_merged": "", | 1348 "patches_merged": "", |
1349 "bleeding_edge": "", | 1349 "master_position": "", |
1350 "bleeding_edge_git": "", | 1350 "master_hash": "", |
1351 "version": "3.21.2", | 1351 "version": "3.21.2", |
1352 "chromium_revision": "", | 1352 "chromium_revision": "", |
1353 "branch": "3.21", | 1353 "branch": "3.21", |
1354 "review_link": "", | 1354 "review_link": "", |
1355 "date": "03:15", | 1355 "date": "03:15", |
1356 "chromium_branch": "", | 1356 "chromium_branch": "", |
1357 "revision_link": "https://code.google.com/p/v8/source/detail?r=123", | 1357 "revision_link": "https://code.google.com/p/v8/source/detail?r=123", |
1358 }, | 1358 }, |
1359 { | 1359 { |
1360 "revision": "234", | 1360 "revision": "234", |
1361 "revision_git": "hash_234", | 1361 "revision_git": "hash_234", |
1362 "patches_merged": "abc12", | 1362 "patches_merged": "abc12", |
1363 "bleeding_edge": "", | 1363 "master_position": "", |
1364 "bleeding_edge_git": "", | 1364 "master_hash": "", |
1365 "version": "3.3.1.1", | 1365 "version": "3.3.1.1", |
1366 "chromium_revision": "", | 1366 "chromium_revision": "", |
1367 "branch": "3.3", | 1367 "branch": "3.3", |
1368 "review_link": "fake.com", | 1368 "review_link": "fake.com", |
1369 "date": "18:15", | 1369 "date": "18:15", |
1370 "chromium_branch": "", | 1370 "chromium_branch": "", |
1371 "revision_link": "https://code.google.com/p/v8/source/detail?r=234", | 1371 "revision_link": "https://code.google.com/p/v8/source/detail?r=234", |
1372 }, | 1372 }, |
1373 ] | 1373 ] |
1374 self.assertEquals(expected_json, json.loads(FileToText(json_output))) | 1374 self.assertEquals(expected_json, json.loads(FileToText(json_output))) |
(...skipping 16 matching lines...) Expand all Loading... |
1391 | 1391 |
1392 Review URL: https://codereview.chromium.org/83173002 | 1392 Review URL: https://codereview.chromium.org/83173002 |
1393 | 1393 |
1394 ------------------------------------------------------------------------""") | 1394 ------------------------------------------------------------------------""") |
1395 self.assertEquals( | 1395 self.assertEquals( |
1396 """Prepare push to trunk. Now working on version 3.23.11. | 1396 """Prepare push to trunk. Now working on version 3.23.11. |
1397 | 1397 |
1398 R=danno@chromium.org | 1398 R=danno@chromium.org |
1399 | 1399 |
1400 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1400 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |