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

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: update w/ review feedback 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 if api.step_history.last_step().retcode != 0: 258 if api.step_history.last_step().retcode != 0:
259 if api.platform.is_win: 259 if api.platform.is_win:
260 yield api.chromium.taskkill() 260 yield api.chromium.taskkill()
261 yield ( 261 yield (
262 api.path.rmcontents('slave build directory', api.path['slave_build']), 262 api.path.rmcontents('slave build directory', api.path['slave_build']),
263 api.gclient.checkout(revert=False), 263 api.gclient.checkout(revert=False),
264 api.rietveld.apply_issue(), 264 api.rietveld.apply_issue(),
265 api.chromium.runhooks(), 265 api.chromium.runhooks(),
266 ) 266 )
267 267
268 # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this
269 # recipe and stand up a dedicated GN bot when the GN steps take up enough
270 # resources to be worth it. For now, we run GN and generate files into a new
271 # Debug_gn / Release_gn dir, and then run a compile in that dir.
272 gn_build_config_dir = str(api.chromium.c.BUILD_CONFIG) + '_gn'
273 gn_output_arg = '//out/' + gn_build_config_dir
274 gn_output_dir = api.path['checkout'].join('out', gn_build_config_dir)
275 should_run_gn = api.properties.get('buildername') in ('linux_chromium',
276 'linux_chromium_rel')
277
268 test_spec = api.step_history['read test spec'].json.output 278 test_spec = api.step_history['read test spec'].json.output
269 test_spec = [s.encode('utf-8') for s in test_spec] 279 test_spec = [s.encode('utf-8') for s in test_spec]
270 280
271 tests = [] 281 tests = []
272 tests.append(CheckdepsTest()) 282 tests.append(CheckdepsTest())
273 tests.append(Deps2GitTest()) 283 tests.append(Deps2GitTest())
274 for name in GTEST_TESTS + test_spec: 284 for name in GTEST_TESTS + test_spec:
275 tests.append(GTestTest(name)) 285 tests.append(GTestTest(name))
276 tests.append(NaclIntegrationTest()) 286 tests.append(NaclIntegrationTest())
277 287
278 compile_targets = list(api.itertools.chain( 288 compile_targets = list(api.itertools.chain(
279 *[t.compile_targets() for t in tests])) 289 *[t.compile_targets() for t in tests]))
280 yield api.chromium.compile(compile_targets, 290 yield api.chromium.compile(compile_targets,
281 name='compile (with patch)', 291 name='compile (with patch)',
282 abort_on_failure=False, 292 abort_on_failure=False,
283 can_fail_build=False) 293 can_fail_build=False)
284 if api.step_history['compile (with patch)'].retcode != 0: 294 retry_at_lkcr = api.step_history['compile (with patch)'].retcode != 0
iannucci 2014/03/28 22:40:42 api.step_history.last_step().retcode might be cle
Dirk Pranke 2014/03/28 23:52:06 In this case, that's clearer, and I agree that we
295
296 if not retry_at_lkcr and should_run_gn:
297 yield api.chromium.run_gn(gn_output_arg, abort_on_failure=False,
298 can_fail_build=False)
299 yield api.chromium.compile_with_ninja('compile (gn with patch)',
300 gn_output_dir,
301 abort_on_failure=False,
302 can_fail_build=False)
303 retry_at_lkcr = (api.step_history['gn'].retcode != 0 or
304 api.step_history['compile (gn with patch)'].retcode != 0)
305
306 if retry_at_lkcr:
285 # Only use LKCR when compile fails. Note that requested specific revision 307 # Only use LKCR when compile fails. Note that requested specific revision
286 # can still override this. 308 # can still override this.
287 api.gclient.set_config('chromium_lkcr') 309 api.gclient.set_config('chromium_lkcr')
288 310
289 # Since we're likely to switch to an earlier revision, revert the patch, 311 # Since we're likely to switch to an earlier revision, revert the patch,
290 # sync with the new config, and apply issue again. 312 # sync with the new config, and apply issue again.
291 yield api.gclient.checkout(revert=True) 313 yield api.gclient.checkout(revert=True)
292 yield api.rietveld.apply_issue() 314 yield api.rietveld.apply_issue()
293 315
294 yield api.chromium.compile(compile_targets, 316 yield api.chromium.compile(compile_targets,
295 name='compile (with patch, lkcr, clobber)', 317 name='compile (with patch, lkcr, clobber)',
296 force_clobber=True, 318 force_clobber=True,
297 abort_on_failure=False, 319 abort_on_failure=False,
298 can_fail_build=False) 320 can_fail_build=False)
299 if api.step_history['compile (with patch, lkcr, clobber)'].retcode != 0: 321 if api.step_history['compile (with patch, lkcr, clobber)'].retcode != 0:
300 if api.platform.is_win: 322 if api.platform.is_win:
301 yield api.chromium.taskkill() 323 yield api.chromium.taskkill()
302 yield ( 324 yield (
303 api.path.rmcontents('slave build directory', api.path['slave_build']), 325 api.path.rmcontents('slave build directory', api.path['slave_build']),
304 api.gclient.checkout(revert=False), 326 api.gclient.checkout(revert=False),
305 api.rietveld.apply_issue(), 327 api.rietveld.apply_issue(),
306 api.chromium.runhooks(), 328 api.chromium.runhooks(),
307 api.chromium.compile(compile_targets, 329 api.chromium.compile(compile_targets,
308 name='compile (with patch, lkcr, clobber, nuke)', 330 name='compile (with patch, lkcr, clobber, nuke)',
309 force_clobber=True) 331 force_clobber=True)
310 ) 332 )
311 333
334 if should_run_gn:
335 yield api.path.rmcontents('slave gn build directory', gn_output_dir)
336 yield api.chromium.run_gn(gn_output_arg)
337 yield api.chromium.compile_with_ninja(
338 'compile (gn with patch, lkcr, clobber)', gn_output_dir)
339
312 # Do not run tests if the build is already in a failed state. 340 # Do not run tests if the build is already in a failed state.
313 if api.step_history.failed: 341 if api.step_history.failed:
314 return 342 return
315 343
316 if recipe_config['compile_only']: 344 if recipe_config['compile_only']:
317 return 345 return
318 346
319 # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON). 347 # TODO(dpranke): crbug.com/353690. It would be good to run gn_unittests
348 # out of the gn build dir, but we can't use runtest()
349 # because of the different output directory; this means
350 # we don't get annotations and don't get retry of the tests for free :( .
351
352 # TODO(phajdan.jr): Make it possible to retry telemetry tests (add JSON).
320 yield ( 353 yield (
321 api.chromium.run_telemetry_unittests(), 354 api.chromium.run_telemetry_unittests(),
322 api.chromium.run_telemetry_perf_unittests(), 355 api.chromium.run_telemetry_perf_unittests(),
323 ) 356 )
324 357
325 def deapply_patch_fn(failing_tests): 358 def deapply_patch_fn(failing_tests):
326 yield ( 359 yield (
327 api.gclient.revert(), 360 api.gclient.revert(),
328 api.chromium.runhooks(), 361 api.chromium.runhooks(),
329 ) 362 )
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 ) 488 )
456 489
457 yield ( 490 yield (
458 api.test('compile_failure_linux') + 491 api.test('compile_failure_linux') +
459 props() + 492 props() +
460 api.platform.name('linux') + 493 api.platform.name('linux') +
461 api.step_data('compile (with patch)', retcode=1) + 494 api.step_data('compile (with patch)', retcode=1) +
462 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) + 495 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) +
463 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1) 496 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1)
464 ) 497 )
498
499 # TODO(dpranke): crbug.com/353690.
500 # Remove this when we make GN a standalone recipe.
501 yield (
502 api.test('unittest_should_run_gn') +
503 api.properties.tryserver(buildername='linux_chromium',
504 build_config='Debug') +
505 api.platform.name('linux') +
506 api.step_data('compile (gn with patch)')
iannucci 2014/03/28 22:40:42 can remove this empty step_data
Dirk Pranke 2014/03/28 23:52:44 okay.
507 )
508
509 yield (
510 api.test('unittest_should_run_gn_compile_failure') +
511 api.properties.tryserver(buildername='linux_chromium',
512 build_config='Debug') +
513 api.platform.name('linux') +
514 api.step_data('compile (gn with patch)', retcode=1)
515 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698