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

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

Issue 211473006: Add GN (the build tool) to the chromium.linux buildbots and try jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: merge to r260023 Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'chromium', 6 'chromium',
7 'gclient', 7 'gclient',
8 'itertools', 8 'itertools',
9 'json', 9 'json',
10 'path', 10 'path',
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 yield api.chromium.runhooks(abort_on_failure=False, can_fail_build=False) 255 yield api.chromium.runhooks(abort_on_failure=False, can_fail_build=False)
256 if api.step_history.last_step().retcode != 0: 256 if api.step_history.last_step().retcode != 0:
257 yield ( 257 yield (
258 api.path.rmcontents('slave build directory', api.path['slave_build']), 258 api.path.rmcontents('slave build directory', api.path['slave_build']),
259 api.gclient.checkout(revert=False), 259 api.gclient.checkout(revert=False),
260 api.rietveld.apply_issue(), 260 api.rietveld.apply_issue(),
261 api.chromium.runhooks(), 261 api.chromium.runhooks(),
262 ) 262 )
263 263
264 # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this
265 # recipe and stand up a dedicated GN bot when the GN steps take up enough
266 # resources to be worth it. For now, we run GN and generate files into a new
267 # Debug_gn / Release_gn dir, and then run a compile in that dir.
268 gn_build_config_dir = str(api.chromium.c.BUILD_CONFIG) + '_gn'
269 gn_output_arg = '//out/' + gn_build_config_dir
270 gn_output_dir = api.path['checkout'].join('out', gn_build_config_dir)
271 should_run_gn = api.properties.get('buildername') in ('linux_chromium',
272 'linux_chromium_rel')
273
264 test_spec = api.step_history['read test spec'].json.output 274 test_spec = api.step_history['read test spec'].json.output
265 test_spec = [s.encode('utf-8') for s in test_spec] 275 test_spec = [s.encode('utf-8') for s in test_spec]
266 276
267 tests = [] 277 tests = []
268 tests.append(CheckdepsTest()) 278 tests.append(CheckdepsTest())
269 tests.append(Deps2GitTest()) 279 tests.append(Deps2GitTest())
270 for name in GTEST_TESTS + test_spec: 280 for name in GTEST_TESTS + test_spec:
271 tests.append(GTestTest(name)) 281 tests.append(GTestTest(name))
272 tests.append(NaclIntegrationTest()) 282 tests.append(NaclIntegrationTest())
273 283
274 compile_targets = list(api.itertools.chain( 284 compile_targets = list(api.itertools.chain(
275 *[t.compile_targets() for t in tests])) 285 *[t.compile_targets() for t in tests]))
276 yield api.chromium.compile(compile_targets, 286 yield api.chromium.compile(compile_targets,
277 name='compile (with patch)', 287 name='compile (with patch)',
278 abort_on_failure=False, 288 abort_on_failure=False,
279 can_fail_build=False) 289 can_fail_build=False)
280 if api.step_history['compile (with patch)'].retcode != 0: 290 if should_run_gn:
291 yield api.chromium.run_gn(gn_output_arg)
292 yield api.chromium.compile_with_ninja('compile (gn with patch)',
293 gn_output_dir)
294
295 if ((api.step_history['compile (with patch)'].retcode != 0) or
296 (should_run_gn and
297 api.step_history['compile (gn with patch)'].retcode != 0)):
Paweł Hajdan Jr. 2014/03/28 09:45:04 For the fallback to be useful please mark compile_
Dirk Pranke 2014/03/28 15:59:43 Good catch, will do.
281 # Only use LKCR when compile fails. Note that requested specific revision 298 # Only use LKCR when compile fails. Note that requested specific revision
282 # can still override this. 299 # can still override this.
283 api.gclient.set_config('chromium_lkcr') 300 api.gclient.set_config('chromium_lkcr')
284 301
285 # Since we're likely to switch to an earlier revision, revert the patch, 302 # Since we're likely to switch to an earlier revision, revert the patch,
286 # sync with the new config, and apply issue again. 303 # sync with the new config, and apply issue again.
287 yield api.gclient.checkout(revert=True) 304 yield api.gclient.checkout(revert=True)
288 yield api.rietveld.apply_issue() 305 yield api.rietveld.apply_issue()
289 306
290 yield api.chromium.compile(compile_targets, 307 yield api.chromium.compile(compile_targets,
291 name='compile (with patch, lkcr, clobber)', 308 name='compile (with patch, lkcr, clobber)',
292 force_clobber=True, 309 force_clobber=True,
293 abort_on_failure=False, 310 abort_on_failure=False,
294 can_fail_build=False) 311 can_fail_build=False)
295 if api.step_history['compile (with patch, lkcr, clobber)'].retcode != 0: 312 if api.step_history['compile (with patch, lkcr, clobber)'].retcode != 0:
296 yield ( 313 yield (
297 api.path.rmcontents('slave build directory', api.path['slave_build']), 314 api.path.rmcontents('slave build directory', api.path['slave_build']),
298 api.gclient.checkout(revert=False), 315 api.gclient.checkout(revert=False),
299 api.rietveld.apply_issue(), 316 api.rietveld.apply_issue(),
300 api.chromium.runhooks(), 317 api.chromium.runhooks(),
301 api.chromium.compile(compile_targets, 318 api.chromium.compile(compile_targets,
302 name='compile (with patch, lkcr, clobber, nuke)', 319 name='compile (with patch, lkcr, clobber, nuke)',
303 force_clobber=True) 320 force_clobber=True)
304 ) 321 )
305 322
323 if should_run_gn:
324 yield api.path.rmcontents('slave gn build directory', gn_output_dir)
325 yield api.chromium.run_gn(gn_output_arg)
326 yield api.chromium.compile_with_ninja(
327 'compile (gn with patch, lkcr, clobber)', gn_output_dir)
328
306 # Do not run tests if the build is already in a failed state. 329 # Do not run tests if the build is already in a failed state.
307 if api.step_history.failed: 330 if api.step_history.failed:
308 return 331 return
309 332
310 if recipe_config['compile_only']: 333 if recipe_config['compile_only']:
311 return 334 return
312 335
313 # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON). 336 # TODO(dpranke): crbug.com/353690. It would be good to run gn_unittests
337 # out of the gn build dir, but we can't use runtest()
338 # because of the different output directory; this means
339 # we don't get annotations and don't get retry of the tests for free :( .
340
341 # TODO(phajdan.jr): Make it possible to retry telemetry tests (add JSON).
314 yield ( 342 yield (
315 api.chromium.run_telemetry_unittests(), 343 api.chromium.run_telemetry_unittests(),
316 api.chromium.run_telemetry_perf_unittests(), 344 api.chromium.run_telemetry_perf_unittests(),
317 ) 345 )
318 346
319 def deapply_patch_fn(failing_tests): 347 def deapply_patch_fn(failing_tests):
320 yield ( 348 yield (
321 api.gclient.revert(), 349 api.gclient.revert(),
322 api.chromium.runhooks(), 350 api.chromium.runhooks(),
323 ) 351 )
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 ) 468 )
441 469
442 yield ( 470 yield (
443 api.test('compile_failure_linux') + 471 api.test('compile_failure_linux') +
444 props() + 472 props() +
445 api.platform.name('linux') + 473 api.platform.name('linux') +
446 api.step_data('compile (with patch)', retcode=1) + 474 api.step_data('compile (with patch)', retcode=1) +
447 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) + 475 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) +
448 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1) 476 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1)
449 ) 477 )
478
479 # TODO(dpranke): crbug.com/353690.
480 # Remove this when we make GN a standalone recipe.
481 yield (
482 api.test('unittest_should_run_gn') +
483 api.properties.tryserver(buildername='linux_chromium',
484 build_config='Debug') +
485 api.platform.name('linux') +
486 api.step_data('compile (gn with patch)')
487 )
488
489 yield (
490 api.test('unittest_should_run_gn_compile_failure') +
491 api.properties.tryserver(buildername='linux_chromium',
492 build_config='Debug') +
493 api.platform.name('linux') +
494 api.step_data('compile (gn with patch)', retcode=1)
495 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698