Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: testing/buildbot/manage.py

Issue 1203753002: Improve manage.py to automate CL creation further. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@7_components_browsertests
Patch Set: shorten Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/buildbot/manage.py
diff --git a/testing/buildbot/manage.py b/testing/buildbot/manage.py
index b05a1488bff7f8d9c7f908c25c705a59faaf2ea9..0c51aa7039c8c9bc0047026881592463d25e1f1b 100755
--- a/testing/buildbot/manage.py
+++ b/testing/buildbot/manage.py
@@ -93,7 +93,7 @@ def get_isolates():
return [os.path.basename(f) for f in files if f.endswith('.isolate')]
-def process_builder_convert(data, filename, builder, test_name):
+def process_builder_convert(data, test_name):
"""Converts 'test_name' to run on Swarming in 'data'.
Returns True if 'test_name' was found.
@@ -104,7 +104,6 @@ def process_builder_convert(data, filename, builder, test_name):
continue
test.setdefault('swarming', {})
if not test['swarming'].get('can_use_on_swarming_builders'):
- print('- %s: %s' % (filename, builder))
test['swarming']['can_use_on_swarming_builders'] = True
result = True
return result
@@ -124,7 +123,7 @@ def process_builder_remaining(data, filename, builder, tests_location):
def process_file(mode, test_name, tests_location, filepath, ninja_targets,
ninja_targets_seen):
- """Processes a file.
+ """Processes a json file describing what tests should be run for each recipe.
The action depends on mode. Updates tests_location.
@@ -163,10 +162,14 @@ def process_file(mode, test_name, tests_location, filepath, ninja_targets,
config[builder]['gtest_tests'] = sorted(
data['gtest_tests'], key=lambda x: x['test'])
- if mode == 'remaining':
+
+ # The trick here is that process_builder_remaining() is called before
+ # process_builder_convert() so tests_location can be used to know how many
+ # tests were converted.
+ if mode in ('convert', 'remaining'):
process_builder_remaining(data, filename, builder, tests_location)
- elif mode == 'convert':
- process_builder_convert(data, filename, builder, test_name)
+ if mode == 'convert':
+ process_builder_convert(data, test_name)
expected = json.dumps(
config, sort_keys=True, indent=2, separators=(',', ': ')) + '\n'
@@ -183,7 +186,26 @@ def process_file(mode, test_name, tests_location, filepath, ninja_targets,
return True
-def print_remaining(test_name,tests_location):
+def print_convert(test_name, tests_location):
+ """Prints statistics for a test being converted for use in a CL description.
+ """
+ data = tests_location[test_name]
+ print('Convert %s to run exclusively on Swarming' % test_name)
+ print('')
+ print('%d configs already ran on Swarming' % data['count_run_on_swarming'])
+ print('%d used to run locally and were converted:' % data['count_run_local'])
+ for master, builders in sorted(data['local_configs'].iteritems()):
+ for builder in builders:
+ print('- %s: %s' % (master, builder))
+ print('')
+ print('Ran:')
+ print(' ./manage.py --convert %s' % test_name)
+ print('')
+ print('R=')
+ print('BUG=98637')
+
+
+def print_remaining(test_name, tests_location):
"""Prints a visual summary of what tests are yet to be converted to run on
Swarming.
"""
@@ -283,7 +305,9 @@ def main():
raise Error('%s listed in ninja_to_gn.pyl but not in any .json files' %
extra_targets_str)
- if args.mode == 'remaining':
+ if args.mode == 'convert':
+ print_convert(args.test_name, tests_location)
+ elif args.mode == 'remaining':
print_remaining(args.test_name, tests_location)
return result
except Error as e:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698