aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools
diff options
context:
space:
mode:
authorJian Cai <jiancai@google.com>2021-04-27 17:22:20 -0700
committerJian Cai <jiancai@google.com>2021-04-28 00:36:11 +0000
commitb5bce2002ee5b944297c7d6c217e04a164f1aaae (patch)
treea229d126ef0aac24755742d36eda967ac1ab974f /llvm_tools
parentcc6e72a5f011edc06dee3bfcf8a2c06f6bab44de (diff)
downloadtoolchain-utils-b5bce2002ee5b944297c7d6c217e04a164f1aaae.tar.gz
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>
Diffstat (limited to 'llvm_tools')
-rwxr-xr-xllvm_tools/update_packages_and_run_tests.py13
-rwxr-xr-xllvm_tools/update_packages_and_run_tests_unittest.py12
2 files changed, 14 insertions, 11 deletions
diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py
index b54ba651..66819ebc 100755
--- a/llvm_tools/update_packages_and_run_tests.py
+++ b/llvm_tools/update_packages_and_run_tests.py
@@ -276,10 +276,12 @@ def RunTryJobs(cl_number, extra_change_lists, options, builders, chroot_path):
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 @@ def main():
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 d852893a..11f2b7f8 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 @@ class UpdatePackagesAndRunTryjobsTest(unittest.TestCase):
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 @@ class UpdatePackagesAndRunTryjobsTest(unittest.TestCase):
]
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 @@ class UpdatePackagesAndRunTryjobsTest(unittest.TestCase):
]
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