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

Side by Side Diff: scripts/slave/recipes/chromium_trybot.py

Issue 1933223002: Chromium: make use of new get_files_affected_by_patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 6
7 from recipe_engine.types import freeze 7 from recipe_engine.types import freeze
8 8
9 DEPS = [ 9 DEPS = [
10 'depot_tools/bot_update', 10 'depot_tools/bot_update',
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 return result 82 return result
83 83
84 84
85 def all_compile_targets(api, tests): 85 def all_compile_targets(api, tests):
86 """Returns the compile_targets for all the Tests in |tests|.""" 86 """Returns the compile_targets for all the Tests in |tests|."""
87 return sorted(set(x 87 return sorted(set(x
88 for test in tests 88 for test in tests
89 for x in test.compile_targets(api))) 89 for x in test.compile_targets(api)))
90 90
91 def _get_files_affected_by_patch(api):
Paweł Hajdan Jr. 2016/05/02 09:29:02 Could you move this to chromium_tests recipe modul
tandrii(chromium) 2016/05/02 09:51:18 Done.
92 """Returns list of posix paths relative to 'src'."""
93 patch_root = api.gclient.calculate_patch_root(
94 api.properties.get('patch_project'))
95 affected_files = map(str,
96 api.tryserver.get_files_affected_by_patch(patch_root))
97
98 # patch_root includes src and affected_files are now relative to patch_root.
Paweł Hajdan Jr. 2016/05/02 09:29:02 Can we make this more generic? When moved to chrom
tandrii(chromium) 2016/05/02 09:51:18 Hm, not quite sure I understood you, but see what
99 # "analyze" wants these relative to 'src'.
100 assert str(patch_root).startswith('src')
101 for i, path in enumerate(affected_files):
102 assert path.startswith('src/')
103 affected_files[i] = path[len('src/'):]
104 return affected_files
105
91 106
92 def is_source_file(api, filepath): 107 def is_source_file(api, filepath):
93 """Returns true iff the file is a source file.""" 108 """Returns true iff the file is a source file."""
94 _, ext = api.path.splitext(filepath) 109 _, ext = api.path.splitext(filepath)
95 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm'] 110 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm']
96 111
97 def _RunStepsInternal(api): 112 def _RunStepsInternal(api):
98 def _get_bot_config(mastername, buildername): 113 def _get_bot_config(mastername, buildername):
99 master_dict = api.chromium_tests.trybots.get(mastername, {}) 114 master_dict = api.chromium_tests.trybots.get(mastername, {})
100 return master_dict.get('builders', {}).get(buildername) 115 return master_dict.get('builders', {}).get(buildername)
(...skipping 19 matching lines...) Expand all
120 135
121 bot_update_step, bot_db = api.chromium_tests.prepare_checkout( 136 bot_update_step, bot_db = api.chromium_tests.prepare_checkout(
122 bot_config_object) 137 bot_config_object)
123 138
124 tests, tests_including_triggered = api.chromium_tests.get_tests( 139 tests, tests_including_triggered = api.chromium_tests.get_tests(
125 bot_config_object, bot_db) 140 bot_config_object, bot_db)
126 def add_tests(additional_tests): 141 def add_tests(additional_tests):
127 tests.extend(additional_tests) 142 tests.extend(additional_tests)
128 tests_including_triggered.extend(additional_tests) 143 tests_including_triggered.extend(additional_tests)
129 144
130 affected_files = api.tryserver.get_files_affected_by_patch() 145 affected_files = _get_files_affected_by_patch(api)
131 146
132 affects_blink_paths = False 147 affects_blink_paths = False
133 for path in CHROMIUM_BLINK_TESTS_PATHS: 148 for path in CHROMIUM_BLINK_TESTS_PATHS:
134 if any([f.startswith(path) for f in affected_files]): 149 if any([f.startswith(path) for f in affected_files]):
135 affects_blink_paths = True 150 affects_blink_paths = True
136 151
137 affects_blink = any([f.startswith('third_party/WebKit') 152 affects_blink = any([f.startswith('third_party/WebKit')
138 for f in affected_files]) 153 for f in affected_files])
139 154
140 if affects_blink: 155 if affects_blink:
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 props(mastername='tryserver.v8', 911 props(mastername='tryserver.v8',
897 buildername='v8_linux_blink_rel', 912 buildername='v8_linux_blink_rel',
898 patch_project='v8') + 913 patch_project='v8') +
899 api.platform.name('linux') + 914 api.platform.name('linux') +
900 suppress_analyze(more_exclusions=['v8/f.*']) + 915 suppress_analyze(more_exclusions=['v8/f.*']) +
901 api.override_step_data('webkit_tests (with patch)', 916 api.override_step_data('webkit_tests (with patch)',
902 api.test_utils.canned_test_output(passing=False)) + 917 api.test_utils.canned_test_output(passing=False)) +
903 api.override_step_data('webkit_tests (without patch)', 918 api.override_step_data('webkit_tests (without patch)',
904 api.test_utils.canned_test_output(passing=True, minimal=True)) 919 api.test_utils.canned_test_output(passing=True, minimal=True))
905 ) 920 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698