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

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

Issue 448343002: Makes filter step continue on if error (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: add hello step Created 6 years, 4 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
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 'filter', 7 'filter',
8 'json', 8 'json',
9 'path', 9 'path',
10 'properties', 10 'properties',
11 'raw_io', 11 'raw_io',
12 'step',
12 ] 13 ]
13 14
14 def GenSteps(api): 15 def GenSteps(api):
15 api.path['checkout'] = api.path['slave_build'] 16 api.path['checkout'] = api.path['slave_build']
16 api.chromium.set_config('chromium') 17 api.chromium.set_config('chromium')
17 api.filter.does_patch_require_compile() 18 api.filter.does_patch_require_compile()
18 assert (api.filter.result and api.properties['example_result']) or \ 19 assert (api.filter.result and api.properties['example_result']) or \
19 (not api.filter.result and not api.properties['example_result']) 20 (not api.filter.result and not api.properties['example_result'])
20 assert (not api.properties['example_matching_exes'] or 21 assert (not api.properties['example_matching_exes'] or
21 list(api.properties['example_matching_exes']) == 22 list(api.properties['example_matching_exes']) ==
22 api.filter.matching_exes) 23 api.filter.matching_exes)
24 api.step('hello', ['echo', 'Why hello, there.'])
23 25
24 def GenTests(api): 26 def GenTests(api):
25 # Trivial test with no exclusions and nothing matching. 27 # Trivial test with no exclusions and nothing matching.
26 yield (api.test('basic') + 28 yield (api.test('basic') +
27 api.properties(filter_exclusions=[]) + 29 api.properties(filter_exclusions=[]) +
28 api.properties(example_result=None) + 30 api.properties(example_result=None) +
29 api.properties(example_matching_exes=None) + 31 api.properties(example_matching_exes=None) +
30 api.override_step_data( 32 api.override_step_data(
31 'git diff to analyze patch', 33 'git diff to analyze patch',
32 api.raw_io.stream_output('yy'))) 34 api.raw_io.stream_output('yy')))
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 'targets': ['foo']}))) 71 'targets': ['foo']})))
70 72
71 # Analyze with error condition. 73 # Analyze with error condition.
72 yield (api.test('analyzes_error') + 74 yield (api.test('analyzes_error') +
73 api.properties(matching_exes=None) + 75 api.properties(matching_exes=None) +
74 api.properties(example_matching_exes=None) + 76 api.properties(example_matching_exes=None) +
75 api.properties(example_result=1) + 77 api.properties(example_result=1) +
76 api.override_step_data( 78 api.override_step_data(
77 'analyze', 79 'analyze',
78 api.json.output({'error': 'ERROR'}))) 80 api.json.output({'error': 'ERROR'})))
81
82 # Analyze with python returning bad status.
83 yield (api.test('bad_retcode_doesnt_fail') +
84 api.properties(matching_exes=None) +
85 api.properties(example_matching_exes=None) +
86 api.properties(example_result=1) +
87 api.step_data(
88 'analyze',
89 retcode=-1))
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/filter/api.py ('k') | scripts/slave/recipe_modules/filter/example.expected/analyzes_error.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698