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

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: initial patch for review Created 6 years, 8 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 yield api.gclient.checkout(revert=True) 236 yield api.gclient.checkout(revert=True)
237 yield ( 237 yield (
238 api.rietveld.apply_issue(), 238 api.rietveld.apply_issue(),
239 api.json.read( 239 api.json.read(
240 'read test spec', 240 'read test spec',
241 api.path['checkout'].join('testing', 'buildbot', 'chromium_trybot.json'), 241 api.path['checkout'].join('testing', 'buildbot', 'chromium_trybot.json'),
242 step_test_data=lambda: api.json.test_api.output([])), 242 step_test_data=lambda: api.json.test_api.output([])),
243 api.chromium.runhooks(), 243 api.chromium.runhooks(),
244 ) 244 )
245 245
246 # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this
247 # recipe and stand up a dedicated GN bot when the GN steps take up enough
248 # resources to be worth it. For now, we run GN and generate files into a new
249 # Debug_gn / build in that dir, and run gn_unittests from that dir (w/o
250 # uploading any test data or parsing the annotations).
251 gn_output_dir = api.path['slave_build'].join(api.chromium.c.BUILD_CONFIG +
252 '_gn')
253 should_run_gn = api.properties.get('buildername') in ('linux', 'linux_rel')
Paweł Hajdan Jr. 2014/03/26 11:44:59 This recipe is not running on any of these builder
Dirk Pranke 2014/03/26 16:52:28 Right! Will fix.
254
246 test_spec = api.step_history['read test spec'].json.output 255 test_spec = api.step_history['read test spec'].json.output
247 test_spec = [s.encode('utf-8') for s in test_spec] 256 test_spec = [s.encode('utf-8') for s in test_spec]
248 257
249 tests = [] 258 tests = []
250 tests.append(CheckdepsTest()) 259 tests.append(CheckdepsTest())
251 tests.append(Deps2GitTest()) 260 tests.append(Deps2GitTest())
252 for name in GTEST_TESTS + test_spec: 261 for name in GTEST_TESTS + test_spec:
253 tests.append(GTestTest(name)) 262 tests.append(GTestTest(name))
254 tests.append(NaclIntegrationTest()) 263 tests.append(NaclIntegrationTest())
255 264
256 compile_targets = list(api.itertools.chain( 265 compile_targets = list(api.itertools.chain(
257 *[t.compile_targets() for t in tests])) 266 *[t.compile_targets() for t in tests]))
258 yield api.chromium.compile(compile_targets, 267 yield api.chromium.compile(compile_targets,
259 name='compile (with patch)', 268 name='compile (with patch)',
260 abort_on_failure=False, 269 abort_on_failure=False,
261 can_fail_build=False) 270 can_fail_build=False)
262 if api.step_history['compile (with patch)'].retcode != 0: 271 if should_run_gn:
272 yield api.chromium.run_gn(gn_output_dir)
273 yield api.chromium.compile_with_ninja('compile (gn with patch)',
Paweł Hajdan Jr. 2014/03/26 11:44:59 Shouldn't this _replace_ api.chromium.compile for
Dirk Pranke 2014/03/26 16:52:28 No. This and other comments make me think that you
274 gn_output_dir)
iannucci 2014/03/26 09:38:49 we may want to set 'can_fail_build=False, abort_on
Dirk Pranke 2014/03/26 16:52:28 Good point, will do.
Dirk Pranke 2014/03/26 19:16:35 Oh, I misread this. No, they should be green.
275
276 if ((api.step_history['compile (with patch)'].retcode != 0) or
277 (should_run_gn and
278 api.step_history['compile (gn with patch)'].retcode != 0)):
263 # Only use LKCR when compile fails. Note that requested specific revision 279 # Only use LKCR when compile fails. Note that requested specific revision
264 # can still override this. 280 # can still override this.
265 api.gclient.set_config('chromium_lkcr') 281 api.gclient.set_config('chromium_lkcr')
266 282
267 # Since we're likely to switch to an earlier revision, revert the patch, 283 # Since we're likely to switch to an earlier revision, revert the patch,
268 # sync with the new config, and apply issue again. 284 # sync with the new config, and apply issue again.
269 yield api.gclient.checkout(revert=True) 285 yield api.gclient.checkout(revert=True)
270 yield ( 286 yield (
271 api.rietveld.apply_issue(), 287 api.rietveld.apply_issue(),
272 api.chromium.compile(compile_targets, 288 api.chromium.compile(compile_targets,
273 name='compile (with patch, lkcr, clobber)', 289 name='compile (with patch, lkcr, clobber)',
274 force_clobber=True) 290 force_clobber=True)
275 ) 291 )
276 292
293 if should_run_gn:
294 yield api.path.rmcontents('slave gn build directory', gn_output_dir)
Paweł Hajdan Jr. 2014/03/26 11:44:59 Instead of this, could you add force_clobber to th
Dirk Pranke 2014/03/26 16:52:28 Nope :(. force_clobber doesn't support custom outp
295 yield api.chromium.run_gn(gn_output_dir)
296 yield api.chromium.compile_with_ninja(
297 'compile (gn with patch, lkcr, clobber)', gn_output_dir)
298
277 # Do not run tests if the build is already in a failed state. 299 # Do not run tests if the build is already in a failed state.
278 if api.step_history.failed: 300 if api.step_history.failed:
279 return 301 return
280 302
281 if recipe_config['compile_only']: 303 if recipe_config['compile_only']:
282 return 304 return
283 305
306 # TODO(dpranke): crbug.com/353690. We can't use runtest() for gn_unittests
307 # on the trybots because of the different output directory; this means
308 # we don't get annotations and don't get retry of the tests for free :( .
309 # For now we'll hope that this is short-lived until we get dedicated GN
310 # trybots, and assume that making runtest() work w/ a differe output dir
iannucci 2014/03/26 09:38:49 *different Though it would be /best/ if we could
Dirk Pranke 2014/03/26 16:52:28 Yes, and I agree that we should probably try to by
311 # is not worth it.
312 if should_run_gn:
313 yield api.step(name='gn_unittests',
314 cmd=[gn_output_dir.join('gn_unittests',
Paweł Hajdan Jr. 2014/03/26 11:44:59 Sorry, all new code added here MUST support retrie
Dirk Pranke 2014/03/26 16:52:28 I forgot to add a TODO -- and will do so -- but I
Dirk Pranke 2014/03/26 19:16:35 Actually, per further discussion w/ Robbie, I'm go
315 platform_ext={'win': '.exe',})])
316
284 # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON). 317 # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON).
285 yield ( 318 yield (
286 api.chromium.run_telemetry_unittests(), 319 api.chromium.run_telemetry_unittests(),
287 api.chromium.run_telemetry_perf_unittests(), 320 api.chromium.run_telemetry_perf_unittests(),
288 ) 321 )
289 322
290 def deapply_patch_fn(failing_tests): 323 def deapply_patch_fn(failing_tests):
291 yield ( 324 yield (
292 api.gclient.revert(), 325 api.gclient.revert(),
293 api.chromium.runhooks(), 326 api.chromium.runhooks(),
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 ) 585 )
553 ) 586 )
554 587
555 yield ( 588 yield (
556 api.test('compile_failure') + 589 api.test('compile_failure') +
557 props() + 590 props() +
558 api.platform.name('win') + 591 api.platform.name('win') +
559 api.step_data('compile (with patch)', retcode=1) + 592 api.step_data('compile (with patch)', retcode=1) +
560 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) 593 api.step_data('compile (with patch, lkcr, clobber)', retcode=1)
561 ) 594 )
595
596 # TODO(dpranke): crbug.com/353690.
597 # Remove this when we make GN a standalone recipe.
598 yield (
599 api.test('unittest_should_run_gn') +
600 api.properties.tryserver(buildername='linux', build_config='Debug') +
601 api.platform.name('linux') +
602 api.step_data('compile (gn with patch)', api.json.output(None)) +
Paweł Hajdan Jr. 2014/03/26 11:44:59 These shouldn't be needed after my latest changes.
Dirk Pranke 2014/03/26 16:52:28 Why not?
Dirk Pranke 2014/03/26 19:16:35 Never mind, I think I've got it now.
603 api.step_data('gclient revert') +
604 api.step_data('checkdeps (with patch)', api.json.output(None)) +
605 api.override_step_data('deps2git (with patch)', api.json.output(None)) +
606 api.step_data('nacl_integration (with patch)', api.json.output(None)) +
607 reduce(
608 lambda a, b: a + b,
iannucci 2014/03/26 09:38:49 isn't this the same as sum?
Dirk Pranke 2014/03/26 16:52:28 Think so :). I was just cutting and pasting. Will
Dirk Pranke 2014/03/26 19:16:35 cleaned up on merge.
609 (api.step_data('%s (with patch)' % name, canned_test(passing=True))
610 for name in GTEST_TESTS)
611 )
612 )
613
614 yield (
615 api.test('unittest_should_run_gn_compile_failure') +
616 api.properties.tryserver(buildername='linux', build_config='Debug') +
617 api.platform.name('linux') +
618 api.step_data('compile (gn with patch)', retcode=1) +
619 api.step_data('gclient revert') +
Paweł Hajdan Jr. 2014/03/26 11:44:59 This is likely a no-op.
Dirk Pranke 2014/03/26 16:52:28 I don't know what that means; are you saying I don
Dirk Pranke 2014/03/26 19:16:35 cleaned up on merge.
620 api.step_data('compile (gn with patch, lkcr, clobber)', retcode=1)
621 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698