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

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

Issue 1378623002: chromium_tests: make IsolatedScript use run_isolated directly, not 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',
47 '7b28d637ab6bb2516584c21e1098736682457f11',
48 args=['--foo'])
49
50 43
51 def GenTests(api): 44 def GenTests(api):
52 def make_test(name, expected_targets, discovered_targets): 45 def make_test(name, expected_targets, discovered_targets):
53 missing = set(expected_targets or []) - set(discovered_targets or []) 46 missing = set(expected_targets or []) - set(discovered_targets or [])
54 output = ( 47 output = (
55 api.test(name) + 48 api.test(name) +
56 api.step_data( 49 api.step_data(
57 'read test spec', stdout=api.json.output(expected_targets)) + 50 'read test spec', stdout=api.json.output(expected_targets)) +
58 api.override_step_data( 51 api.override_step_data(
59 'find isolated tests', api.isolate.output_json(discovered_targets)) 52 'find isolated tests', api.isolate.output_json(discovered_targets))
(...skipping 10 matching lines...) Expand all
70 # No expectations, just discovering what's there returned by default mock. 63 # No expectations, just discovering what's there returned by default mock.
71 yield make_test('discover', None, None) 64 yield make_test('discover', None, None)
72 # Found more than expected. 65 # Found more than expected.
73 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test']) 66 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test'])
74 # Didn't find something. 67 # Didn't find something.
75 yield ( 68 yield (
76 make_test('missing', ['test1', 'test2'], ['test1']) + 69 make_test('missing', ['test1', 'test2'], ['test1']) +
77 api.properties.generic(buildername='Windows Swarm Test')) 70 api.properties.generic(buildername='Windows Swarm Test'))
78 # No expectations, and nothing has been found, produces warning. 71 # No expectations, and nothing has been found, produces warning.
79 yield make_test('none', None, []) 72 yield make_test('none', None, [])
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/isolate/api.py ('k') | scripts/slave/recipe_modules/isolate/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698