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

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: 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 'testing': { 237 'testing': {
238 'platform': 'linux', 238 'platform': 'linux',
239 }, 239 },
240 }, 240 },
241 }, 241 },
242 }, 242 },
243 } 243 }
244 244
245 245
246 def GenSteps(api): 246 def GenSteps(api):
247 class BlinkTest(api.test_utils.Test): 247 class BlinkTest(api.chromium.steps.Test):
248 name = 'webkit_tests' 248 name = 'webkit_tests'
249 249
250 def __init__(self): 250 def __init__(self):
251 self.results_dir = api.path['slave_build'].join('layout-test-results') 251 self.results_dir = api.path['slave_build'].join('layout-test-results')
252 self.layout_test_wrapper = api.path['build'].join( 252 self.layout_test_wrapper = api.path['build'].join(
253 'scripts', 'slave', 'chromium', 'layout_test_wrapper.py') 253 'scripts', 'slave', 'chromium', 'layout_test_wrapper.py')
254 254
255 def run(self, suffix): 255 def run(self, api, suffix):
256 args = ['--target', api.chromium.c.BUILD_CONFIG, 256 args = ['--target', api.chromium.c.BUILD_CONFIG,
257 '-o', self.results_dir, 257 '-o', self.results_dir,
258 '--build-dir', api.chromium.c.build_dir, 258 '--build-dir', api.chromium.c.build_dir,
259 '--json-test-results', api.json.test_results(add_json_log=False)] 259 '--json-test-results', api.json.test_results(add_json_log=False)]
260 if suffix == 'without patch': 260 if suffix == 'without patch':
261 test_list = "\n".join(self.failures('with patch')) 261 test_list = "\n".join(self.failures(api, 'with patch'))
262 args.extend(['--test-list', api.raw_io.input(test_list), 262 args.extend(['--test-list', api.raw_io.input(test_list),
263 '--skipped', 'always']) 263 '--skipped', 'always'])
264 264
265 if 'oilpan' in api.properties['buildername']: 265 if 'oilpan' in api.properties['buildername']:
266 args.extend(['--additional-expectations', 266 args.extend(['--additional-expectations',
267 api.path['checkout'].join('third_party', 'WebKit', 267 api.path['checkout'].join('third_party', 'WebKit',
268 'LayoutTests', 268 'LayoutTests',
269 'OilpanExpectations')]) 269 'OilpanExpectations')])
270 270
271 def followup_fn(step_result): 271 def followup_fn(step_result):
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 [ 311 [
312 '--results-dir', self.results_dir, 312 '--results-dir', self.results_dir,
313 '--build-dir', api.chromium.c.build_dir, 313 '--build-dir', api.chromium.c.build_dir,
314 '--build-number', buildnumber, 314 '--build-number', buildnumber,
315 '--builder-name', buildername, 315 '--builder-name', buildername,
316 '--gs-bucket', 'gs://chromium-layout-test-archives', 316 '--gs-bucket', 'gs://chromium-layout-test-archives',
317 ] + api.json.property_args(), 317 ] + api.json.property_args(),
318 followup_fn=archive_webkit_tests_results_followup 318 followup_fn=archive_webkit_tests_results_followup
319 ) 319 )
320 320
321 def has_valid_results(self, suffix): 321 def has_valid_results(self, api, suffix):
322 step = api.step_history[self._step_name(suffix)] 322 step = api.step_history[self._step_name(suffix)]
323 # TODO(dpranke): crbug.com/357866 - note that all comparing against 323 # TODO(dpranke): crbug.com/357866 - note that all comparing against
324 # MAX_FAILURES_EXIT_STATUS tells us is that we did not exit early 324 # MAX_FAILURES_EXIT_STATUS tells us is that we did not exit early
325 # or abnormally; it does not tell us how many failures there actually 325 # or abnormally; it does not tell us how many failures there actually
326 # were, which might be much higher (up to 5000 diffs, where we 326 # were, which might be much higher (up to 5000 diffs, where we
327 # would bail out early with --exit-after-n-failures) or lower 327 # would bail out early with --exit-after-n-failures) or lower
328 # if we bailed out after 100 crashes w/ -exit-after-n-crashes, in 328 # if we bailed out after 100 crashes w/ -exit-after-n-crashes, in
329 # which case the retcode is actually 130 329 # which case the retcode is actually 130
330 return (step.json.test_results.valid and 330 return (step.json.test_results.valid and
331 step.retcode <= step.json.test_results.MAX_FAILURES_EXIT_STATUS) 331 step.retcode <= step.json.test_results.MAX_FAILURES_EXIT_STATUS)
332 332
333 def failures(self, suffix): 333 def failures(self, api, suffix):
334 sn = self._step_name(suffix) 334 sn = self._step_name(suffix)
335 return api.step_history[sn].json.test_results.unexpected_failures 335 return api.step_history[sn].json.test_results.unexpected_failures
336 336
337 mastername = api.properties.get('mastername') 337 mastername = api.properties.get('mastername')
338 buildername = api.properties.get('buildername') 338 buildername = api.properties.get('buildername')
339 master_dict = BUILDERS.get(mastername, {}) 339 master_dict = BUILDERS.get(mastername, {})
340 bot_config = master_dict.get('builders', {}).get(buildername) 340 bot_config = master_dict.get('builders', {}).get(buildername)
341 341
342 api.chromium.set_config('blink', 342 api.chromium.set_config('blink',
343 **bot_config.get('chromium_config_kwargs', {})) 343 **bot_config.get('chromium_config_kwargs', {}))
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 if bot_update_mode: 419 if bot_update_mode:
420 yield api.bot_update.ensure_checkout(patch=False, always_run=True) 420 yield api.bot_update.ensure_checkout(patch=False, always_run=True)
421 else: 421 else:
422 yield api.gclient.checkout(revert=True, always_run=True) 422 yield api.gclient.checkout(revert=True, always_run=True)
423 423
424 yield ( 424 yield (
425 api.chromium.runhooks(always_run=True), 425 api.chromium.runhooks(always_run=True),
426 api.chromium.compile(always_run=True), 426 api.chromium.compile(always_run=True),
427 ) 427 )
428 428
429 yield api.test_utils.determine_new_failures([BlinkTest()], deapply_patch_fn) 429 yield api.test_utils.determine_new_failures(
430 api, [BlinkTest()], deapply_patch_fn)
430 431
431 432
432 def _sanitize_nonalpha(text): 433 def _sanitize_nonalpha(text):
433 return ''.join(c if c.isalnum() else '_' for c in text) 434 return ''.join(c if c.isalnum() else '_' for c in text)
434 435
435 436
436 def GenTests(api): 437 def GenTests(api):
437 canned_test = api.json.canned_test_output 438 canned_test = api.json.canned_test_output
438 with_patch = 'webkit_tests (with patch)' 439 with_patch = 'webkit_tests (with patch)'
439 without_patch = 'webkit_tests (without patch)' 440 without_patch = 'webkit_tests (without patch)'
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 # and compare the lists of failing tests). 542 # and compare the lists of failing tests).
542 yield ( 543 yield (
543 api.test('too_many_failures_for_retcode') + 544 api.test('too_many_failures_for_retcode') +
544 properties('tryserver.blink', 'linux_blink_rel') + 545 properties('tryserver.blink', 'linux_blink_rel') +
545 api.override_step_data(with_patch, 546 api.override_step_data(with_patch,
546 canned_test(passing=False, 547 canned_test(passing=False,
547 num_additional_failures=125)) + 548 num_additional_failures=125)) +
548 api.override_step_data(without_patch, 549 api.override_step_data(without_patch,
549 canned_test(passing=True, minimal=True)) 550 canned_test(passing=True, minimal=True))
550 ) 551 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698