From 2124be5caee6803d5bfe6f7cdc8e3367cb375807 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 21 Apr 2022 10:27:37 -0700 Subject: toolchain_utils: s/Cr OS/CrOS/g Result of running `sed -ri 's/Chrom(ium|e) OS/Chrom\1OS/g' $(find -type f)`. BUG=None TEST=None Change-Id: I59be92537aa19bc989f52b585e307e76dbde401b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3600147 Reviewed-by: Manoj Gupta Commit-Queue: George Burgess Tested-by: George Burgess --- buildbot_test_llvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildbot_test_llvm.py') diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py index 1c7bb199..7698a07d 100755 --- a/buildbot_test_llvm.py +++ b/buildbot_test_llvm.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# Copyright 2017 The Chromium OS Authors. All rights reserved. +# Copyright 2017 The ChromiumOS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -- cgit v1.2.3 From 74bd380a27f4f0e8e90ff2dc1cef0b502d74961b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 2 Sep 2022 16:59:27 -0700 Subject: Autoformat all Python code This autoformats all Python code with our new Python formatter, `black`. BUG=b:244644217 TEST=None Change-Id: I15ee49233d98fb6295c0c53c129bbf8e78e0d9ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3877337 Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess --- buildbot_test_llvm.py | 274 +++++++++++++++++++++++++++----------------------- 1 file changed, 147 insertions(+), 127 deletions(-) (limited to 'buildbot_test_llvm.py') diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py index 7698a07d..25d269f5 100755 --- a/buildbot_test_llvm.py +++ b/buildbot_test_llvm.py @@ -24,19 +24,19 @@ import os import sys import time +from cros_utils import buildbot_utils from cros_utils import command_executer from cros_utils import logger -from cros_utils import buildbot_utils -CROSTC_ROOT = '/usr/local/google/crostc' -ROLE_ACCOUNT = 'mobiletc-prebuild' +CROSTC_ROOT = "/usr/local/google/crostc" +ROLE_ACCOUNT = "mobiletc-prebuild" TOOLCHAIN_DIR = os.path.dirname(os.path.realpath(__file__)) -MAIL_PROGRAM = '~/var/bin/mail-detective' -VALIDATION_RESULT_DIR = os.path.join(CROSTC_ROOT, 'validation_result') +MAIL_PROGRAM = "~/var/bin/mail-detective" +VALIDATION_RESULT_DIR = os.path.join(CROSTC_ROOT, "validation_result") START_DATE = datetime.date(2016, 1, 1) TEST_PER_DAY = 4 -DATA_DIR = '/google/data/rw/users/mo/mobiletc-prebuild/waterfall-report-data/' +DATA_DIR = "/google/data/rw/users/mo/mobiletc-prebuild/waterfall-report-data/" # Information about Rotating Boards # Board Arch Reference Platform Kernel @@ -63,137 +63,157 @@ DATA_DIR = '/google/data/rw/users/mo/mobiletc-prebuild/waterfall-report-data/' # winky x86_64 rambi baytrail 4.4.* TEST_BOARD = [ - 'atlas', - 'cave', - 'coral', - 'cyan', - 'elm', + "atlas", + "cave", + "coral", + "cyan", + "elm", # 'eve', tested by amd64-llvm-next-toolchain builder. - 'gale', - 'grunt', - 'fizz-moblab', + "gale", + "grunt", + "fizz-moblab", # 'kevin', tested by arm64-llvm-next-toolchain builder. - 'kevin64', - 'lakitu', - 'nyan_kitty', - 'octopus', - 'sentry', - 'tidus', + "kevin64", + "lakitu", + "nyan_kitty", + "octopus", + "sentry", + "tidus", # 'veyron_mighty', tested by arm-llvm-next-toolchain builder. - 'whirlwind', - 'winky', + "whirlwind", + "winky", ] class ToolchainVerifier(object): - """Class for the toolchain verifier.""" - - def __init__(self, board, chromeos_root, weekday, patches, compiler): - self._board = board - self._chromeos_root = chromeos_root - self._base_dir = os.getcwd() - self._ce = command_executer.GetCommandExecuter() - self._l = logger.GetLogger() - self._compiler = compiler - self._build = '%s-%s-toolchain-tryjob' % (board, compiler) - self._patches = patches.split(',') if patches else [] - self._patches_string = '_'.join(str(p) for p in self._patches) - - if not weekday: - self._weekday = time.strftime('%a') - else: - self._weekday = weekday - self._reports = os.path.join(VALIDATION_RESULT_DIR, compiler, board) - - def DoAll(self): - """Main function inside ToolchainComparator class. - - Launch trybot, get image names, create crosperf experiment file, run - crosperf, and copy images into seven-day report directories. - """ - buildbucket_id, _ = buildbot_utils.GetTrybotImage( - self._chromeos_root, - self._build, - self._patches, - tryjob_flags=['--hwtest'], - asynchronous=True) - - return buildbucket_id + """Class for the toolchain verifier.""" + + def __init__(self, board, chromeos_root, weekday, patches, compiler): + self._board = board + self._chromeos_root = chromeos_root + self._base_dir = os.getcwd() + self._ce = command_executer.GetCommandExecuter() + self._l = logger.GetLogger() + self._compiler = compiler + self._build = "%s-%s-toolchain-tryjob" % (board, compiler) + self._patches = patches.split(",") if patches else [] + self._patches_string = "_".join(str(p) for p in self._patches) + + if not weekday: + self._weekday = time.strftime("%a") + else: + self._weekday = weekday + self._reports = os.path.join(VALIDATION_RESULT_DIR, compiler, board) + + def DoAll(self): + """Main function inside ToolchainComparator class. + + Launch trybot, get image names, create crosperf experiment file, run + crosperf, and copy images into seven-day report directories. + """ + buildbucket_id, _ = buildbot_utils.GetTrybotImage( + self._chromeos_root, + self._build, + self._patches, + tryjob_flags=["--hwtest"], + asynchronous=True, + ) + + return buildbucket_id def WriteRotatingReportsData(results_dict, date): - """Write data for waterfall report.""" - fname = '%d-%02d-%02d.builds' % (date.year, date.month, date.day) - filename = os.path.join(DATA_DIR, 'rotating-builders', fname) - with open(filename, 'w', encoding='utf-8') as out_file: - for board in results_dict.keys(): - buildbucket_id = results_dict[board] - out_file.write('%s,%s\n' % (buildbucket_id, board)) + """Write data for waterfall report.""" + fname = "%d-%02d-%02d.builds" % (date.year, date.month, date.day) + filename = os.path.join(DATA_DIR, "rotating-builders", fname) + with open(filename, "w", encoding="utf-8") as out_file: + for board in results_dict.keys(): + buildbucket_id = results_dict[board] + out_file.write("%s,%s\n" % (buildbucket_id, board)) def Main(argv): - """The main function.""" - - # Common initializations - command_executer.InitCommandExecuter() - parser = argparse.ArgumentParser() - 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('--board', - default='', - dest='board', - help='The board to test.') - parser.add_argument('--patch', - dest='patches', - default='', - help='The patches to use for the testing, ' - "seprate the patch numbers with ',' " - 'for more than one patches.') - parser.add_argument( - '--compiler', - dest='compiler', - help='Which compiler (llvm, llvm-next or gcc) to use for ' - 'testing.') - - options = parser.parse_args(argv[1:]) - if not options.chromeos_root: - print('Please specify the ChromeOS root directory.') - return 1 - if not options.compiler: - print('Please specify which compiler to test (gcc, llvm, or llvm-next).') - return 1 - - if options.board: - fv = ToolchainVerifier(options.board, options.chromeos_root, - options.weekday, options.patches, options.compiler) - return fv.DoAll() - - today = datetime.date.today() - delta = today - START_DATE - days = delta.days - - start_board = (days * TEST_PER_DAY) % len(TEST_BOARD) - results_dict = dict() - for i in range(TEST_PER_DAY): - try: - board = TEST_BOARD[(start_board + i) % len(TEST_BOARD)] - fv = ToolchainVerifier(board, options.chromeos_root, options.weekday, - options.patches, options.compiler) - buildbucket_id = fv.DoAll() - if buildbucket_id: - results_dict[board] = buildbucket_id - except SystemExit: - logfile = os.path.join(VALIDATION_RESULT_DIR, options.compiler, board) - with open(logfile, 'w', encoding='utf-8') as f: - f.write('Verifier got an exception, please check the log.\n') - WriteRotatingReportsData(results_dict, today) - - -if __name__ == '__main__': - retval = Main(sys.argv) - sys.exit(retval) + """The main function.""" + + # Common initializations + command_executer.InitCommandExecuter() + parser = argparse.ArgumentParser() + 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( + "--board", default="", dest="board", help="The board to test." + ) + parser.add_argument( + "--patch", + dest="patches", + default="", + help="The patches to use for the testing, " + "seprate the patch numbers with ',' " + "for more than one patches.", + ) + parser.add_argument( + "--compiler", + dest="compiler", + help="Which compiler (llvm, llvm-next or gcc) to use for " "testing.", + ) + + options = parser.parse_args(argv[1:]) + if not options.chromeos_root: + print("Please specify the ChromeOS root directory.") + return 1 + if not options.compiler: + print( + "Please specify which compiler to test (gcc, llvm, or llvm-next)." + ) + return 1 + + if options.board: + fv = ToolchainVerifier( + options.board, + options.chromeos_root, + options.weekday, + options.patches, + options.compiler, + ) + return fv.DoAll() + + today = datetime.date.today() + delta = today - START_DATE + days = delta.days + + start_board = (days * TEST_PER_DAY) % len(TEST_BOARD) + results_dict = dict() + for i in range(TEST_PER_DAY): + try: + board = TEST_BOARD[(start_board + i) % len(TEST_BOARD)] + fv = ToolchainVerifier( + board, + options.chromeos_root, + options.weekday, + options.patches, + options.compiler, + ) + buildbucket_id = fv.DoAll() + if buildbucket_id: + results_dict[board] = buildbucket_id + except SystemExit: + logfile = os.path.join( + VALIDATION_RESULT_DIR, options.compiler, board + ) + with open(logfile, "w", encoding="utf-8") as f: + f.write("Verifier got an exception, please check the log.\n") + WriteRotatingReportsData(results_dict, today) + + +if __name__ == "__main__": + retval = Main(sys.argv) + sys.exit(retval) -- cgit v1.2.3 From c0041a9550814e402f661a560855ff99863cffb2 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 6 Sep 2022 12:12:02 -0700 Subject: remove `from __future__ import ...` directives These are only useful when we're running code in a Python 2.7 interpreter. Since we no longer support python2, drop these. BUG=b:244644217 TEST=run_tests_for.py shows no new failures Change-Id: Ief9a12b87a560ab38ca71668636874bcb434a0b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3877339 Reviewed-by: Ryan Beltran Commit-Queue: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- buildbot_test_llvm.py | 1 - 1 file changed, 1 deletion(-) (limited to 'buildbot_test_llvm.py') diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py index 25d269f5..38d3ff49 100755 --- a/buildbot_test_llvm.py +++ b/buildbot_test_llvm.py @@ -16,7 +16,6 @@ well as copying the result into a directory. # Script to test different toolchains against ChromeOS benchmarks. -from __future__ import print_function import argparse import datetime -- cgit v1.2.3 From fdcd39d5de4bd61cee94cf1e26416838d23092b8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Sep 2022 14:19:58 -0400 Subject: Update license boilerplate text in source code files Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icb42e5012a87920c2cd13b666fb3e55e7e4fb3b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3891080 Auto-Submit: Mike Frysinger Tested-by: Mike Frysinger Commit-Queue: George Burgess Reviewed-by: George Burgess --- buildbot_test_llvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildbot_test_llvm.py') diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py index 38d3ff49..57f029c7 100755 --- a/buildbot_test_llvm.py +++ b/buildbot_test_llvm.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# Copyright 2017 The ChromiumOS Authors. All rights reserved. +# Copyright 2017 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -- cgit v1.2.3