GoogleGit

blob: 80a70bfceea94bf71c95cc8ec7d25a16cf3ca01c [file] [log] [blame]
  1. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. """Utility class to build the chromium master BuildFactory's.
  5. Based on gclient_factory.py and adds chromium-specific steps."""
  6. import re
  7. from master.factory import chromium_commands
  8. from master.factory import gclient_factory
  9. import config
  10. # This is kind of the wrong place for this, but it is the only place apart
  11. # from master_config imported by all the configs that need this list.
  12. blink_tests = [
  13. 'blink_heap_unittests',
  14. 'blink_platform_unittests',
  15. 'webkit',
  16. 'webkit_lint',
  17. 'webkit_python_tests',
  18. 'webkit_unit_tests',
  19. 'wtf_unittests',
  20. ]
  21. # These are run on the non-blink tryservers. We don't run the layout tests
  22. # because they are slow, and we don't run the python tests because there's no
  23. # need to on chromium jobs.
  24. blink_tests_for_chromium_tryjobs = [
  25. 'blink_heap_unittests_br',
  26. 'blink_platform_unittests_br',
  27. 'webkit_unit_tests_br',
  28. 'wtf_unittests_br',
  29. ]
  30. # These are run on the blink tryservers; the 'webkit' step is not run
  31. # under buildrunner because it needs to archive things.
  32. blink_tests_for_blink_tryjobs = blink_tests_for_chromium_tryjobs + [
  33. 'buildrunner_tests',
  34. 'webkit',
  35. 'webkit_lint_br',
  36. 'webkit_python_tests_br',
  37. ]
  38. def ForceComponent(target, project, gclient_env):
  39. # Force all bots to specify the "Component" gyp variables, unless it is
  40. # already set.
  41. gyp_defines = gclient_env.setdefault('GYP_DEFINES', '')
  42. if ('component=' not in gyp_defines and
  43. # build_for_tool=drmemory wants the component build (crbug.com/137180).
  44. 'build_for_tool=memcheck' not in gyp_defines and
  45. 'build_for_tool=tsan' not in gyp_defines):
  46. if target == 'Debug' or target == 'Debug_x64':
  47. component = 'shared_library'
  48. else:
  49. component = 'static_library'
  50. gclient_env['GYP_DEFINES'] = gyp_defines + ' component=' + component
  51. class ChromiumFactory(gclient_factory.GClientFactory):
  52. """Encapsulates data and methods common to the chromium master.cfg files."""
  53. DEFAULT_TARGET_PLATFORM = config.Master.default_platform
  54. MEMORY_TOOLS_GYP_DEFINES = 'build_for_tool=memcheck'
  55. # gclient custom vars
  56. CUSTOM_VARS_GOOGLECODE_URL = ('googlecode_url', config.Master.googlecode_url)
  57. CUSTOM_VARS_SOURCEFORGE_URL = ('sourceforge_url',
  58. config.Master.sourceforge_url)
  59. CUSTOM_VARS_LLVM_URL = ('llvm_url', config.Master.llvm_url)
  60. CUSTOM_VARS_WEBKIT_MIRROR = ('webkit_trunk', config.Master.webkit_trunk_url)
  61. CUSTOM_VARS_NACL_TRUNK_URL = ('nacl_trunk', config.Master.nacl_trunk_url)
  62. # safe sync urls
  63. SAFESYNC_URL_CHROMIUM = 'http://chromium-status.appspot.com/lkgr'
  64. # gclient additional custom deps
  65. CUSTOM_DEPS_AVPERF = ('src/chrome/test/data/media/avperf',
  66. config.Master.trunk_url + '/deps/avperf')
  67. CUSTOM_VARS_NACL_LATEST = [
  68. ('nacl_revision', '$$NACL_REV$$'),
  69. ]
  70. CUSTOM_DEPS_VALGRIND = ('src/third_party/valgrind',
  71. config.Master.trunk_url + '/deps/third_party/valgrind/binaries')
  72. CUSTOM_DEPS_DEVTOOLS_PERF = [
  73. ('src/third_party/WebKit/PerformanceTests',
  74. config.Master.webkit_trunk_url + '/PerformanceTests'),
  75. ('src/third_party/WebKit/LayoutTests/http/tests/inspector',
  76. config.Master.webkit_trunk_url + '/LayoutTests/http/tests/inspector'),
  77. ('src/third_party/WebKit/LayoutTests/inspector',
  78. config.Master.webkit_trunk_url + '/LayoutTests/inspector'),
  79. ]
  80. CUSTOM_DEPS_TSAN_WIN = ('src/third_party/tsan',
  81. config.Master.trunk_url + '/deps/third_party/tsan')
  82. CUSTOM_DEPS_NACL_VALGRIND = ('src/third_party/valgrind/bin',
  83. config.Master.nacl_trunk_url + '/src/third_party/valgrind/bin')
  84. CUSTOM_DEPS_WEBDRIVER_JAVA_TESTS = (
  85. 'src/chrome/test/chromedriver/third_party/java_tests',
  86. config.Master.trunk_url + '/deps/third_party/webdriver')
  87. CUSTOM_DEPS_GYP = [
  88. ('src/tools/gyp', 'http://gyp.googlecode.com/svn/trunk')]
  89. CUSTOM_DEPS_GIT_INTERNAL = [
  90. ('src/third_party/adobe/flash/symbols/ppapi/mac', None),
  91. ('src/third_party/adobe/flash/symbols/ppapi/mac_64', None),
  92. ('src/third_party/adobe/flash/symbols/ppapi/linux', None),
  93. ('src/third_party/adobe/flash/symbols/ppapi/linux_x64', None),
  94. ('src/third_party/adobe/flash/symbols/ppapi/win', None),
  95. ('src/third_party/adobe/flash/symbols/ppapi/win_x64', None),
  96. ]
  97. # Mapping of repositories to got_xx_revision variables.
  98. CHROMIUM_GOT_REVISION_MAPPINGS = {
  99. 'src': 'got_revision',
  100. 'src/third_party/WebKit': 'got_webkit_revision',
  101. 'src/tools/swarming_client': 'got_swarming_client_revision',
  102. 'src/v8': 'got_v8_revision',
  103. }
  104. # A map used to skip dependencies when a test is not run.
  105. # The map key is the test name. The map value is an array containing the
  106. # dependencies that are not needed when this test is not run.
  107. NEEDED_COMPONENTS = {
  108. '^(webkit)$':
  109. [('src/third_party/WebKit/LayoutTests', None)],
  110. }
  111. NEEDED_COMPONENTS_INTERNAL = {
  112. 'memory':
  113. [('src/data/memory_test', None)],
  114. 'page_cycler':
  115. [('src/data/page_cycler', None)],
  116. 'selenium':
  117. [('src/data/selenium_core', None)],
  118. 'browser_tests':
  119. [('src/chrome/test/data/firefox2_profile/searchplugins', None),
  120. ('src/chrome/test/data/firefox2_searchplugins', None),
  121. ('src/chrome/test/data/firefox3_profile/searchplugins', None),
  122. ('src/chrome/test/data/firefox3_searchplugins', None),
  123. ('src/chrome/test/data/ssl/certs', None)],
  124. 'unit':
  125. [('src/chrome/test/data/osdd', None)],
  126. '^(webkit|content_unittests)$':
  127. [('src/webkit/data/bmp_decoder', None),
  128. ('src/webkit/data/ico_decoder', None),
  129. ('src/webkit/data/test_shell/plugins', None),
  130. ('src/webkit/data/xbm_decoder', None)],
  131. 'mach_ports':
  132. [('src/data/mach_ports', None)],
  133. # Unused stuff:
  134. 'autodiscovery':
  135. [('src/data/autodiscovery', None)],
  136. 'esctf':
  137. [('src/data/esctf', None)],
  138. 'grit':
  139. [('src/tools/grit/grit/test/data', None)],
  140. 'mozilla_js':
  141. [('src/data/mozilla_js_tests', None)],
  142. }
  143. # pylint: disable=E1101
  144. if config.Master.trunk_internal_url:
  145. CUSTOM_DEPS_DEVTOOLS_PERF.append(('src/data/devtools_test_pages',
  146. config.Master.trunk_internal_url +
  147. '/data/devtools_test_pages'))
  148. def __init__(self, build_dir, target_platform=None, pull_internal=True,
  149. full_checkout=False, additional_repos=None, name=None,
  150. custom_deps_list=None, nohooks_on_update=False, target_os=None,
  151. swarm_client_canary=False, internal_custom_deps_list=None,
  152. got_revision_mapping_overrides=None):
  153. if full_checkout:
  154. needed_components = None
  155. else:
  156. needed_components = self.NEEDED_COMPONENTS
  157. main = gclient_factory.GClientSolution(config.Master.trunk_url_src,
  158. needed_components=needed_components,
  159. name=name,
  160. custom_deps_list=custom_deps_list,
  161. custom_vars_list=[self.CUSTOM_VARS_WEBKIT_MIRROR,
  162. self.CUSTOM_VARS_GOOGLECODE_URL,
  163. self.CUSTOM_VARS_SOURCEFORGE_URL,
  164. self.CUSTOM_VARS_LLVM_URL,
  165. self.CUSTOM_VARS_NACL_TRUNK_URL])
  166. solutions = [main]
  167. if config.Master.trunk_internal_url_src and pull_internal:
  168. if full_checkout:
  169. needed_components = None
  170. else:
  171. needed_components = self.NEEDED_COMPONENTS_INTERNAL
  172. internal = gclient_factory.GClientSolution(
  173. config.Master.trunk_internal_url_src,
  174. needed_components=needed_components,
  175. custom_deps_list=internal_custom_deps_list)
  176. solutions.append(internal)
  177. additional_repos = additional_repos or []
  178. for name, url in additional_repos:
  179. solution = gclient_factory.GClientSolution(url, name=name)
  180. solutions.append(solution)
  181. got_rev_mappings = self.CHROMIUM_GOT_REVISION_MAPPINGS
  182. if got_revision_mapping_overrides:
  183. # We need to reverse the key/value in the got revision mapping dict
  184. # because values are unique and keys are not.
  185. bw_mappings = dict(
  186. (v, k) for k, v in got_rev_mappings.iteritems())
  187. bw_mapping_overrides = dict(
  188. (v, k) for k, v in got_revision_mapping_overrides.iteritems())
  189. bw_mappings.update(bw_mapping_overrides)
  190. got_rev_mappings = dict(
  191. (v, k) for k, v in bw_mappings.iteritems())
  192. got_rev_mappings.update(got_revision_mapping_overrides)
  193. gclient_factory.GClientFactory.__init__(self,
  194. build_dir, solutions, target_platform=target_platform,
  195. nohooks_on_update=nohooks_on_update, target_os=target_os,
  196. revision_mapping=got_rev_mappings)
  197. if swarm_client_canary:
  198. # Contrary to other canaries like blink, v8, we don't really care about
  199. # having one build per swarm_client commits by having an additional source
  200. # change listener so just fetching @ToT all the time is good enough.
  201. self._solutions[0].custom_vars_list.append(('swarming_revision', ''))
  202. def _AddTests(self, factory_cmd_obj, tests, mode=None,
  203. factory_properties=None):
  204. """Add the tests listed in 'tests' to the factory_cmd_obj."""
  205. factory_properties = factory_properties or {}
  206. tests = (tests or [])[:]
  207. # This function is too crowded, try to simplify it a little.
  208. def R(*testnames):
  209. for test in testnames:
  210. if gclient_factory.ShouldRunTest(tests, test):
  211. tests.remove(test)
  212. return True
  213. f = factory_cmd_obj
  214. fp = factory_properties
  215. # Copy perf expectations from slave to master for use later.
  216. if factory_properties.get('expectations'):
  217. f.AddUploadPerfExpectations(factory_properties)
  218. # When modifying the order of the tests here, please take
  219. # http://build.chromium.org/buildbot/waterfall/stats into account.
  220. # Tests that fail more often should be earlier in the queue.
  221. # Check for goma
  222. if R('diagnose_goma'):
  223. f.AddDiagnoseGomaStep()
  224. # Run interactive_ui_tests first to make sure it does not fail if another
  225. # test running before it leaks a window or a popup (crash dialog, etc).
  226. if R('interactive_ui_tests'):
  227. f.AddGTestTestStep('interactive_ui_tests', fp)
  228. if R('interactive_ui_tests_br'):
  229. f.AddBuildrunnerGTest('interactive_ui_tests', fp)
  230. # interactive_ui_tests specifically for Instant Extended.
  231. if R('instant_extended_manual_tests'):
  232. arg_list = [
  233. '--gtest_filter=InstantExtendedManualTest.*',
  234. '--run-manual',
  235. '--enable-benchmarking',
  236. '--enable-stats-table',
  237. '--ignore-certificate-errors',
  238. ]
  239. f.AddBuildrunnerGTest('interactive_ui_tests', factory_properties=fp,
  240. arg_list=arg_list)
  241. # Scripted checks to verify various properties of the codebase:
  242. if R('check_deps'):
  243. f.AddCheckDepsStep()
  244. if R('check_deps_br'):
  245. f.AddBuildrunnerCheckDepsStep()
  246. if R('check_bins'):
  247. f.AddCheckBinsStep()
  248. if R('check_bins_br'):
  249. f.AddBuildrunnerCheckBinsStep()
  250. if R('check_perms'):
  251. f.AddCheckPermsStep()
  252. if R('check_perms_br'):
  253. f.AddBuildrunnerCheckPermsStep()
  254. if R('check_licenses'):
  255. f.AddCheckLicensesStep(fp)
  256. if R('check_licenses_br'):
  257. f.AddBuildrunnerCheckLicensesStep(fp)
  258. # Small ("module") unit tests:
  259. if R('accessibility_unittests'):
  260. f.AddGTestTestStep('accessibility_unittests', fp)
  261. if R('accessibility_unittests_br'):
  262. f.AddBuildrunnerGTest('accessibility_unittests', fp)
  263. if R('base_unittests'):
  264. f.AddGTestTestStep('base_unittests', fp)
  265. if R('base_unittests_br'):
  266. f.AddBuildrunnerGTest('base_unittests', fp)
  267. if R('cacheinvalidation_unittests'):
  268. f.AddGTestTestStep('cacheinvalidation_unittests', fp)
  269. if R('cacheinvalidation_br'):
  270. f.AddBuildrunnerGTest('cacheinvalidation_unittests', fp)
  271. if R('cast', 'cast_unittests'):
  272. f.AddGTestTestStep('cast_unittests', fp)
  273. if R('cast_br'):
  274. f.AddBuildrunnerGTest('cast_unittests', fp)
  275. if R('cc_unittests'):
  276. f.AddGTestTestStep('cc_unittests', fp)
  277. if R('cc_unittests_br'):
  278. f.AddBuildrunnerGTest('cc_unittests', fp)
  279. if R('chromedriver_unittests'):
  280. f.AddGTestTestStep('chromedriver_unittests', fp)
  281. if R('chromedriver_unittests_br'):
  282. f.AddBuildrunnerGTest('chromedriver_unittests', fp)
  283. if R('chromeos_unittests'):
  284. f.AddGTestTestStep('chromeos_unittests', fp)
  285. if R('chromeos_unittests_br'):
  286. f.AddBuildrunnerGTest('chromeos_unittests', fp)
  287. if R('chrome_elf_unittests'):
  288. f.AddGTestTestStep('chrome_elf_unittests', fp)
  289. if R('chrome_elf_unittests_br'):
  290. f.AddBuildrunnerGTest('chrome_elf_unittests', fp)
  291. if R('components_unittests'):
  292. f.AddGTestTestStep('components_unittests', fp)
  293. if R('components_unittests_br'):
  294. f.AddBuildrunnerGTest('components_unittests', fp)
  295. if R('courgette_unittests'):
  296. f.AddGTestTestStep('courgette_unittests', fp)
  297. if R('courgette_br'):
  298. f.AddBuildrunnerGTest('courgette_unittests', fp)
  299. if R('crypto_unittests'):
  300. f.AddGTestTestStep('crypto_unittests', fp)
  301. if R('crypto_br'):
  302. f.AddBuildrunnerGTest('crypto_unittests', fp)
  303. if R('dbus'):
  304. f.AddGTestTestStep('dbus_unittests', fp)
  305. if R('dbus_br'):
  306. f.AddBuildrunnerGTest('dbus_unittests', fp)
  307. if R('display_unittests'):
  308. f.AddGTestTestStep('display_unittests', fp)
  309. if R('display_unittests_br'):
  310. f.AddBuildrunnerGTest('display_unittests', fp)
  311. if R('extensions_unittests'):
  312. f.AddGTestTestStep('extensions_unittests', fp)
  313. if R('extensions_unittests_br'):
  314. f.AddBuildrunnerGTest('extensions_unittests', fp)
  315. if R('gcm_unit_tests'):
  316. f.AddGTestTestStep('gcm_unit_tests', fp)
  317. if R('gcm_unit_tests_br'):
  318. f.AddBuildrunnerGTest('gcm_unit_tests', fp)
  319. if R('gfx_unittests'):
  320. f.AddGTestTestStep('gfx_unittests', fp)
  321. if R('gfx_unittests_br'):
  322. f.AddBuildrunnerGTest('gfx_unittests', fp)
  323. if R('google_apis_unittests'):
  324. f.AddGTestTestStep('google_apis_unittests', fp)
  325. if R('google_apis_unittests_br'):
  326. f.AddBuildrunnerGTest('google_apis_unittests', fp)
  327. if R('gpu', 'gpu_unittests'):
  328. f.AddGTestTestStep(
  329. 'gpu_unittests', fp, arg_list=['--gmock_verbose=error'])
  330. if R('gpu_br'):
  331. f.AddBuildrunnerGTest(
  332. 'gpu_unittests', fp, arg_list=['--gmock_verbose=error'])
  333. if R('url_unittests', 'url_unittests'):
  334. f.AddGTestTestStep('url_unittests', fp)
  335. if R('url_unittests_br'):
  336. f.AddBuildrunnerGTest('url_unittests', fp)
  337. if R('jingle', 'jingle_unittests'):
  338. f.AddGTestTestStep('jingle_unittests', fp)
  339. if R('jingle_br'):
  340. f.AddBuildrunnerGTest('jingle_unittests', fp)
  341. if R('content_unittests'):
  342. f.AddGTestTestStep('content_unittests', fp)
  343. if R('content_unittests_br'):
  344. f.AddBuildrunnerGTest('content_unittests', fp)
  345. if R('keyboard_unittests'):
  346. f.AddGTestTestStep('keyboard_unittests', fp)
  347. if R('keyboard_unittests_br'):
  348. f.AddBuildrunnerGTest('keyboard_unittests', fp)
  349. if R('device_unittests'):
  350. f.AddGTestTestStep('device_unittests', fp)
  351. if R('device_unittests_br'):
  352. f.AddBuildrunnerGTest('device_unittests', fp)
  353. if R('media', 'media_unittests'):
  354. f.AddGTestTestStep('media_unittests', fp)
  355. if R('media_br'):
  356. f.AddBuildrunnerGTest('media_unittests', fp)
  357. if R('mojo_common_unittests'):
  358. f.AddBuildrunnerGTest('mojo_common_unittests', fp)
  359. if R('mojo_public_bindings_unittests'):
  360. f.AddBuildrunnerGTest('mojo_public_bindings_unittests', fp)
  361. if R('mojo_public_environment_unittests'):
  362. f.AddBuildrunnerGTest('mojo_public_environment_unittests', fp)
  363. if R('mojo_public_system_unittests'):
  364. f.AddBuildrunnerGTest('mojo_public_system_unittests', fp)
  365. if R('mojo_public_utility_unittests'):
  366. f.AddBuildrunnerGTest('mojo_public_utility_unittests', fp)
  367. if R('mojo_service_manager_unittests'):
  368. f.AddBuildrunnerGTest('mojo_service_manager_unittests', fp)
  369. if R('mojo_system_unittests'):
  370. f.AddBuildrunnerGTest('mojo_system_unittests', fp)
  371. if R('nacl_loader_unittests'):
  372. f.AddGTestTestStep('nacl_loader_unittests', fp)
  373. if R('nacl_loader_unittests_br'):
  374. f.AddBuildrunnerGTest('nacl_loader_unittests', fp)
  375. if R('net', 'net_unittests'):
  376. f.AddGTestTestStep('net_unittests', fp)
  377. if R('net_br'):
  378. f.AddBuildrunnerGTest('net_unittests', fp)
  379. if R('ppapi_unittests'):
  380. f.AddGTestTestStep('ppapi_unittests', fp)
  381. if R('ppapi_unittests_br'):
  382. f.AddBuildrunnerGTest('ppapi_unittests', fp)
  383. if R('printing', 'printing_unittests'):
  384. f.AddGTestTestStep('printing_unittests', fp)
  385. if R('printing_br'):
  386. f.AddBuildrunnerGTest('printing_unittests', fp)
  387. if R('remoting', 'remoting_unittests'):
  388. f.AddGTestTestStep('remoting_unittests', fp)
  389. if R('remoting_br'):
  390. f.AddBuildrunnerGTest('remoting_unittests', fp)
  391. # Windows sandbox
  392. if R('sbox_unittests'):
  393. f.AddGTestTestStep('sbox_unittests', fp)
  394. if R('sbox_unittests_br'):
  395. f.AddBuildrunnerGTest('sbox_unittests', fp)
  396. if R('sbox_integration_tests'):
  397. f.AddGTestTestStep('sbox_integration_tests', fp)
  398. if R('sbox_integration_tests_br'):
  399. f.AddBuildrunnerGTest('sbox_integration_tests', fp)
  400. if R('sbox_validation_tests'):
  401. f.AddBuildrunnerGTest('sbox_validation_tests', fp)
  402. if R('sbox_validation_tests_br'):
  403. f.AddBuildrunnerGTest('sbox_validation_tests', fp)
  404. if R('sandbox'):
  405. f.AddGTestTestStep('sbox_unittests', fp)
  406. f.AddGTestTestStep('sbox_integration_tests', fp)
  407. f.AddGTestTestStep('sbox_validation_tests', fp)
  408. if R('sandbox_br'):
  409. f.AddBuildrunnerGTest('sbox_unittests', fp)
  410. f.AddBuildrunnerGTest('sbox_integration_tests', fp)
  411. f.AddBuildrunnerGTest('sbox_validation_tests', fp)
  412. # Linux sandbox
  413. if R('sandbox_linux_unittests'):
  414. f.AddGTestTestStep('sandbox_linux_unittests', fp)
  415. if R('sandbox_linux_unittests_br'):
  416. f.AddBuildrunnerGTest('sandbox_linux_unittests', fp)
  417. if R('telemetry_unittests'):
  418. f.AddTelemetryUnitTests()
  419. if R('telemetry_unittests_br'):
  420. f.AddBuildrunnerTelemetryUnitTests()
  421. if R('telemetry_perf_unittests'):
  422. f.AddTelemetryPerfUnitTests()
  423. if R('telemetry_perf_unittests_br'):
  424. f.AddBuildrunnerTelemetryPerfUnitTests()
  425. if R('ui_base_unittests'):
  426. f.AddGTestTestStep('ui_base_unittests', fp)
  427. if R('ui_base_unittests_br'):
  428. f.AddBuildrunnerGTest('ui_base_unittests', fp)
  429. if R('views', 'views_unittests'):
  430. f.AddGTestTestStep('views_unittests', fp)
  431. if R('views_br'):
  432. f.AddBuildrunnerGTest('views_unittests', fp)
  433. if R('wm_unittests_br'):
  434. f.AddBuildrunnerGTest('wm_unittests', fp)
  435. if R('aura'):
  436. f.AddGTestTestStep('aura_unittests', fp)
  437. if R('aura_br'):
  438. f.AddBuildrunnerGTest('aura_unittests', fp)
  439. if R('aura_shell') or R('ash') or R('ash_unittests'):
  440. f.AddGTestTestStep('ash_unittests', fp)
  441. if R('aura_shell_br', 'ash_br', 'ash_unittests_br'):
  442. f.AddBuildrunnerGTest('ash_unittests', fp)
  443. if R('app_list_unittests'):
  444. f.AddGTestTestStep('app_list_unittests', fp)
  445. if R('app_list_unittests_br'):
  446. f.AddBuildrunnerGTest('app_list_unittests', fp)
  447. if R('message_center_unittests'):
  448. f.AddGTestTestStep('message_center_unittests', fp)
  449. if R('message_center_unittests_br'):
  450. f.AddBuildrunnerGTest('message_center_unittests', fp)
  451. if R('compositor'):
  452. f.AddGTestTestStep('compositor_unittests', fp)
  453. if R('compositor_br'):
  454. f.AddBuildrunnerGTest('compositor_unittests', fp)
  455. if R('events'):
  456. f.AddGTestTestStep('events_unittests', fp)
  457. if R('events_br'):
  458. f.AddBuildrunnerGTest('events_unittests', fp)
  459. if R('ui_touch_selection'):
  460. f.AddGTestTestStep('ui_touch_selection_unittests', fp)
  461. if R('ui_touch_selection_br'):
  462. f.AddBuildrunnerGTest('ui_touch_selection_unittests', fp)
  463. # Medium-sized tests (unit and browser):
  464. if R('unit'):
  465. f.AddChromeUnitTests(fp)
  466. if R('unit_br'):
  467. f.AddBuildrunnerChromeUnitTests(fp)
  468. # A snapshot of the "ChromeUnitTests" available for individual selection
  469. if R('ipc_tests'):
  470. f.AddGTestTestStep('ipc_tests', fp)
  471. if R('ipc_tests_br'):
  472. f.AddBuildrunnerGTest('ipc_tests', fp)
  473. if R('unit_sync', 'sync_unit_tests'):
  474. f.AddGTestTestStep('sync_unit_tests', fp)
  475. if R('unit_sync_br'):
  476. f.AddBuildrunnerGTest('sync_unit_tests', fp)
  477. if R('unit_unit', 'unit_tests'):
  478. f.AddGTestTestStep('unit_tests', fp)
  479. if R('unit_unit_br'):
  480. f.AddBuildrunnerGTest('unit_tests', fp)
  481. if R('unit_sql', 'sql_unittests'):
  482. f.AddGTestTestStep('sql_unittests', fp)
  483. if R('unit_sql_br'):
  484. f.AddBuildrunnerGTest('sql_unittests', fp)
  485. if R('browser_tests'):
  486. f.AddBrowserTests(fp)
  487. if R('browser_tests_br'):
  488. f.AddBuildrunnerBrowserTests(fp)
  489. if R('push_canary_tests'):
  490. f.AddPushCanaryTests(fp)
  491. if R('chromedriver_tests'):
  492. f.AddGTestTestStep('chromedriver_tests', fp)
  493. if R('chromedriver_tests_br'):
  494. f.AddBuildrunnerGTest('chromedriver_tests', fp)
  495. if R('content_browsertests'):
  496. f.AddGTestTestStep('content_browsertests', fp)
  497. if R('content_browsertests_br'):
  498. f.AddBuildrunnerGTest('content_browsertests', fp)
  499. if R('ash_browsertests'):
  500. ash_fp = fp.copy()
  501. ash_fp['browser_tests_extra_options'] = ['--ash-browsertests']
  502. f.AddBuildrunnerBrowserTests(ash_fp)
  503. if self._target_platform == 'win32':
  504. if R('installer_util_unittests'):
  505. f.AddGTestTestStep('installer_util_unittests', fp)
  506. if R('installer_util_unittests_br'):
  507. f.AddBuildrunnerGTest('installer_util_unittests', fp)
  508. if R('installer'):
  509. f.AddInstallerTests(fp)
  510. if R('installer_br'):
  511. f.AddBuildrunnerInstallerTests(fp)
  512. if R('test_installer'):
  513. f.AddMiniInstallerTestStep(fp)
  514. if R('test_installer_br'):
  515. f.AddBuildrunnerMiniInstallerTestStep(fp)
  516. # WebKit-related tests:
  517. if R('webkit_unit_tests'):
  518. f.AddGTestTestStep('webkit_unit_tests', fp)
  519. if R('webkit_unit_tests_br'):
  520. f.AddBuildrunnerGTest('webkit_unit_tests', fp)
  521. if R('wtf_unittests'):
  522. f.AddGTestTestStep('wtf_unittests', fp)
  523. if R('wtf_unittests_br'):
  524. f.AddBuildrunnerGTest('wtf_unittests', fp)
  525. if R('blink_platform_unittests'):
  526. f.AddGTestTestStep('blink_platform_unittests', fp)
  527. if R('blink_platform_unittests_br'):
  528. f.AddBuildrunnerGTest('blink_platform_unittests', fp)
  529. if R('blink_heap_unittests'):
  530. f.AddGTestTestStep('blink_heap_unittests', fp)
  531. if R('blink_heap_unittests_br'):
  532. f.AddBuildrunnerGTest('blink_heap_unittests', fp)
  533. if R('webkit_lint'):
  534. f.AddWebkitLint(factory_properties=fp)
  535. if R('webkit_lint_br'):
  536. f.AddBuildrunnerWebkitLint(factory_properties=fp)
  537. if R('webkit_python_tests'):
  538. f.AddWebkitPythonTests(factory_properties=fp)
  539. if R('webkit_python_tests_br'):
  540. f.AddBuildrunnerWebkitPythonTests(factory_properties=fp)
  541. if R('webkit'):
  542. f.AddWebkitTests(factory_properties=fp)
  543. if R('devtools_perf'):
  544. f.AddDevToolsTests(factory_properties=fp)
  545. # Android device test
  546. if R('device_status'):
  547. f.AddDeviceStatus(factory_properties=fp)
  548. def Telemetry(test_name):
  549. if R(test_name.replace('.', '_')):
  550. f.AddTelemetryTest(test_name, factory_properties=fp)
  551. # Benchmark tests:
  552. # Page cyclers:
  553. page_cyclers = [
  554. 'bloat',
  555. 'dhtml',
  556. 'indexeddb',
  557. 'intl_ar_fa_he',
  558. 'intl_es_fr_pt-BR',
  559. 'intl_hi_ru',
  560. 'intl_ja_zh',
  561. 'intl_ko_th_vi',
  562. 'morejs',
  563. 'moz',
  564. 'netsim.top_10',
  565. 'pica',
  566. 'top_10_mobile',
  567. 'tough_layout_cases',
  568. 'typical_25',
  569. ]
  570. for test_name in page_cyclers:
  571. Telemetry('page_cycler.' + test_name)
  572. # Synthetic benchmarks:
  573. synthetic_benchmarks = [
  574. 'blink_perf',
  575. 'dom_perf',
  576. 'image_decoding.tough_decoding_cases',
  577. 'jetstream',
  578. 'kraken',
  579. 'media.android',
  580. 'media.media_cns_cases',
  581. 'media.mse_cases',
  582. 'media.tough_media_cases',
  583. 'octane',
  584. 'robohornet_pro',
  585. 'scheduler.tough_pepper_cases',
  586. 'scheduler.tough_scheduling_cases',
  587. 'smoothness.fast_path.key_silk_cases',
  588. 'smoothness.fast_path.polymer',
  589. 'smoothness.fast_path_gpu_rasterization.key_silk_cases',
  590. 'smoothness.fast_path_gpu_rasterization.polymer',
  591. 'smoothness.gpu_rasterization.key_silk_cases',
  592. 'smoothness.gpu_rasterization.polymer',
  593. 'smoothness.key_silk_cases',
  594. 'smoothness.polymer',
  595. 'smoothness.tough_animation_cases',
  596. 'spaceport',
  597. 'speedometer',
  598. 'sunspider',
  599. 'thread_times.fast_path.key_silk_cases',
  600. 'thread_times.fast_path.polymer',
  601. 'thread_times.key_silk_cases',
  602. 'thread_times.polymer',
  603. 'webrtc',
  604. ]
  605. for test_name in synthetic_benchmarks:
  606. Telemetry(test_name)
  607. if R('dromaeo'):
  608. dromaeo_benchmarks = [
  609. 'domcoreattr',
  610. 'domcoremodify',
  611. 'domcorequery',
  612. 'domcoretraverse',
  613. 'jslibattrjquery',
  614. 'jslibattrprototype',
  615. 'jslibeventjquery',
  616. 'jslibeventprototype',
  617. 'jslibmodifyjquery',
  618. 'jslibmodifyprototype',
  619. 'jslibstylejquery',
  620. 'jslibstyleprototype',
  621. 'jslibtraversejquery',
  622. 'jslibtraverseprototype',
  623. ]
  624. for test_name in dromaeo_benchmarks:
  625. f.AddTelemetryTest('dromaeo.%s' % test_name, factory_properties=fp)
  626. # Real-world benchmarks:
  627. real_world_benchmarks = [
  628. 'maps',
  629. 'memory.mobile_memory',
  630. 'memory.reload.2012Q3',
  631. 'memory.top_25',
  632. 'memory.tough_dom_memory_cases',
  633. 'rasterize_and_record_micro.fast_path_gpu_rasterization.key_silk_cases',
  634. 'rasterize_and_record_micro.fast_path.polymer',
  635. 'rasterize_and_record_micro.key_mobile_sites',
  636. 'rasterize_and_record_micro.key_silk_cases',
  637. 'rasterize_and_record_micro.polymer',
  638. 'rasterize_and_record_micro.top_25',
  639. 'repaint.key_mobile_sites',
  640. 'repaint.gpu_rasterization.key_mobile_sites',
  641. 'smoothness.gpu_rasterization.key_mobile_sites',
  642. 'smoothness.gpu_rasterization.top_25',
  643. 'smoothness.key_mobile_sites',
  644. 'smoothness.top_25',
  645. 'smoothness.tough_canvas_cases',
  646. 'smoothness.tough_filters_cases',
  647. 'smoothness.tough_pinch_zoom_cases',
  648. 'smoothness.tough_webgl_cases',
  649. 'tab_switching.five_blank_pages',
  650. 'tab_switching.top_10',
  651. 'tab_switching.tough_energy_cases',
  652. 'tab_switching.typical_25',
  653. 'thread_times.key_mobile_sites',
  654. 'thread_times.tough_compositor_cases',
  655. ]
  656. for test_name in real_world_benchmarks:
  657. Telemetry(test_name)
  658. # Other benchmarks:
  659. if R('tab_capture_performance'):
  660. f.AddTabCapturePerformanceTests(fp)
  661. if R('indexeddb_perf'):
  662. f.AddTelemetryTest('indexeddb_perf', factory_properties=fp)
  663. if R('startup_cold'):
  664. f.AddTelemetryTest('startup.cold.blank_page', factory_properties=fp)
  665. f.AddTelemetryTest('start_with_url.cold.startup_pages',
  666. factory_properties=fp)
  667. if R('startup_warm'):
  668. f.AddTelemetryTest('startup.warm.blank_page', factory_properties=fp)
  669. f.AddTelemetryTest('start_with_url.warm.startup_pages',
  670. factory_properties=fp)
  671. if R('startup_warm_dirty'):
  672. startup_fp = fp.copy()
  673. # pylint: disable=W0212
  674. startup_fp['profile_type'] = 'small_profile'
  675. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  676. startup_fp['run_reference_build'] = False
  677. f.AddTelemetryTest('startup.warm.blank_page',
  678. step_name='startup.warm.dirty.blank_page',
  679. factory_properties=startup_fp)
  680. if R('startup_cold_dirty'):
  681. startup_fp = fp.copy()
  682. # pylint: disable=W0212
  683. startup_fp['profile_type'] = 'small_profile'
  684. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  685. startup_fp['run_reference_build'] = False
  686. f.AddTelemetryTest('startup.cold.blank_page',
  687. step_name='startup.cold.dirty.blank_page',
  688. factory_properties=startup_fp)
  689. if R('startup_warm_session_restore'):
  690. startup_fp = fp.copy()
  691. # pylint: disable=W0212
  692. startup_fp['profile_type'] = 'small_profile'
  693. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  694. startup_fp['run_reference_build'] = False
  695. f.AddTelemetryTest('session_restore.warm.typical_25',
  696. step_name='session_restore.warm.typical_25',
  697. factory_properties=startup_fp)
  698. if R('startup_cold_session_restore'):
  699. startup_fp = fp.copy()
  700. # pylint: disable=W0212
  701. startup_fp['profile_type'] = 'small_profile'
  702. #TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  703. startup_fp['run_reference_build'] = False
  704. f.AddTelemetryTest('session_restore.cold.typical_25',
  705. step_name='session_restore.cold.typical_25',
  706. factory_properties=startup_fp)
  707. if R('sizes'):
  708. f.AddSizesTests(fp)
  709. if R('sizes_br'):
  710. f.AddBuildrunnerSizesTests(fp)
  711. if R('mach_ports'):
  712. f.AddMachPortsTests(fp)
  713. if R('cc_perftests'):
  714. f.AddCCPerfTests(fp)
  715. if R('media_perftests'):
  716. f.AddMediaPerfTests(fp)
  717. if R('load_library_perf_tests'):
  718. f.AddLoadLibraryPerfTests(fp)
  719. if R('sync_integration'):
  720. f.AddSyncIntegrationTests(fp)
  721. if R('sync_integration_br'):
  722. f.AddBuildrunnerSyncIntegrationTests(fp)
  723. def S(test, prefix, add_functor, br_functor=None):
  724. """Find any tests with a specific prefix and add them to the build.
  725. S() looks for prefix attached to a test, strips the prefix, and performs a
  726. prefix-specific add function via add_functor. If the test is also a
  727. buildrunner test (ends in _br), it uses a buildrunner functor. Thus,
  728. instead of ash_unittests, valgrind_ash_unittests is ash_unittests added
  729. with a special function (one that wraps it with a valgrind driver.
  730. """
  731. if test.startswith(prefix):
  732. test_name = test[len(prefix):]
  733. tests.remove(test)
  734. if br_functor and test_name.endswith('_br'):
  735. br_functor(test_name[:-3])
  736. else:
  737. add_functor(test_name)
  738. return True
  739. def M(test, prefix, test_type, fp):
  740. """A special case of S() that operates on memory tests."""
  741. return S(
  742. test, prefix, lambda test_name:
  743. f.AddMemoryTest(test_name, test_type, factory_properties=fp),
  744. lambda test_name:
  745. f.AddBuildrunnerMemoryTest(
  746. test_name, test_type, factory_properties=fp))
  747. # Valgrind tests:
  748. for test in tests[:]:
  749. # TODO(timurrrr): replace 'valgrind' with 'memcheck'
  750. # below and in master.chromium/master.cfg
  751. if M(test, 'valgrind_', 'memcheck', fp):
  752. continue
  753. # Run TSan in two-stage RaceVerifier mode.
  754. if M(test, 'tsan_rv_', 'tsan_rv', fp):
  755. continue
  756. if M(test, 'tsan_', 'tsan', fp):
  757. continue
  758. if M(test, 'drmemory_light_', 'drmemory_light', fp):
  759. continue
  760. if M(test, 'drmemory_full_', 'drmemory_full', fp):
  761. continue
  762. if M(test, 'drmemory_pattern_', 'drmemory_pattern', fp):
  763. continue
  764. if R('chromedriver_tests'):
  765. f.AddChromeDriverTest()
  766. if R('webdriver_tests'):
  767. f.AddWebDriverTest()
  768. # Dynamorio coverage.
  769. if R('trigger_coverage_tests'):
  770. f.AddTriggerCoverageTests(fp)
  771. if R('extract_dynamorio_build'):
  772. f.AddExtractDynamorioBuild(fp)
  773. if R('coverage_tests'):
  774. f.AddCoverageTests(fp)
  775. # When adding a test that uses a new executable, update kill_processes.py.
  776. # Coverage tests. Add coverage processing absoluely last, after
  777. # all tests have run. Tests which run after coverage processing
  778. # don't get counted.
  779. if R('process_coverage'):
  780. f.AddProcessCoverage(fp)
  781. # Add nacl integration tests (do these toward the end as they use the
  782. # annotator).
  783. if R('nacl_integration'):
  784. f.AddNaClIntegrationTestStep(fp)
  785. if R('nacl_integration_br'):
  786. f.AddBuildrunnerNaClIntegrationTestStep(fp)
  787. if R('nacl_integration_memcheck'):
  788. f.AddNaClIntegrationTestStep(fp, None, 'memcheck-browser-tests')
  789. if R('nacl_integration_tsan'):
  790. f.AddNaClIntegrationTestStep(fp, None, 'tsan-browser-tests')
  791. if R('buildrunner_tests'):
  792. f.AddBuildStep(factory_properties, name='buildrunner_tests')
  793. # Add bisection test (if this is specified, it should be the only test)
  794. if R('bisect_revisions'):
  795. f.AddBisectTest()
  796. # Add an optional set of annotated steps.
  797. # NOTE: This really should go last as it can be confusing if the annotator
  798. # isn't the last thing to run.
  799. if R('annotated_steps'):
  800. f.AddAnnotatedSteps(fp)
  801. # If this assert triggers and the test name is valid, make sure R() is used.
  802. # If you are using a subclass, make sure the tests list provided to
  803. # _AddTests() had the factory-specific tests stripped off.
  804. assert not tests, 'Did you make a typo? %s wasn\'t processed' % tests
  805. def ChromiumFactory(self, target='Release', clobber=False, tests=None,
  806. mode=None, slave_type='BuilderTester',
  807. options=None, compile_timeout=1200, build_url=None,
  808. project=None, factory_properties=None, gclient_deps=None,
  809. run_default_swarm_tests=None):
  810. factory_properties = (factory_properties or {}).copy()
  811. run_default_swarm_tests = run_default_swarm_tests or []
  812. # Default to the configuration of Blink appropriate for Chromium patches.
  813. factory_properties.setdefault('blink_config', 'chromium')
  814. if factory_properties['blink_config'] == 'blink':
  815. # This will let builders embed their webkit revision in their output
  816. # filename and will let testers look for zip files containing a webkit
  817. # revision in their filename. For this to work correctly, the testers
  818. # need to be on a Triggerable that's activated by their builder.
  819. factory_properties.setdefault('webkit_dir', 'third_party/WebKit/Source')
  820. factory_properties['gclient_env'] = \
  821. factory_properties.get('gclient_env', {}).copy()
  822. tests = tests or []
  823. if factory_properties.get('needs_valgrind'):
  824. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
  825. elif factory_properties.get('needs_tsan_win'):
  826. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN]
  827. elif factory_properties.get('needs_webdriver_java_tests'):
  828. self._solutions[0].custom_deps_list = [
  829. self.CUSTOM_DEPS_WEBDRIVER_JAVA_TESTS
  830. ]
  831. if 'devtools_perf' in tests:
  832. self._solutions[0].custom_deps_list.extend(self.CUSTOM_DEPS_DEVTOOLS_PERF)
  833. if factory_properties.get('safesync_url'):
  834. self._solutions[0].safesync_url = factory_properties.get('safesync_url')
  835. elif factory_properties.get('lkgr'):
  836. self._solutions[0].safesync_url = self.SAFESYNC_URL_CHROMIUM
  837. tests_for_build = [
  838. re.match('^(?:valgrind_)?(.*)$', t).group(1) for t in tests]
  839. # Ensure that component is set correctly in the gyp defines.
  840. ForceComponent(target, project, factory_properties['gclient_env'])
  841. # There's 2 different windows SyzyASan builders:
  842. # - The unittests builder, which build all the unittests, instrument
  843. # them and put them in a zip file for the test bots.
  844. # - The Chromium LKGR builder, which build the All_syzygy target of the
  845. # Chromium project with the 'asan' gyp define set. There's no need to
  846. # call a script to do the instrumentation for this target (it's
  847. # already in the build steps). This builder should archive the builds
  848. # for Clusterfuzz, it need to have the 'cf_archive_build' property.
  849. is_win_syzyasan_tests_builder = (slave_type == 'Builder' and
  850. self._target_platform == 'win32' and
  851. factory_properties.get('syzyasan') and
  852. not factory_properties.get('cf_archive_build'))
  853. factory = self.BuildFactory(target, clobber, tests_for_build, mode,
  854. slave_type, options, compile_timeout, build_url,
  855. project, factory_properties,
  856. gclient_deps=gclient_deps,
  857. skip_archive_steps=is_win_syzyasan_tests_builder)
  858. # Get the factory command object to create new steps to the factory.
  859. chromium_cmd_obj = chromium_commands.ChromiumCommands(factory,
  860. target,
  861. self._build_dir,
  862. self._target_platform)
  863. # Add ASANification step for windows unittests.
  864. # MUST BE FIRST STEP ADDED AFTER BuildFactory CALL in order to add back
  865. # the ZipBuild step in it's expected place.
  866. if is_win_syzyasan_tests_builder:
  867. chromium_cmd_obj.AddWindowsSyzyASanStep()
  868. # Need to add the Zip Build step back
  869. if build_url:
  870. chromium_cmd_obj.AddZipBuild(build_url,
  871. factory_properties=factory_properties)
  872. # Add this archive build step.
  873. if factory_properties.get('archive_build'):
  874. chromium_cmd_obj.AddArchiveBuild(factory_properties=factory_properties)
  875. if factory_properties.get('cf_archive_build'):
  876. chromium_cmd_obj.AddCFArchiveBuild(
  877. factory_properties=factory_properties)
  878. # Add a trigger step if needed.
  879. self.TriggerFactory(factory, slave_type=slave_type,
  880. factory_properties=factory_properties)
  881. # Start the crash handler process.
  882. if factory_properties.get('start_crash_handler'):
  883. chromium_cmd_obj.AddRunCrashHandler()
  884. # Add all the tests.
  885. self._AddTests(chromium_cmd_obj, tests, mode, factory_properties)
  886. # Add late cf archive build
  887. # The late_cf_archive_build is needed for tools like Dr.Memory to
  888. # collect some information from the tests and pack them into the archive.
  889. if factory_properties.get('late_cf_archive_build'):
  890. chromium_cmd_obj.AddCFArchiveBuild(
  891. factory_properties=factory_properties)
  892. if factory_properties.get('process_dumps'):
  893. chromium_cmd_obj.AddProcessDumps()
  894. return factory
  895. def ChromiumAnnotationFactory(self, annotation_script,
  896. branch='master',
  897. target='Release',
  898. slave_type='AnnotatedBuilderTester',
  899. clobber=False,
  900. compile_timeout=6000,
  901. maxTime=8*60*60,
  902. project=None,
  903. factory_properties=None, options=None,
  904. tests=None,
  905. gclient_deps=None):
  906. """Annotation-driven Chromium buildbot factory.
  907. Like a ChromiumFactory, but non-sync steps (compile, run tests)
  908. are specified in a script that uses @@@BUILD_STEP descriptive
  909. text@@@ style annotations.
  910. Note new slave type AnnotatedBuilderTester; we don't want a
  911. compile step added.
  912. TODO(jrg): is a new slave type the right direction?
  913. """
  914. # Setup factory.
  915. factory_properties = factory_properties or {}
  916. options = options or {}
  917. if self._target_os:
  918. factory_properties['target_os'] = self._target_os
  919. # Ensure that component is set correctly in the gyp defines.
  920. ForceComponent(target, project, factory_properties)
  921. factory = self.BuildFactory(target=target, clobber=clobber,
  922. tests=tests, mode=None, slave_type=slave_type,
  923. options=options,
  924. compile_timeout=compile_timeout, build_url=None,
  925. project=project,
  926. factory_properties=factory_properties,
  927. gclient_deps=gclient_deps)
  928. # Get the factory command object to create new steps to the factory.
  929. chromium_cmd_obj = chromium_commands.ChromiumCommands(
  930. factory=factory,
  931. target=target,
  932. build_dir=self._build_dir,
  933. target_platform=self._target_platform,
  934. target_os=self._target_os)
  935. # Add the main build.
  936. env = factory_properties.get('annotation_env')
  937. factory_properties['target'] = target
  938. factory_properties.setdefault('clobber', clobber)
  939. chromium_cmd_obj.AddAnnotationStep(
  940. name='slave_steps',
  941. cmd=annotation_script,
  942. factory_properties=factory_properties,
  943. env=env, maxTime=maxTime)
  944. # Add archive build step.
  945. if factory_properties.get('archive_build'):
  946. chromium_cmd_obj.AddArchiveBuild(factory_properties=factory_properties)
  947. # Add all the tests.
  948. self._AddTests(factory_cmd_obj=chromium_cmd_obj, tests=tests,
  949. factory_properties=factory_properties)
  950. # Add a trigger step if needed.
  951. self.TriggerFactory(factory, slave_type=slave_type,
  952. factory_properties=factory_properties)
  953. return factory
  954. def ChromiumAVPerfFactory(self, target='Release', clobber=False, tests=None,
  955. mode=None, slave_type='BuilderTester',
  956. options=None, compile_timeout=1200,
  957. build_url=None, project=None,
  958. factory_properties=None):
  959. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_AVPERF]
  960. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  961. options, compile_timeout, build_url, project,
  962. factory_properties)
  963. def ChromiumNativeClientLatestFactory(
  964. self, target='Release', clobber=False, tests=None, mode=None,
  965. slave_type='BuilderTester', options=None, compile_timeout=1200,
  966. build_url=None, project=None, factory_properties=None,
  967. on_nacl_waterfall=True, use_chrome_lkgr=True):
  968. factory_properties = factory_properties or {}
  969. if on_nacl_waterfall:
  970. factory_properties['primary_repo'] = 'nacl_'
  971. # Remove nacl_trunk variable.
  972. self._solutions[0].custom_vars_list = [
  973. v for v in self._solutions[0].custom_vars_list if v[0] != 'nacl_trunk'
  974. ]
  975. self._solutions[0].custom_vars_list.extend(self.CUSTOM_VARS_NACL_LATEST)
  976. self._solutions[0].safesync_url = self.SAFESYNC_URL_CHROMIUM
  977. if factory_properties.get('needs_nacl_valgrind'):
  978. self._solutions[0].custom_deps_list.append(self.CUSTOM_DEPS_NACL_VALGRIND)
  979. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  980. options, compile_timeout, build_url, project,
  981. factory_properties)
  982. def ChromiumGYPLatestFactory(self, target='Debug', clobber=False, tests=None,
  983. mode=None, slave_type='BuilderTester',
  984. options=None, compile_timeout=1200,
  985. build_url=None, project=None,
  986. factory_properties=None, gyp_format=None):
  987. if tests is None:
  988. tests = ['unit']
  989. if gyp_format:
  990. # Set GYP_GENERATORS in the environment used to execute
  991. # gclient so we get the right build tool configuration.
  992. if factory_properties is None:
  993. factory_properties = {}
  994. gclient_env = factory_properties.get('gclient_env', {})
  995. gclient_env['GYP_GENERATORS'] = gyp_format
  996. factory_properties['gclient_env'] = gclient_env
  997. # And tell compile.py what build tool to use.
  998. if options is None:
  999. options = []
  1000. options.append('--build-tool=' + gyp_format)
  1001. self._solutions[0].custom_deps_list = self.CUSTOM_DEPS_GYP
  1002. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1003. options, compile_timeout, build_url, project,
  1004. factory_properties)
  1005. def ChromiumOSFactory(self, target='Release', clobber=False, tests=None,
  1006. mode=None, slave_type='BuilderTester', options=None,
  1007. compile_timeout=1200, build_url=None, project=None,
  1008. factory_properties=None):
  1009. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1010. options, compile_timeout, build_url, project,
  1011. factory_properties)
  1012. def ChromiumBranchFactory(
  1013. self, target='Release', clobber=False, tests=None, mode=None,
  1014. slave_type='BuilderTester', options=None, compile_timeout=1200,
  1015. build_url=None, project=None, factory_properties=None,
  1016. trunk_src_url=None):
  1017. self._solutions = [gclient_factory.GClientSolution(trunk_src_url, 'src')]
  1018. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1019. options, compile_timeout, build_url, project,
  1020. factory_properties)
  1021. def ChromiumASANFactory(self, target='Release', clobber=False, tests=None,
  1022. mode=None, slave_type='BuilderTester', options=None,
  1023. compile_timeout=1200, build_url=None, project=None,
  1024. factory_properties=None):
  1025. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1026. options, compile_timeout, build_url, project,
  1027. factory_properties)
  1028. def ChromiumOSASANFactory(self, target='Release', clobber=False, tests=None,
  1029. mode=None, slave_type='BuilderTester', options=None,
  1030. compile_timeout=1200, build_url=None, project=None,
  1031. factory_properties=None):
  1032. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1033. options, compile_timeout, build_url, project,
  1034. factory_properties)