diff options
author | Manoj Gupta <manojgupta@google.com> | 2016-10-24 13:43:28 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-24 20:05:32 -0700 |
commit | aee96b71ad4ffde231ca5bf9c0509d15b0e9b753 (patch) | |
tree | 5cc70dd5d37fc80289c502b0e767b92d1e33c743 /buildbot_test_toolchains.py | |
parent | de600776d8342db1ae2579efd4ca07adbc310d6c (diff) | |
download | toolchain-utils-aee96b71ad4ffde231ca5bf9c0509d15b0e9b753.tar.gz |
Handle exceptions in crosperf.
Change error message in buildbot.
Catch exceptions in crosperf exceution to do a graceful exit.
BUG=chromium:622875
TEST=ran run_tests
Change-Id: I03093ab27edcc85e318ad43097ab8cd316792dcb
Reviewed-on: https://chrome-internal-review.googlesource.com/299275
Commit-Ready: Manoj Gupta <manojgupta@google.com>
Tested-by: Manoj Gupta <manojgupta@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'buildbot_test_toolchains.py')
-rwxr-xr-x | buildbot_test_toolchains.py | 85 |
1 files changed, 45 insertions, 40 deletions
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py index b9f6c500..6bc89fda 100755 --- a/buildbot_test_toolchains.py +++ b/buildbot_test_toolchains.py @@ -45,13 +45,15 @@ IMAGE_FS = (r'{board}-{image_type}/{chrome_version}-{tip}\.' + r'{branch}\.{branch_branch}') TRYBOT_IMAGE_FS = 'trybot-' + IMAGE_FS + '-{build_id}' PFQ_IMAGE_FS = IMAGE_FS + '-rc1' -IMAGE_RE_GROUPS = {'board': r'(?P<board>\S+)', - 'image_type': r'(?P<image_type>\S+)', - 'chrome_version': r'(?P<chrome_version>R\d+)', - 'tip': r'(?P<tip>\d+)', - 'branch': r'(?P<branch>\d+)', - 'branch_branch': r'(?P<branch_branch>\d+)', - 'build_id': r'(?P<build_id>b\d+)'} +IMAGE_RE_GROUPS = { + 'board': r'(?P<board>\S+)', + 'image_type': r'(?P<image_type>\S+)', + 'chrome_version': r'(?P<chrome_version>R\d+)', + 'tip': r'(?P<tip>\d+)', + 'branch': r'(?P<branch>\d+)', + 'branch_branch': r'(?P<branch_branch>\d+)', + 'build_id': r'(?P<build_id>b\d+)' +} TRYBOT_IMAGE_RE = TRYBOT_IMAGE_FS.format(**IMAGE_RE_GROUPS) @@ -82,8 +84,9 @@ class ToolchainComparator(object): self._weekday = weekday timestamp = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d_%H:%M:%S') - self._reports_dir = os.path.join(NIGHTLY_TESTS_DIR, - '%s.%s' % (timestamp, board),) + self._reports_dir = os.path.join( + NIGHTLY_TESTS_DIR, + '%s.%s' % (timestamp, board),) def _GetVanillaImageName(self, trybot_image): """Given a trybot artifact name, get corresponding vanilla image name. @@ -216,7 +219,7 @@ class ToolchainComparator(object): ret = self._ce.RunCommand(command) if ret != 0: - raise RuntimeError("Couldn't run crosperf!") + raise RuntimeError('Crosperf execution error!') else: # Copy json report to pending archives directory. command = 'cp %s/*.json %s/.' % (self._reports_dir, PENDING_ARCHIVES_DIR) @@ -292,12 +295,13 @@ class ToolchainComparator(object): date_str = datetime.date.today() description = 'master_%s_%s_%s' % (self._patches_string, self._build, date_str) - trybot_image = buildbot_utils.GetTrybotImage(self._chromeos_root, - self._build, - self._patches, - description, - other_flags=['--notests'], - build_toolchain=True) + trybot_image = buildbot_utils.GetTrybotImage( + self._chromeos_root, + self._build, + self._patches, + description, + other_flags=['--notests'], + build_toolchain=True) if len(trybot_image) == 0: self._l.LogError('Unable to find trybot_image for %s!' % description) @@ -331,30 +335,31 @@ def Main(argv): # Common initializations command_executer.InitCommandExecuter() parser = argparse.ArgumentParser() - parser.add_argument('--remote', - dest='remote', - help='Remote machines to run tests on.') - parser.add_argument('--board', - dest='board', - default='x86-zgb', - help='The target board.') - parser.add_argument('--chromeos_root', - dest='chromeos_root', - help='The chromeos root from which to run tests.') - parser.add_argument('--weekday', - default='', - dest='weekday', - help='The day of the week for which to run tests.') - parser.add_argument('--patch', - dest='patches', - help='The patches to use for the testing, ' - "seprate the patch numbers with ',' " - 'for more than one patches.') - parser.add_argument('--noschedv2', - dest='noschedv2', - action='store_true', - default=False, - help='Pass --noschedv2 to crosperf.') + parser.add_argument( + '--remote', dest='remote', help='Remote machines to run tests on.') + parser.add_argument( + '--board', dest='board', default='x86-zgb', help='The target board.') + parser.add_argument( + '--chromeos_root', + dest='chromeos_root', + help='The chromeos root from which to run tests.') + parser.add_argument( + '--weekday', + default='', + dest='weekday', + help='The day of the week for which to run tests.') + parser.add_argument( + '--patch', + dest='patches', + help='The patches to use for the testing, ' + "seprate the patch numbers with ',' " + 'for more than one patches.') + parser.add_argument( + '--noschedv2', + dest='noschedv2', + action='store_true', + default=False, + help='Pass --noschedv2 to crosperf.') options = parser.parse_args(argv[1:]) if not options.board: |