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

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

Issue 339183013: De-duplicate steps between chromium and chromium_trybot recipes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: fixes Created 6 years, 5 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 'bot_update', 6 'bot_update',
7 'chromium', 7 'chromium',
8 'gclient', 8 'gclient',
9 'json', 9 'json',
10 'path', 10 'path',
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 'testing': { 247 'testing': {
248 'platform': 'linux', 248 'platform': 'linux',
249 }, 249 },
250 }, 250 },
251 }, 251 },
252 }, 252 },
253 } 253 }
254 254
255 255
256 def GenSteps(api): 256 def GenSteps(api):
257 class BlinkTest(api.test_utils.Test):
258 name = 'webkit_tests'
259
260 def __init__(self):
261 self.results_dir = api.path['slave_build'].join('layout-test-results')
262 self.layout_test_wrapper = api.path['build'].join(
263 'scripts', 'slave', 'chromium', 'layout_test_wrapper.py')
264
265 def run(self, suffix):
266 args = ['--target', api.chromium.c.BUILD_CONFIG,
267 '-o', self.results_dir,
268 '--build-dir', api.chromium.c.build_dir,
269 '--json-test-results', api.json.test_results(add_json_log=False)]
270 if suffix == 'without patch':
271 test_list = "\n".join(self.failures('with patch'))
272 args.extend(['--test-list', api.raw_io.input(test_list),
273 '--skipped', 'always'])
274
275 if 'oilpan' in api.properties['buildername']:
276 args.extend(['--additional-expectations',
277 api.path['checkout'].join('third_party', 'WebKit',
278 'LayoutTests',
279 'OilpanExpectations')])
280
281 def followup_fn(step_result):
282 r = step_result.json.test_results
283 p = step_result.presentation
284
285 p.step_text += api.test_utils.format_step_text([
286 ['unexpected_flakes:', r.unexpected_flakes.keys()],
287 ['unexpected_failures:', r.unexpected_failures.keys()],
288 ['Total executed: %s' % r.num_passes],
289 ])
290
291 if r.unexpected_flakes or r.unexpected_failures:
292 p.status = 'WARNING'
293 else:
294 p.status = 'SUCCESS'
295
296 yield api.chromium.runtest(self.layout_test_wrapper,
297 args,
298 name=self._step_name(suffix),
299 can_fail_build=False,
300 followup_fn=followup_fn)
301
302 if suffix == 'with patch':
303 buildername = api.properties['buildername']
304 buildnumber = api.properties['buildnumber']
305 def archive_webkit_tests_results_followup(step_result):
306 base = (
307 "https://storage.googleapis.com/chromium-layout-test-archives/%s/%s"
308 % (buildername, buildnumber))
309
310 step_result.presentation.links['layout_test_results'] = (
311 base + '/layout-test-results/results.html')
312 step_result.presentation.links['(zip)'] = (
313 base + '/layout-test-results.zip')
314
315 archive_layout_test_results = api.path['build'].join(
316 'scripts', 'slave', 'chromium', 'archive_layout_test_results.py')
317
318 yield api.python(
319 'archive_webkit_tests_results',
320 archive_layout_test_results,
321 [
322 '--results-dir', self.results_dir,
323 '--build-dir', api.chromium.c.build_dir,
324 '--build-number', buildnumber,
325 '--builder-name', buildername,
326 '--gs-bucket', 'gs://chromium-layout-test-archives',
327 ] + api.json.property_args(),
328 followup_fn=archive_webkit_tests_results_followup
329 )
330
331 def has_valid_results(self, suffix):
332 step = api.step_history[self._step_name(suffix)]
333 # TODO(dpranke): crbug.com/357866 - note that all comparing against
334 # MAX_FAILURES_EXIT_STATUS tells us is that we did not exit early
335 # or abnormally; it does not tell us how many failures there actually
336 # were, which might be much higher (up to 5000 diffs, where we
337 # would bail out early with --exit-after-n-failures) or lower
338 # if we bailed out after 100 crashes w/ -exit-after-n-crashes, in
339 # which case the retcode is actually 130
340 return (step.json.test_results.valid and
341 step.retcode <= step.json.test_results.MAX_FAILURES_EXIT_STATUS)
342
343 def failures(self, suffix):
344 sn = self._step_name(suffix)
345 return api.step_history[sn].json.test_results.unexpected_failures
346
347 mastername = api.properties.get('mastername') 257 mastername = api.properties.get('mastername')
348 buildername = api.properties.get('buildername') 258 buildername = api.properties.get('buildername')
349 master_dict = BUILDERS.get(mastername, {}) 259 master_dict = BUILDERS.get(mastername, {})
350 bot_config = master_dict.get('builders', {}).get(buildername) 260 bot_config = master_dict.get('builders', {}).get(buildername)
351 261
352 api.chromium.set_config('blink', 262 api.chromium.set_config('blink',
353 **bot_config.get('chromium_config_kwargs', {})) 263 **bot_config.get('chromium_config_kwargs', {}))
354 api.chromium.apply_config('trybot_flavor') 264 api.chromium.apply_config('trybot_flavor')
355 api.gclient.set_config('blink_internal') 265 api.gclient.set_config('blink_internal')
356 if bot_config.get('v8_blink_flavor'): 266 if bot_config.get('v8_blink_flavor'):
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 302
393 if not bot_config['compile_only']: 303 if not bot_config['compile_only']:
394 def deapply_patch_fn(_failing_steps): 304 def deapply_patch_fn(_failing_steps):
395 yield api.bot_update.ensure_checkout(patch=False, always_run=True) 305 yield api.bot_update.ensure_checkout(patch=False, always_run=True)
396 306
397 yield ( 307 yield (
398 api.chromium.runhooks(always_run=True), 308 api.chromium.runhooks(always_run=True),
399 api.chromium.compile(always_run=True), 309 api.chromium.compile(always_run=True),
400 ) 310 )
401 311
402 yield api.test_utils.determine_new_failures([BlinkTest()], deapply_patch_fn) 312 yield api.test_utils.determine_new_failures(
313 api, [api.chromium.steps.BlinkTest(api)], deapply_patch_fn)
403 314
404 315
405 def _sanitize_nonalpha(text): 316 def _sanitize_nonalpha(text):
406 return ''.join(c if c.isalnum() else '_' for c in text) 317 return ''.join(c if c.isalnum() else '_' for c in text)
407 318
408 319
409 def GenTests(api): 320 def GenTests(api):
410 canned_test = api.json.canned_test_output 321 canned_test = api.json.canned_test_output
411 with_patch = 'webkit_tests (with patch)' 322 with_patch = 'webkit_tests (with patch)'
412 without_patch = 'webkit_tests (without patch)' 323 without_patch = 'webkit_tests (without patch)'
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 # and compare the lists of failing tests). 418 # and compare the lists of failing tests).
508 yield ( 419 yield (
509 api.test('too_many_failures_for_retcode') + 420 api.test('too_many_failures_for_retcode') +
510 properties('tryserver.blink', 'linux_blink_rel') + 421 properties('tryserver.blink', 'linux_blink_rel') +
511 api.override_step_data(with_patch, 422 api.override_step_data(with_patch,
512 canned_test(passing=False, 423 canned_test(passing=False,
513 num_additional_failures=125)) + 424 num_additional_failures=125)) +
514 api.override_step_data(without_patch, 425 api.override_step_data(without_patch,
515 canned_test(passing=True, minimal=True)) 426 canned_test(passing=True, minimal=True))
516 ) 427 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698