Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
| 4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
| 5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
| 8 | 8 |
| 9 import json | |
| 9 import os | 10 import os |
| 11 import platform | |
| 10 import re | 12 import re |
| 13 import subprocess | |
| 11 import sys | 14 import sys |
| 12 | 15 |
| 13 | 16 |
| 14 def _CheckNoIOStreamInHeaders(input_api, output_api): | 17 def _CheckNoIOStreamInHeaders(input_api, output_api): |
| 15 """Checks to make sure no .h files include <iostream>.""" | 18 """Checks to make sure no .h files include <iostream>.""" |
| 16 files = [] | 19 files = [] |
| 17 pattern = input_api.re.compile(r'^#include\s*<iostream>', | 20 pattern = input_api.re.compile(r'^#include\s*<iostream>', |
| 18 input_api.re.MULTILINE) | 21 input_api.re.MULTILINE) |
| 19 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): | 22 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): |
| 20 if not f.LocalPath().endswith('.h'): | 23 if not f.LocalPath().endswith('.h'): |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 328 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 326 input_api, output_api)) | 329 input_api, output_api)) |
| 327 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 330 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
| 328 input_api, output_api)) | 331 input_api, output_api)) |
| 329 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 332 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 330 input_api, output_api, | 333 input_api, output_api, |
| 331 json_url='http://webrtc-status.appspot.com/current?format=json')) | 334 json_url='http://webrtc-status.appspot.com/current?format=json')) |
| 332 return results | 335 return results |
| 333 | 336 |
| 334 | 337 |
| 335 def GetDefaultTryConfigs(bots=None): | |
| 336 """Returns a list of ('bot', set(['tests']), optionally filtered by [bots]. | |
| 337 | |
| 338 For WebRTC purposes, we always return an empty list of tests, since we want | |
| 339 to run all tests by default on all our trybots. | |
| 340 """ | |
| 341 return {'tryserver.webrtc': dict((bot, []) for bot in bots)} | |
| 342 | |
| 343 | |
| 344 # pylint: disable=W0613 | 338 # pylint: disable=W0613 |
| 345 def GetPreferredTryMasters(project, change): | 339 def GetPreferredTryMasters(project, change): |
| 346 files = change.LocalPaths() | 340 cq_config_path = os.path.join( |
| 341 change.RepositoryRoot(), 'infra', 'config', 'cq.cfg') | |
| 342 # commit_queue.py below is a script in depot_tools directory, which has a | |
| 343 # 'builders' command to retrieve a list of CQ builders from the CQ config. | |
| 344 is_win = platform.system() == 'Windows' | |
| 345 masters = json.loads(subprocess.check_output( | |
| 346 ['commit_queue', 'builders', cq_config_path], shell=is_win)) | |
| 347 | 347 |
| 348 android_gn_bots = [ | 348 # Explicitly iterate over copies of keys since we mutate them. |
|
Sergiy Byelozyorov
2015/06/16 09:18:52
Actually, we are deprecating support for propertie
kjellander_webrtc
2015/06/16 09:27:27
Thanks. Updated in PS#3.
| |
| 349 'android_gn', | 349 for master in masters.keys(): |
| 350 'android_gn_rel', | 350 for builder in masters[master].keys(): |
| 351 ] | 351 # Do not trigger presubmit builders, since they're likely to fail, |
| 352 android_bots = [ | 352 # e.g. OWNERS checks before finished code review), and we're running |
| 353 'android', | 353 # local presubmit anyway. |
| 354 'android_arm64_rel', | 354 if 'presubmit' in builder: |
| 355 'android_rel', | 355 masters[master].pop(builder) |
| 356 'android_clang', | 356 else: |
| 357 ] + android_gn_bots | 357 # Convert testfilter format to the one expected by git-cl-try. |
| 358 ios_bots = [ | 358 testfilter = masters[master][builder].get('testfilter', 'defaulttests') |
| 359 'ios', | 359 masters[master][builder] = [testfilter] |
| 360 'ios_arm64', | |
| 361 'ios_arm64_rel', | |
| 362 'ios_rel', | |
| 363 'ios32_sim', | |
| 364 'ios64_sim', | |
| 365 ] | |
| 366 linux_gn_bots = [ | |
| 367 'linux_gn', | |
| 368 'linux_gn_rel', | |
| 369 ] | |
| 370 linux_bots = [ | |
| 371 'linux', | |
| 372 'linux_asan', | |
| 373 'linux_baremetal', | |
| 374 'linux_msan', | |
| 375 'linux_rel', | |
| 376 'linux_tsan2', | |
| 377 ] + linux_gn_bots | |
| 378 mac_gn_bots = [ | |
| 379 'mac_x64_gn', | |
| 380 'mac_x64_gn_rel', | |
| 381 ] | |
| 382 mac_bots = [ | |
| 383 'mac', | |
| 384 'mac_asan', | |
| 385 'mac_baremetal', | |
| 386 'mac_rel', | |
| 387 'mac_x64', | |
| 388 'mac_x64_rel', | |
| 389 ] + mac_gn_bots | |
| 390 win_gn_bots = [ | |
| 391 'win_x64_gn', | |
| 392 'win_x64_gn_rel', | |
| 393 ] | |
| 394 win_bots = [ | |
| 395 'win', | |
| 396 'win_baremetal', | |
| 397 'win_drmemory_light', | |
| 398 'win_rel', | |
| 399 'win_x64_rel', | |
| 400 ] + win_gn_bots | |
| 401 if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): | |
| 402 return {} | |
| 403 if all(re.search(r'[\\/]BUILD.gn$', f) for f in files): | |
| 404 return GetDefaultTryConfigs(android_gn_bots + linux_gn_bots + mac_gn_bots + | |
| 405 win_gn_bots) | |
| 406 if all(re.search('[/_]mac[/_.]', f) for f in files): | |
| 407 return GetDefaultTryConfigs(mac_bots) | |
| 408 if all(re.search('(^|[/_])win[/_.]', f) for f in files): | |
| 409 return GetDefaultTryConfigs(win_bots) | |
| 410 if all(re.search('(^|[/_])android[/_.]', f) for f in files): | |
| 411 return GetDefaultTryConfigs(android_bots) | |
| 412 if all(re.search('[/_]ios[/_.]', f) for f in files): | |
| 413 return GetDefaultTryConfigs(ios_bots) | |
| 414 | 360 |
| 415 return GetDefaultTryConfigs(android_bots + ios_bots + linux_bots + mac_bots + | 361 return masters |
| 416 win_bots) | |
| OLD | NEW |