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

Side by Side Diff: scripts/slave/recipe_modules/chromium_tests/api.py

Issue 2357343004: chromium_tests: automatically set up test genrators (Closed)
Patch Set: rebase Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import contextlib 6 import contextlib
7 import copy 7 import copy
8 import itertools 8 import itertools
9 import json 9 import json
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 buildername, mastername, enable_swarming, swarming_dimensions, 227 buildername, mastername, enable_swarming, swarming_dimensions,
228 scripts_compile_targets, generators, bot_update_step): 228 scripts_compile_targets, generators, bot_update_step):
229 tests = builder_dict.get('tests', ()) 229 tests = builder_dict.get('tests', ())
230 # TODO(phajdan.jr): Switch everything to scripts generators and simplify. 230 # TODO(phajdan.jr): Switch everything to scripts generators and simplify.
231 for generator in generators: 231 for generator in generators:
232 tests = ( 232 tests = (
233 tuple(generator(api, self, mastername, buildername, test_spec, 233 tuple(generator(api, self, mastername, buildername, test_spec,
234 bot_update_step, enable_swarming=enable_swarming, 234 bot_update_step, enable_swarming=enable_swarming,
235 swarming_dimensions=swarming_dimensions, 235 swarming_dimensions=swarming_dimensions,
236 scripts_compile_targets=scripts_compile_targets)) + 236 scripts_compile_targets=scripts_compile_targets)) +
237 tests) 237 tuple(tests))
238 return tests 238 return tests
239 239
240 def read_test_spec(self, api, test_spec_file): 240 def read_test_spec(self, api, test_spec_file):
241 test_spec_path = api.path['checkout'].join('testing', 'buildbot', 241 test_spec_path = api.path['checkout'].join('testing', 'buildbot',
242 test_spec_file) 242 test_spec_file)
243 test_spec_result = api.json.read( 243 test_spec_result = api.json.read(
244 'read test spec (%s)' % api.path.basename(test_spec_path), 244 'read test spec (%s)' % api.path.basename(test_spec_path),
245 test_spec_path, 245 test_spec_path,
246 step_test_data=lambda: api.json.test_api.output({})) 246 step_test_data=lambda: api.json.test_api.output({}))
247 test_spec_result.presentation.step_text = 'path: %s' % test_spec_path 247 test_spec_result.presentation.step_text = 'path: %s' % test_spec_path
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 targets in |compile_targets|.""" 1016 targets in |compile_targets|."""
1017 result = [] 1017 result = []
1018 for test in tests: 1018 for test in tests:
1019 test_compile_targets = test.compile_targets(api) 1019 test_compile_targets = test.compile_targets(api)
1020 # Always return tests that don't require compile. Otherwise we'd never 1020 # Always return tests that don't require compile. Otherwise we'd never
1021 # run them. 1021 # run them.
1022 if ((set(compile_targets) & set(test_compile_targets)) or 1022 if ((set(compile_targets) & set(test_compile_targets)) or
1023 not test_compile_targets): 1023 not test_compile_targets):
1024 result.append(test) 1024 result.append(test)
1025 return result 1025 return result
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698