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

Side by Side Diff: scripts/slave/recipe_modules/isolate/example.py

Issue 1374943002: isolate: add run_isolated, deprecate runtest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 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 | Annotate | Revision Log
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 DEPS = [ 5 DEPS = [
6 'chromium', 6 'chromium',
7 'isolate', 7 'isolate',
8 'json', 8 'json',
9 'path', 9 'path',
10 'properties', 10 'properties',
(...skipping 22 matching lines...) Expand all
33 # TODO(vadimsh): This step doesn't actually make any sense when the recipe 33 # TODO(vadimsh): This step doesn't actually make any sense when the recipe
34 # is running for real via run_recipe.py. 34 # is running for real via run_recipe.py.
35 api.isolate.find_isolated_tests(api.path['build'], expected_targets) 35 api.isolate.find_isolated_tests(api.path['build'], expected_targets)
36 36
37 # Code coverage for 'isolate_tests'. 'isolated_test' doesn't support discovery 37 # Code coverage for 'isolate_tests'. 'isolated_test' doesn't support discovery
38 # of isolated targets in build directory, so skip if 'expected_targets' is 38 # of isolated targets in build directory, so skip if 'expected_targets' is
39 # None. 39 # None.
40 if expected_targets is not None: 40 if expected_targets is not None:
41 api.isolate.isolate_tests(api.path['build'], expected_targets) 41 api.isolate.isolate_tests(api.path['build'], expected_targets)
42 42
43 # Code coverage for 'run_isolated'.
44 # TODO(phajdan.jr): Remove once used by other recipes.
45 api.isolate.run_isolated(
46 'base_unittests', '7b28d637ab6bb2516584c21e1098736682457f11')
47
43 48
44 def GenTests(api): 49 def GenTests(api):
45 def make_test(name, expected_targets, discovered_targets): 50 def make_test(name, expected_targets, discovered_targets):
46 missing = set(expected_targets or []) - set(discovered_targets or []) 51 missing = set(expected_targets or []) - set(discovered_targets or [])
47 output = ( 52 output = (
48 api.test(name) + 53 api.test(name) +
49 api.step_data( 54 api.step_data(
50 'read test spec', stdout=api.json.output(expected_targets)) + 55 'read test spec', stdout=api.json.output(expected_targets)) +
51 api.override_step_data( 56 api.override_step_data(
52 'find isolated tests', api.isolate.output_json(discovered_targets)) 57 'find isolated tests', api.isolate.output_json(discovered_targets))
(...skipping 10 matching lines...) Expand all
63 # No expectations, just discovering what's there returned by default mock. 68 # No expectations, just discovering what's there returned by default mock.
64 yield make_test('discover', None, None) 69 yield make_test('discover', None, None)
65 # Found more than expected. 70 # Found more than expected.
66 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test']) 71 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test'])
67 # Didn't find something. 72 # Didn't find something.
68 yield ( 73 yield (
69 make_test('missing', ['test1', 'test2'], ['test1']) + 74 make_test('missing', ['test1', 'test2'], ['test1']) +
70 api.properties.generic(buildername='Windows Swarm Test')) 75 api.properties.generic(buildername='Windows Swarm Test'))
71 # No expectations, and nothing has been found, produces warning. 76 # No expectations, and nothing has been found, produces warning.
72 yield make_test('none', None, []) 77 yield make_test('none', None, [])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698