llvm_tools: fix LLVM bisection tool.
The changes the LLVM bisection tool to adpat to the new output of "cros
tryjob --json".
BUG=chromium:1203504
TEST=Successfully launched the tool.
Change-Id: I1d6676fb966aee68ce7af177a65de0358a73baf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2855895
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Jian Cai <jiancai@google.com>
diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py
index b54ba65..66819eb 100755
--- a/llvm_tools/update_packages_and_run_tests.py
+++ b/llvm_tools/update_packages_and_run_tests.py
@@ -276,10 +276,12 @@
test_output = json.loads(out)
+ buildbucket_id = int(test_output[0]['id'])
+
tests.append({
'launch_time': str(GetCurrentTimeInUTC()),
- 'link': str(test_output[0]['url']),
- 'buildbucket_id': int(test_output[0]['buildbucket_id']),
+ 'link': 'http://ci.chromium.org/b/%s' % buildbucket_id,
+ 'buildbucket_id': buildbucket_id,
'extra_cls': extra_change_lists,
'options': options,
'builder': [builder]
@@ -472,9 +474,10 @@
for test in tests:
print(test)
elif args_output.subparser_name == 'recipe':
- tests = StartRecipeBuilders(
- change_list.cl_number, args_output.extra_change_lists,
- args_output.options, args_output.builders, args_output.chroot_path)
+ tests = StartRecipeBuilders(change_list.cl_number,
+ args_output.extra_change_lists,
+ args_output.options, args_output.builders,
+ args_output.chroot_path)
print('Tests:')
for test in tests:
print(test)
diff --git a/llvm_tools/update_packages_and_run_tests_unittest.py b/llvm_tools/update_packages_and_run_tests_unittest.py
index d852893..11f2b7f 100755
--- a/llvm_tools/update_packages_and_run_tests_unittest.py
+++ b/llvm_tools/update_packages_and_run_tests_unittest.py
@@ -46,8 +46,7 @@
def testMatchedLastTestedFile(self):
with test_helpers.CreateTemporaryFile() as last_tested_file:
arg_dict = {
- 'svn_version':
- 1234,
+ 'svn_version': 1234,
'ebuilds': [
'/path/to/package1-r2.ebuild',
'/path/to/package2/package2-r3.ebuild'
@@ -104,8 +103,9 @@
]
self.assertEqual(
- update_packages_and_run_tests.GetTryJobCommand(
- change_list, extra_cls, options, builder), expected_cmd)
+ update_packages_and_run_tests.GetTryJobCommand(change_list, extra_cls,
+ options, builder),
+ expected_cmd)
@mock.patch.object(
update_packages_and_run_tests,
@@ -123,9 +123,9 @@
]
bb_id = '1234'
- url = 'https://some_tryjob_url.com'
+ url = 'http://ci.chromium.org/b/%s' % bb_id
- mock_cmd.return_value = json.dumps([{'buildbucket_id': bb_id, 'url': url}])
+ mock_cmd.return_value = json.dumps([{'id': bb_id, 'url': url}])
chroot_path = '/some/path/to/chroot'
cl = 900