Chromium Code Reviews| Index: testing/buildbot/manage.py |
| diff --git a/testing/buildbot/manage.py b/testing/buildbot/manage.py |
| index 98de7ef4b04356b5ff0635db03ee7bdde9a5095a..9cb5e257371a5878745bfe862217f1022798e514 100755 |
| --- a/testing/buildbot/manage.py |
| +++ b/testing/buildbot/manage.py |
| @@ -10,6 +10,7 @@ formatted. |
| """ |
| import argparse |
| +import ast |
| import collections |
| import glob |
| import json |
| @@ -51,6 +52,14 @@ SKIP = { |
| } |
| +# TODO(GYP): These targets have not been ported to GN yet. |
| +SKIP_NINJA_TO_GN_TARGETS = { |
| + 'cast_media_unittests', |
| + 'cast_shell_browser_test', |
| + 'chromevox_tests', |
| +} |
| + |
| + |
| class Error(Exception): |
| """Processing error.""" |
| @@ -90,7 +99,8 @@ def process_builder_remaining(data, filename, builder, tests_location): |
| filename, []).append(builder) |
| -def process_file(mode, test_name, tests_location, filepath): |
| +def process_file(mode, test_name, tests_location, filepath, ninja_targets, |
| + ninja_targets_seen): |
| """Processes a file. |
| The action depends on mode. Updates tests_location. |
| @@ -120,6 +130,14 @@ def process_file(mode, test_name, tests_location, filepath): |
| raise Error( |
| '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) |
| + for d in data['gtest_tests']: |
| + if (not d['test'] in ninja_targets and |
|
Paweł Hajdan Jr.
2015/06/10 09:30:08
nit: Consider "d['test'] not in ninja_targets" ins
Dirk Pranke
2015/06/10 16:07:59
will fix.
|
| + d['test'] not in SKIP_NINJA_TO_GN_TARGETS): |
| + raise Error('%s: %s / %s is not listed in ninja_to_gn.pyl.' % |
| + (filename, builder, d['test'])) |
| + elif d['test'] in ninja_targets: |
| + ninja_targets_seen.add(d['test']) |
| + |
| config[builder]['gtest_tests'] = sorted( |
| data['gtest_tests'], key=lambda x: x['test']) |
| if mode == 'remaining': |
| @@ -222,12 +240,26 @@ def main(): |
| 'count_run_local': 0, 'count_run_on_swarming': 0, 'local_configs': {} |
| }) |
| + with open(os.path.join(THIS_DIR, "ninja_to_gn.pyl")) as fp: |
| + ninja_targets = ast.literal_eval(fp.read()) |
| + |
| try: |
| result = 0 |
| + ninja_targets_seen = set() |
| for filepath in glob.glob(os.path.join(THIS_DIR, '*.json')): |
| - if not process_file(args.mode, args.test_name, tests_location, filepath): |
| + if not process_file(args.mode, args.test_name, tests_location, filepath, |
| + ninja_targets, ninja_targets_seen): |
| result = 1 |
| + extra_targets = set(ninja_targets.keys()) - ninja_targets_seen |
|
M-A Ruel
2015/06/10 14:53:40
set(ninja_targets)
Dirk Pranke
2015/06/10 16:07:59
will fix.
|
| + if extra_targets: |
| + if len(extra_targets) > 1: |
| + extra_targets_str = ', '.join(extra_targets) + ' are' |
| + else: |
| + extra_targets_str = list(extra_targets)[0] + ' is' |
| + raise Error('%s listed in ninja_to_gn.pyl but not in any .json files' % |
| + extra_targets_str) |
| + |
| if args.mode == 'remaining': |
| print_remaining(args.test_name, tests_location) |
| return result |