aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Yuan Huang <laszio@google.com>2017-08-16 12:32:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-16 17:46:17 -0700
commit4f59a62546caa30051ac7c9a93c49069f7741245 (patch)
tree0f2775496889595c70f0059976794016b9c43e50
parent09cacd0d5fc2dc60a3c21796703a72dd61e2e5ed (diff)
downloadtoolchain-utils-4f59a62546caa30051ac7c9a93c49069f7741245.tar.gz
Switching from cbuildbot to cros tryjob
BUG=chromium:756100 TEST=buildbot_test_toolchains.py, buildbot_test_llvm.py Change-Id: Ie275b960afdb2ed7183a763302af70c3f2bc1092 Reviewed-on: https://chromium-review.googlesource.com/617404 Commit-Ready: Ting-Yuan Huang <laszio@chromium.org> Tested-by: Ting-Yuan Huang <laszio@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
-rwxr-xr-xbuildbot_test_llvm.py7
-rwxr-xr-xbuildbot_test_toolchains.py3
-rw-r--r--cros_utils/buildbot_utils.py34
3 files changed, 25 insertions, 19 deletions
diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py
index 8e604782..dd88b5bd 100755
--- a/buildbot_test_llvm.py
+++ b/buildbot_test_llvm.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python2
+#
+# Copyright 2017 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Script for running llvm validation tests on ChromeOS.
This script launches a buildbot to build ChromeOS with the llvm on
@@ -108,7 +112,6 @@ class ToolchainVerifier(object):
Launch trybot, get image names, create crosperf experiment file, run
crosperf, and copy images into seven-day report directories.
"""
- flags = ['--hwtest']
date_str = datetime.date.today()
description = 'master_%s_%s_%s' % (self._patches_string, self._build,
date_str)
@@ -117,7 +120,7 @@ class ToolchainVerifier(object):
self._build,
self._patches,
description,
- other_flags=flags,
+ tryjob_flags=['--hwtest'],
async=True)
return 0
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index 06707be9..5f65e15a 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -254,12 +254,13 @@ class ToolchainComparator(object):
date_str = datetime.date.today()
description = 'master_%s_%s_%s' % (self._patches_string, self._build,
date_str)
+ # TODO(laszio): move --notests to tryjob_flags once it is available.
build_id, trybot_image = buildbot_utils.GetTrybotImage(
self._chromeos_root,
self._build,
self._patches,
description,
- other_flags=['--notests'],
+ cbuildbot_flags=['--notests'],
build_toolchain=True)
print('trybot_url: \
diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py
index f89bb71a..0d524883 100644
--- a/cros_utils/buildbot_utils.py
+++ b/cros_utils/buildbot_utils.py
@@ -1,4 +1,4 @@
-# Copyright 2016 The Chromium OS Authors. All rights reserved.
+# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities for launching and accessing ChromeOS buildbots."""
@@ -199,7 +199,8 @@ def GetTrybotImage(chromeos_root,
buildbot_name,
patch_list,
build_tag,
- other_flags=None,
+ tryjob_flags=[],
+ cbuildbot_flags=[],
build_toolchain=False,
async=False):
"""Launch buildbot and get resulting trybot artifact name.
@@ -220,9 +221,15 @@ def GetTrybotImage(chromeos_root,
build_tag is a (unique) string to be used to look up the buildbot results
from among all the build records.
+
+ build_toolchain builds and uses the latest toolchain, rather than the
+ prebuilt one in SDK.
+
+ tryjob_flags See cros tryjob --help for available options.
+
+ cbuildbot_flags See cbuildbot --help for available options.
"""
ce = command_executer.GetCommandExecuter()
- cbuildbot_path = os.path.join(chromeos_root, 'chromite/cbuildbot')
base_dir = os.getcwd()
patch_arg = ''
if patch_list:
@@ -230,23 +237,18 @@ def GetTrybotImage(chromeos_root,
patch_arg = patch_arg + ' -g ' + repr(p)
toolchain_flags = ''
if build_toolchain:
- toolchain_flags += '--latest-toolchain'
- os.chdir(cbuildbot_path)
- if other_flags:
- optional_flags = ' '.join(other_flags)
- else:
- optional_flags = ''
+ cbuildbot_flags.append('--latest-toolchain')
+ os.chdir(chromeos_root)
+ tryjob_flags = ' '.join(tryjob_flags)
+ cbuildbot_flags = ' '.join(cbuildbot_flags)
# Launch buildbot with appropriate flags.
build = buildbot_name
description = build_tag
- command_prefix = ''
- if not patch_arg:
- command_prefix = 'yes | '
- command = ('%s ./cbuildbot --remote --nochromesdk %s'
- ' --remote-description=%s %s %s %s' %
- (command_prefix, optional_flags, description, toolchain_flags,
- patch_arg, build))
+ command = ('cros tryjob --yes %s --remote-description %s'
+ ' %s %s --passthrough --nochromesdk %s' %
+ (tryjob_flags, description,
+ patch_arg, build, cbuildbot_flags))
_, out, _ = ce.RunCommandWOutput(command)
if 'Tryjob submitted!' not in out:
logger.GetLogger().LogFatal('Error occurred while launching trybot job: '