GoogleGit

blob: 3056e0655a563df7cedee0e303a6b29a89969eb6 [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. # TODO: Remove 'ui_unittests' once M41 becomes stable (crbug.com/434498)
  426. if R('ui_unittests'):
  427. f.AddGTestTestStep('ui_unittests', fp)
  428. # TODO: Remove 'ui_unittests_br' once M41 becomes stable (crbug.com/434498)
  429. if R('ui_unittests_br'):
  430. f.AddBuildrunnerGTest('ui_unittests', fp)
  431. if R('ui_base_unittests'):
  432. f.AddGTestTestStep('ui_base_unittests', fp)
  433. if R('ui_base_unittests_br'):
  434. f.AddBuildrunnerGTest('ui_base_unittests', fp)
  435. if R('views', 'views_unittests'):
  436. f.AddGTestTestStep('views_unittests', fp)
  437. if R('views_br'):
  438. f.AddBuildrunnerGTest('views_unittests', fp)
  439. if R('wm_unittests_br'):
  440. f.AddBuildrunnerGTest('wm_unittests', fp)
  441. if R('aura'):
  442. f.AddGTestTestStep('aura_unittests', fp)
  443. if R('aura_br'):
  444. f.AddBuildrunnerGTest('aura_unittests', fp)
  445. if R('aura_shell') or R('ash') or R('ash_unittests'):
  446. f.AddGTestTestStep('ash_unittests', fp)
  447. if R('aura_shell_br', 'ash_br', 'ash_unittests_br'):
  448. f.AddBuildrunnerGTest('ash_unittests', fp)
  449. if R('app_list_unittests'):
  450. f.AddGTestTestStep('app_list_unittests', fp)
  451. if R('app_list_unittests_br'):
  452. f.AddBuildrunnerGTest('app_list_unittests', fp)
  453. if R('message_center_unittests'):
  454. f.AddGTestTestStep('message_center_unittests', fp)
  455. if R('message_center_unittests_br'):
  456. f.AddBuildrunnerGTest('message_center_unittests', fp)
  457. if R('compositor'):
  458. f.AddGTestTestStep('compositor_unittests', fp)
  459. if R('compositor_br'):
  460. f.AddBuildrunnerGTest('compositor_unittests', fp)
  461. if R('events'):
  462. f.AddGTestTestStep('events_unittests', fp)
  463. if R('events_br'):
  464. f.AddBuildrunnerGTest('events_unittests', fp)
  465. if R('ui_touch_selection'):
  466. f.AddGTestTestStep('ui_touch_selection_unittests', fp)
  467. if R('ui_touch_selection_br'):
  468. f.AddBuildrunnerGTest('ui_touch_selection_unittests', fp)
  469. # Medium-sized tests (unit and browser):
  470. if R('unit'):
  471. f.AddChromeUnitTests(fp)
  472. if R('unit_br'):
  473. f.AddBuildrunnerChromeUnitTests(fp)
  474. # A snapshot of the "ChromeUnitTests" available for individual selection
  475. if R('ipc_tests'):
  476. f.AddGTestTestStep('ipc_tests', fp)
  477. if R('ipc_tests_br'):
  478. f.AddBuildrunnerGTest('ipc_tests', fp)
  479. if R('unit_sync', 'sync_unit_tests'):
  480. f.AddGTestTestStep('sync_unit_tests', fp)
  481. if R('unit_sync_br'):
  482. f.AddBuildrunnerGTest('sync_unit_tests', fp)
  483. if R('unit_unit', 'unit_tests'):
  484. f.AddGTestTestStep('unit_tests', fp)
  485. if R('unit_unit_br'):
  486. f.AddBuildrunnerGTest('unit_tests', fp)
  487. if R('unit_sql', 'sql_unittests'):
  488. f.AddGTestTestStep('sql_unittests', fp)
  489. if R('unit_sql_br'):
  490. f.AddBuildrunnerGTest('sql_unittests', fp)
  491. if R('browser_tests'):
  492. f.AddBrowserTests(fp)
  493. if R('browser_tests_br'):
  494. f.AddBuildrunnerBrowserTests(fp)
  495. if R('push_canary_tests'):
  496. f.AddPushCanaryTests(fp)
  497. if R('chromedriver_tests'):
  498. f.AddGTestTestStep('chromedriver_tests', fp)
  499. if R('chromedriver_tests_br'):
  500. f.AddBuildrunnerGTest('chromedriver_tests', fp)
  501. if R('content_browsertests'):
  502. f.AddGTestTestStep('content_browsertests', fp)
  503. if R('content_browsertests_br'):
  504. f.AddBuildrunnerGTest('content_browsertests', fp)
  505. if R('ash_browsertests'):
  506. ash_fp = fp.copy()
  507. ash_fp['browser_tests_extra_options'] = ['--ash-browsertests']
  508. f.AddBuildrunnerBrowserTests(ash_fp)
  509. if self._target_platform == 'win32':
  510. if R('installer_util_unittests'):
  511. f.AddGTestTestStep('installer_util_unittests', fp)
  512. if R('installer_util_unittests_br'):
  513. f.AddBuildrunnerGTest('installer_util_unittests', fp)
  514. if R('installer'):
  515. f.AddInstallerTests(fp)
  516. if R('installer_br'):
  517. f.AddBuildrunnerInstallerTests(fp)
  518. if R('test_installer'):
  519. f.AddMiniInstallerTestStep(fp)
  520. if R('test_installer_br'):
  521. f.AddBuildrunnerMiniInstallerTestStep(fp)
  522. # WebKit-related tests:
  523. if R('webkit_unit_tests'):
  524. f.AddGTestTestStep('webkit_unit_tests', fp)
  525. if R('webkit_unit_tests_br'):
  526. f.AddBuildrunnerGTest('webkit_unit_tests', fp)
  527. if R('wtf_unittests'):
  528. f.AddGTestTestStep('wtf_unittests', fp)
  529. if R('wtf_unittests_br'):
  530. f.AddBuildrunnerGTest('wtf_unittests', fp)
  531. if R('blink_platform_unittests'):
  532. f.AddGTestTestStep('blink_platform_unittests', fp)
  533. if R('blink_platform_unittests_br'):
  534. f.AddBuildrunnerGTest('blink_platform_unittests', fp)
  535. if R('blink_heap_unittests'):
  536. f.AddGTestTestStep('blink_heap_unittests', fp)
  537. if R('blink_heap_unittests_br'):
  538. f.AddBuildrunnerGTest('blink_heap_unittests', fp)
  539. if R('webkit_lint'):
  540. f.AddWebkitLint(factory_properties=fp)
  541. if R('webkit_lint_br'):
  542. f.AddBuildrunnerWebkitLint(factory_properties=fp)
  543. if R('webkit_python_tests'):
  544. f.AddWebkitPythonTests(factory_properties=fp)
  545. if R('webkit_python_tests_br'):
  546. f.AddBuildrunnerWebkitPythonTests(factory_properties=fp)
  547. if R('webkit'):
  548. f.AddWebkitTests(factory_properties=fp)
  549. if R('devtools_perf'):
  550. f.AddDevToolsTests(factory_properties=fp)
  551. # Android device test
  552. if R('device_status'):
  553. f.AddDeviceStatus(factory_properties=fp)
  554. def Telemetry(test_name):
  555. if R(test_name.replace('.', '_')):
  556. f.AddTelemetryTest(test_name, factory_properties=fp)
  557. # Benchmark tests:
  558. # Page cyclers:
  559. page_cyclers = [
  560. 'bloat',
  561. 'dhtml',
  562. 'indexeddb',
  563. 'intl_ar_fa_he',
  564. 'intl_es_fr_pt-BR',
  565. 'intl_hi_ru',
  566. 'intl_ja_zh',
  567. 'intl_ko_th_vi',
  568. 'morejs',
  569. 'moz',
  570. 'netsim.top_10',
  571. 'pica',
  572. 'top_10_mobile',
  573. 'tough_layout_cases',
  574. 'typical_25',
  575. ]
  576. for test_name in page_cyclers:
  577. Telemetry('page_cycler.' + test_name)
  578. # Synthetic benchmarks:
  579. synthetic_benchmarks = [
  580. 'blink_perf',
  581. 'dom_perf',
  582. 'image_decoding.tough_decoding_cases',
  583. 'jetstream',
  584. 'kraken',
  585. 'media.android',
  586. 'media.media_cns_cases',
  587. 'media.mse_cases',
  588. 'media.tough_media_cases',
  589. 'octane',
  590. 'robohornet_pro',
  591. 'scheduler.tough_pepper_cases',
  592. 'scheduler.tough_scheduling_cases',
  593. 'smoothness.fast_path.key_silk_cases',
  594. 'smoothness.fast_path.polymer',
  595. 'smoothness.fast_path_gpu_rasterization.key_silk_cases',
  596. 'smoothness.fast_path_gpu_rasterization.polymer',
  597. 'smoothness.gpu_rasterization.key_silk_cases',
  598. 'smoothness.gpu_rasterization.polymer',
  599. 'smoothness.key_silk_cases',
  600. 'smoothness.polymer',
  601. 'smoothness.tough_animation_cases',
  602. 'spaceport',
  603. 'speedometer',
  604. 'sunspider',
  605. 'thread_times.fast_path.key_silk_cases',
  606. 'thread_times.fast_path.polymer',
  607. 'thread_times.key_silk_cases',
  608. 'thread_times.polymer',
  609. 'webrtc',
  610. ]
  611. for test_name in synthetic_benchmarks:
  612. Telemetry(test_name)
  613. if R('dromaeo'):
  614. dromaeo_benchmarks = [
  615. 'domcoreattr',
  616. 'domcoremodify',
  617. 'domcorequery',
  618. 'domcoretraverse',
  619. 'jslibattrjquery',
  620. 'jslibattrprototype',
  621. 'jslibeventjquery',
  622. 'jslibeventprototype',
  623. 'jslibmodifyjquery',
  624. 'jslibmodifyprototype',
  625. 'jslibstylejquery',
  626. 'jslibstyleprototype',
  627. 'jslibtraversejquery',
  628. 'jslibtraverseprototype',
  629. ]
  630. for test_name in dromaeo_benchmarks:
  631. f.AddTelemetryTest('dromaeo.%s' % test_name, factory_properties=fp)
  632. # Real-world benchmarks:
  633. real_world_benchmarks = [
  634. 'maps',
  635. 'memory.mobile_memory',
  636. 'memory.reload.2012Q3',
  637. 'memory.top_25',
  638. 'memory.tough_dom_memory_cases',
  639. 'rasterize_and_record_micro.fast_path_gpu_rasterization.key_silk_cases',
  640. 'rasterize_and_record_micro.fast_path.polymer',
  641. 'rasterize_and_record_micro.key_mobile_sites',
  642. 'rasterize_and_record_micro.key_silk_cases',
  643. 'rasterize_and_record_micro.polymer',
  644. 'rasterize_and_record_micro.top_25',
  645. 'repaint.key_mobile_sites',
  646. 'repaint.gpu_rasterization.key_mobile_sites',
  647. 'smoothness.gpu_rasterization.key_mobile_sites',
  648. 'smoothness.gpu_rasterization.top_25',
  649. 'smoothness.key_mobile_sites',
  650. 'smoothness.top_25',
  651. 'smoothness.tough_canvas_cases',
  652. 'smoothness.tough_filters_cases',
  653. 'smoothness.tough_pinch_zoom_cases',
  654. 'smoothness.tough_webgl_cases',
  655. 'tab_switching.five_blank_pages',
  656. 'tab_switching.top_10',
  657. 'tab_switching.tough_energy_cases',
  658. 'tab_switching.typical_25',
  659. 'thread_times.key_mobile_sites',
  660. 'thread_times.tough_compositor_cases',
  661. ]
  662. for test_name in real_world_benchmarks:
  663. Telemetry(test_name)
  664. # Other benchmarks:
  665. if R('tab_capture_performance'):
  666. f.AddTabCapturePerformanceTests(fp)
  667. if R('indexeddb_perf'):
  668. f.AddTelemetryTest('indexeddb_perf', factory_properties=fp)
  669. if R('startup_cold'):
  670. f.AddTelemetryTest('startup.cold.blank_page', factory_properties=fp)
  671. f.AddTelemetryTest('start_with_url.cold.startup_pages',
  672. factory_properties=fp)
  673. if R('startup_warm'):
  674. f.AddTelemetryTest('startup.warm.blank_page', factory_properties=fp)
  675. f.AddTelemetryTest('start_with_url.warm.startup_pages',
  676. factory_properties=fp)
  677. if R('startup_warm_dirty'):
  678. startup_fp = fp.copy()
  679. # pylint: disable=W0212
  680. startup_fp['profile_type'] = 'small_profile'
  681. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  682. startup_fp['run_reference_build'] = False
  683. f.AddTelemetryTest('startup.warm.blank_page',
  684. step_name='startup.warm.dirty.blank_page',
  685. factory_properties=startup_fp)
  686. if R('startup_cold_dirty'):
  687. startup_fp = fp.copy()
  688. # pylint: disable=W0212
  689. startup_fp['profile_type'] = 'small_profile'
  690. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  691. startup_fp['run_reference_build'] = False
  692. f.AddTelemetryTest('startup.cold.blank_page',
  693. step_name='startup.cold.dirty.blank_page',
  694. factory_properties=startup_fp)
  695. if R('startup_warm_session_restore'):
  696. startup_fp = fp.copy()
  697. # pylint: disable=W0212
  698. startup_fp['profile_type'] = 'small_profile'
  699. # TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  700. startup_fp['run_reference_build'] = False
  701. f.AddTelemetryTest('session_restore.warm.typical_25',
  702. step_name='session_restore.warm.typical_25',
  703. factory_properties=startup_fp)
  704. if R('startup_cold_session_restore'):
  705. startup_fp = fp.copy()
  706. # pylint: disable=W0212
  707. startup_fp['profile_type'] = 'small_profile'
  708. #TODO(jeremy): Disable on ref builds pending fix for crbug.com/327017.
  709. startup_fp['run_reference_build'] = False
  710. f.AddTelemetryTest('session_restore.cold.typical_25',
  711. step_name='session_restore.cold.typical_25',
  712. factory_properties=startup_fp)
  713. if R('sizes'):
  714. f.AddSizesTests(fp)
  715. if R('sizes_br'):
  716. f.AddBuildrunnerSizesTests(fp)
  717. if R('mach_ports'):
  718. f.AddMachPortsTests(fp)
  719. if R('cc_perftests'):
  720. f.AddCCPerfTests(fp)
  721. if R('media_perftests'):
  722. f.AddMediaPerfTests(fp)
  723. if R('load_library_perf_tests'):
  724. f.AddLoadLibraryPerfTests(fp)
  725. if R('sync_integration'):
  726. f.AddSyncIntegrationTests(fp)
  727. if R('sync_integration_br'):
  728. f.AddBuildrunnerSyncIntegrationTests(fp)
  729. def S(test, prefix, add_functor, br_functor=None):
  730. """Find any tests with a specific prefix and add them to the build.
  731. S() looks for prefix attached to a test, strips the prefix, and performs a
  732. prefix-specific add function via add_functor. If the test is also a
  733. buildrunner test (ends in _br), it uses a buildrunner functor. Thus,
  734. instead of ash_unittests, valgrind_ash_unittests is ash_unittests added
  735. with a special function (one that wraps it with a valgrind driver.
  736. """
  737. if test.startswith(prefix):
  738. test_name = test[len(prefix):]
  739. tests.remove(test)
  740. if br_functor and test_name.endswith('_br'):
  741. br_functor(test_name[:-3])
  742. else:
  743. add_functor(test_name)
  744. return True
  745. def M(test, prefix, test_type, fp):
  746. """A special case of S() that operates on memory tests."""
  747. return S(
  748. test, prefix, lambda test_name:
  749. f.AddMemoryTest(test_name, test_type, factory_properties=fp),
  750. lambda test_name:
  751. f.AddBuildrunnerMemoryTest(
  752. test_name, test_type, factory_properties=fp))
  753. # Valgrind tests:
  754. for test in tests[:]:
  755. # TODO(timurrrr): replace 'valgrind' with 'memcheck'
  756. # below and in master.chromium/master.cfg
  757. if M(test, 'valgrind_', 'memcheck', fp):
  758. continue
  759. # Run TSan in two-stage RaceVerifier mode.
  760. if M(test, 'tsan_rv_', 'tsan_rv', fp):
  761. continue
  762. if M(test, 'tsan_', 'tsan', fp):
  763. continue
  764. if M(test, 'drmemory_light_', 'drmemory_light', fp):
  765. continue
  766. if M(test, 'drmemory_full_', 'drmemory_full', fp):
  767. continue
  768. if M(test, 'drmemory_pattern_', 'drmemory_pattern', fp):
  769. continue
  770. if R('chromedriver_tests'):
  771. f.AddChromeDriverTest()
  772. if R('webdriver_tests'):
  773. f.AddWebDriverTest()
  774. # Dynamorio coverage.
  775. if R('trigger_coverage_tests'):
  776. f.AddTriggerCoverageTests(fp)
  777. if R('extract_dynamorio_build'):
  778. f.AddExtractDynamorioBuild(fp)
  779. if R('coverage_tests'):
  780. f.AddCoverageTests(fp)
  781. # When adding a test that uses a new executable, update kill_processes.py.
  782. # Coverage tests. Add coverage processing absoluely last, after
  783. # all tests have run. Tests which run after coverage processing
  784. # don't get counted.
  785. if R('process_coverage'):
  786. f.AddProcessCoverage(fp)
  787. # Add nacl integration tests (do these toward the end as they use the
  788. # annotator).
  789. if R('nacl_integration'):
  790. f.AddNaClIntegrationTestStep(fp)
  791. if R('nacl_integration_br'):
  792. f.AddBuildrunnerNaClIntegrationTestStep(fp)
  793. if R('nacl_integration_memcheck'):
  794. f.AddNaClIntegrationTestStep(fp, None, 'memcheck-browser-tests')
  795. if R('nacl_integration_tsan'):
  796. f.AddNaClIntegrationTestStep(fp, None, 'tsan-browser-tests')
  797. if R('buildrunner_tests'):
  798. f.AddBuildStep(factory_properties, name='buildrunner_tests')
  799. # Add bisection test (if this is specified, it should be the only test)
  800. if R('bisect_revisions'):
  801. f.AddBisectTest()
  802. # Add an optional set of annotated steps.
  803. # NOTE: This really should go last as it can be confusing if the annotator
  804. # isn't the last thing to run.
  805. if R('annotated_steps'):
  806. f.AddAnnotatedSteps(fp)
  807. # If this assert triggers and the test name is valid, make sure R() is used.
  808. # If you are using a subclass, make sure the tests list provided to
  809. # _AddTests() had the factory-specific tests stripped off.
  810. assert not tests, 'Did you make a typo? %s wasn\'t processed' % tests
  811. def ChromiumFactory(self, target='Release', clobber=False, tests=None,
  812. mode=None, slave_type='BuilderTester',
  813. options=None, compile_timeout=1200, build_url=None,
  814. project=None, factory_properties=None, gclient_deps=None,
  815. run_default_swarm_tests=None):
  816. factory_properties = (factory_properties or {}).copy()
  817. run_default_swarm_tests = run_default_swarm_tests or []
  818. # Default to the configuration of Blink appropriate for Chromium patches.
  819. factory_properties.setdefault('blink_config', 'chromium')
  820. if factory_properties['blink_config'] == 'blink':
  821. # This will let builders embed their webkit revision in their output
  822. # filename and will let testers look for zip files containing a webkit
  823. # revision in their filename. For this to work correctly, the testers
  824. # need to be on a Triggerable that's activated by their builder.
  825. factory_properties.setdefault('webkit_dir', 'third_party/WebKit/Source')
  826. factory_properties['gclient_env'] = \
  827. factory_properties.get('gclient_env', {}).copy()
  828. tests = tests or []
  829. if factory_properties.get('needs_valgrind'):
  830. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND]
  831. elif factory_properties.get('needs_tsan_win'):
  832. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN]
  833. elif factory_properties.get('needs_webdriver_java_tests'):
  834. self._solutions[0].custom_deps_list = [
  835. self.CUSTOM_DEPS_WEBDRIVER_JAVA_TESTS
  836. ]
  837. if 'devtools_perf' in tests:
  838. self._solutions[0].custom_deps_list.extend(self.CUSTOM_DEPS_DEVTOOLS_PERF)
  839. if factory_properties.get('safesync_url'):
  840. self._solutions[0].safesync_url = factory_properties.get('safesync_url')
  841. elif factory_properties.get('lkgr'):
  842. self._solutions[0].safesync_url = self.SAFESYNC_URL_CHROMIUM
  843. tests_for_build = [
  844. re.match('^(?:valgrind_)?(.*)$', t).group(1) for t in tests]
  845. # Ensure that component is set correctly in the gyp defines.
  846. ForceComponent(target, project, factory_properties['gclient_env'])
  847. # There's 2 different windows SyzyASan builders:
  848. # - The unittests builder, which build all the unittests, instrument
  849. # them and put them in a zip file for the test bots.
  850. # - The Chromium LKGR builder, which build the All_syzygy target of the
  851. # Chromium project with the 'asan' gyp define set. There's no need to
  852. # call a script to do the instrumentation for this target (it's
  853. # already in the build steps). This builder should archive the builds
  854. # for Clusterfuzz, it need to have the 'cf_archive_build' property.
  855. is_win_syzyasan_tests_builder = (slave_type == 'Builder' and
  856. self._target_platform == 'win32' and
  857. factory_properties.get('syzyasan') and
  858. not factory_properties.get('cf_archive_build'))
  859. factory = self.BuildFactory(target, clobber, tests_for_build, mode,
  860. slave_type, options, compile_timeout, build_url,
  861. project, factory_properties,
  862. gclient_deps=gclient_deps,
  863. skip_archive_steps=is_win_syzyasan_tests_builder)
  864. # Get the factory command object to create new steps to the factory.
  865. chromium_cmd_obj = chromium_commands.ChromiumCommands(factory,
  866. target,
  867. self._build_dir,
  868. self._target_platform)
  869. # Add ASANification step for windows unittests.
  870. # MUST BE FIRST STEP ADDED AFTER BuildFactory CALL in order to add back
  871. # the ZipBuild step in it's expected place.
  872. if is_win_syzyasan_tests_builder:
  873. # This must occur before syzygy modifies the dlls.
  874. for dll in ['chrome.dll', 'chrome_child.dll']:
  875. chromium_cmd_obj.AddGenerateCodeTallyStep(dll)
  876. chromium_cmd_obj.AddConvertCodeTallyJsonStep(dll)
  877. if factory_properties.get('code_tally_upload_url'):
  878. chromium_cmd_obj.AddUploadConvertedCodeTally(
  879. dll, factory_properties.get('code_tally_upload_url'))
  880. chromium_cmd_obj.AddWindowsSyzyASanStep()
  881. # Need to add the Zip Build step back
  882. if build_url:
  883. chromium_cmd_obj.AddZipBuild(build_url,
  884. factory_properties=factory_properties)
  885. # Add this archive build step.
  886. if factory_properties.get('archive_build'):
  887. chromium_cmd_obj.AddArchiveBuild(factory_properties=factory_properties)
  888. if factory_properties.get('cf_archive_build'):
  889. chromium_cmd_obj.AddCFArchiveBuild(
  890. factory_properties=factory_properties)
  891. # Add the package source step.
  892. if slave_type == 'Indexer':
  893. chromium_cmd_obj.AddPackageSource(factory_properties=factory_properties)
  894. # Add a trigger step if needed.
  895. self.TriggerFactory(factory, slave_type=slave_type,
  896. factory_properties=factory_properties)
  897. # Start the crash handler process.
  898. if factory_properties.get('start_crash_handler'):
  899. chromium_cmd_obj.AddRunCrashHandler()
  900. # Add all the tests.
  901. self._AddTests(chromium_cmd_obj, tests, mode, factory_properties)
  902. # Add late cf archive build
  903. # The late_cf_archive_build is needed for tools like Dr.Memory to
  904. # collect some information from the tests and pack them into the archive.
  905. if factory_properties.get('late_cf_archive_build'):
  906. chromium_cmd_obj.AddCFArchiveBuild(
  907. factory_properties=factory_properties)
  908. if factory_properties.get('process_dumps'):
  909. chromium_cmd_obj.AddProcessDumps()
  910. return factory
  911. def ChromiumAnnotationFactory(self, annotation_script,
  912. branch='master',
  913. target='Release',
  914. slave_type='AnnotatedBuilderTester',
  915. clobber=False,
  916. compile_timeout=6000,
  917. maxTime=8*60*60,
  918. project=None,
  919. factory_properties=None, options=None,
  920. tests=None,
  921. gclient_deps=None):
  922. """Annotation-driven Chromium buildbot factory.
  923. Like a ChromiumFactory, but non-sync steps (compile, run tests)
  924. are specified in a script that uses @@@BUILD_STEP descriptive
  925. text@@@ style annotations.
  926. Note new slave type AnnotatedBuilderTester; we don't want a
  927. compile step added.
  928. TODO(jrg): is a new slave type the right direction?
  929. """
  930. # Setup factory.
  931. factory_properties = factory_properties or {}
  932. options = options or {}
  933. if self._target_os:
  934. factory_properties['target_os'] = self._target_os
  935. # Ensure that component is set correctly in the gyp defines.
  936. ForceComponent(target, project, factory_properties)
  937. factory = self.BuildFactory(target=target, clobber=clobber,
  938. tests=tests, mode=None, slave_type=slave_type,
  939. options=options,
  940. compile_timeout=compile_timeout, build_url=None,
  941. project=project,
  942. factory_properties=factory_properties,
  943. gclient_deps=gclient_deps)
  944. # Get the factory command object to create new steps to the factory.
  945. chromium_cmd_obj = chromium_commands.ChromiumCommands(
  946. factory=factory,
  947. target=target,
  948. build_dir=self._build_dir,
  949. target_platform=self._target_platform,
  950. target_os=self._target_os)
  951. # Add the main build.
  952. env = factory_properties.get('annotation_env')
  953. factory_properties['target'] = target
  954. factory_properties.setdefault('clobber', clobber)
  955. chromium_cmd_obj.AddAnnotationStep(
  956. name='slave_steps',
  957. cmd=annotation_script,
  958. factory_properties=factory_properties,
  959. env=env, maxTime=maxTime)
  960. # Add archive build step.
  961. if factory_properties.get('archive_build'):
  962. chromium_cmd_obj.AddArchiveBuild(factory_properties=factory_properties)
  963. # Add all the tests.
  964. self._AddTests(factory_cmd_obj=chromium_cmd_obj, tests=tests,
  965. factory_properties=factory_properties)
  966. # Add a trigger step if needed.
  967. self.TriggerFactory(factory, slave_type=slave_type,
  968. factory_properties=factory_properties)
  969. return factory
  970. def ChromiumAVPerfFactory(self, target='Release', clobber=False, tests=None,
  971. mode=None, slave_type='BuilderTester',
  972. options=None, compile_timeout=1200,
  973. build_url=None, project=None,
  974. factory_properties=None):
  975. self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_AVPERF]
  976. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  977. options, compile_timeout, build_url, project,
  978. factory_properties)
  979. def ChromiumNativeClientLatestFactory(
  980. self, target='Release', clobber=False, tests=None, mode=None,
  981. slave_type='BuilderTester', options=None, compile_timeout=1200,
  982. build_url=None, project=None, factory_properties=None,
  983. on_nacl_waterfall=True, use_chrome_lkgr=True):
  984. factory_properties = factory_properties or {}
  985. if on_nacl_waterfall:
  986. factory_properties['primary_repo'] = 'nacl_'
  987. # Remove nacl_trunk variable.
  988. self._solutions[0].custom_vars_list = [
  989. v for v in self._solutions[0].custom_vars_list if v[0] != 'nacl_trunk'
  990. ]
  991. self._solutions[0].custom_vars_list.extend(self.CUSTOM_VARS_NACL_LATEST)
  992. self._solutions[0].safesync_url = self.SAFESYNC_URL_CHROMIUM
  993. if factory_properties.get('needs_nacl_valgrind'):
  994. self._solutions[0].custom_deps_list.append(self.CUSTOM_DEPS_NACL_VALGRIND)
  995. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  996. options, compile_timeout, build_url, project,
  997. factory_properties)
  998. def ChromiumGYPLatestFactory(self, target='Debug', clobber=False, tests=None,
  999. mode=None, slave_type='BuilderTester',
  1000. options=None, compile_timeout=1200,
  1001. build_url=None, project=None,
  1002. factory_properties=None, gyp_format=None):
  1003. if tests is None:
  1004. tests = ['unit']
  1005. if gyp_format:
  1006. # Set GYP_GENERATORS in the environment used to execute
  1007. # gclient so we get the right build tool configuration.
  1008. if factory_properties is None:
  1009. factory_properties = {}
  1010. gclient_env = factory_properties.get('gclient_env', {})
  1011. gclient_env['GYP_GENERATORS'] = gyp_format
  1012. factory_properties['gclient_env'] = gclient_env
  1013. # And tell compile.py what build tool to use.
  1014. if options is None:
  1015. options = []
  1016. options.append('--build-tool=' + gyp_format)
  1017. self._solutions[0].custom_deps_list = self.CUSTOM_DEPS_GYP
  1018. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1019. options, compile_timeout, build_url, project,
  1020. factory_properties)
  1021. def ChromiumOSFactory(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 ChromiumBranchFactory(
  1029. self, target='Release', clobber=False, tests=None, mode=None,
  1030. slave_type='BuilderTester', options=None, compile_timeout=1200,
  1031. build_url=None, project=None, factory_properties=None,
  1032. trunk_src_url=None):
  1033. self._solutions = [gclient_factory.GClientSolution(trunk_src_url, 'src')]
  1034. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1035. options, compile_timeout, build_url, project,
  1036. factory_properties)
  1037. def ChromiumASANFactory(self, target='Release', clobber=False, tests=None,
  1038. mode=None, slave_type='BuilderTester', options=None,
  1039. compile_timeout=1200, build_url=None, project=None,
  1040. factory_properties=None):
  1041. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1042. options, compile_timeout, build_url, project,
  1043. factory_properties)
  1044. def ChromiumOSASANFactory(self, target='Release', clobber=False, tests=None,
  1045. mode=None, slave_type='BuilderTester', options=None,
  1046. compile_timeout=1200, build_url=None, project=None,
  1047. factory_properties=None):
  1048. return self.ChromiumFactory(target, clobber, tests, mode, slave_type,
  1049. options, compile_timeout, build_url, project,
  1050. factory_properties)