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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/example.py

Issue 1782333002: Add bisect config validation. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebased Created 4 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 import json 5 import json
6 6
7 DEPS = [ 7 DEPS = [
8 'auto_bisect', 8 'auto_bisect',
9 'chromium_tests', 9 'chromium_tests',
10 'recipe_engine/json', 10 'recipe_engine/json',
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 api.chromium_tests.prepare_checkout(bot_config) 66 api.chromium_tests.prepare_checkout(bot_config)
67 api.auto_bisect.run_bisect_script('dummy_extra_src', '/dummy/path/') 67 api.auto_bisect.run_bisect_script('dummy_extra_src', '/dummy/path/')
68 68
69 69
70 def GenTests(api): 70 def GenTests(api):
71 dummy_gs_location = ('gs://chrome-perf/bisect-results/' 71 dummy_gs_location = ('gs://chrome-perf/bisect-results/'
72 'a6298e4afedbf2cd461755ea6f45b0ad64222222-test.results') 72 'a6298e4afedbf2cd461755ea6f45b0ad64222222-test.results')
73 basic_test = _make_test(api, _get_basic_test_data(), 'basic') 73 basic_test = _make_test(api, _get_basic_test_data(), 'basic')
74 yield basic_test 74 yield basic_test
75 75
76 invalid_config_test = api.test('invalid_config')
77 invalid_config_test += api.properties(
78 bisect_config=_get_config({'good_revision': 'not a valid revision'}))
79 yield invalid_config_test
80
76 failed_build_test = _make_test( 81 failed_build_test = _make_test(
77 api, _get_ref_range_only_test_data(), 'failed_build_test', 82 api, _get_ref_range_only_test_data(), 'failed_build_test',
78 extra_config={'dummy_builds': None}) 83 extra_config={'dummy_builds': None})
79 failed_build_test += api.step_data('gsutil ls', retcode=1) 84 failed_build_test += api.step_data('gsutil ls', retcode=1)
80 failed_build_test += api.step_data( 85 failed_build_test += api.step_data(
81 'Waiting for chromium@a6298e4afe.gsutil ls' , retcode=1) 86 'Waiting for chromium@a6298e4afe.gsutil ls' , retcode=1)
82 failed_build_test += api.step_data( 87 failed_build_test += api.step_data(
83 'Waiting for chromium@a6298e4afe.fetch builder state', 88 'Waiting for chromium@a6298e4afe.fetch builder state',
84 stdout=api.raw_io.output('{"cachedBuilds": ["2106"]}')) 89 stdout=api.raw_io.output('{"cachedBuilds": ["2106"]}'))
85 failed_build_test += api.step_data( 90 failed_build_test += api.step_data(
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 """Returns a sample bisect config dict with some fields overridden.""" 384 """Returns a sample bisect config dict with some fields overridden."""
380 example_config = { 385 example_config = {
381 'test_type': 'perf', 386 'test_type': 'perf',
382 'command': ( 387 'command': (
383 'src/tools/perf/run_benchmark -v --browser=release smoothness.' 388 'src/tools/perf/run_benchmark -v --browser=release smoothness.'
384 'tough_scrolling_cases'), 389 'tough_scrolling_cases'),
385 'good_revision': '314015', 390 'good_revision': '314015',
386 'bad_revision': '314017', 391 'bad_revision': '314017',
387 'metric': 'mean_input_event_latency/mean_input_event_latency', 392 'metric': 'mean_input_event_latency/mean_input_event_latency',
388 'repeat_count': '2', 393 'repeat_count': '2',
394 'bug_id': '-1',
389 'max_time_minutes': '5', 395 'max_time_minutes': '5',
390 'bug_id': '',
391 'gs_bucket': 'chrome-perf', 396 'gs_bucket': 'chrome-perf',
392 'builder_host': 'master4.golo.chromium.org', 397 'builder_host': 'master4.golo.chromium.org',
393 'builder_port': '8341', 398 'builder_port': '8341',
394 'dummy_builds': 'True', 399 'dummy_builds': 'True',
395 'dummy_job_names': 'True', 400 'dummy_job_names': 'True',
396 'bypass_stats_check': 'True', 401 'bypass_stats_check': 'True',
397 'skip_gclient_ops': 'True', 402 'skip_gclient_ops': 'True',
398 'recipe_tester_name': 'linux_perf_tester' 403 'recipe_tester_name': 'linux_perf_tester',
399 } 404 }
400 if params: 405 if params:
401 example_config.update(params) 406 example_config.update(params)
402 return example_config 407 return example_config
403 408
404 409
405 def _get_step_data_for_revision(api, revision_data, include_build_steps=True): 410 def _get_step_data_for_revision(api, revision_data, include_build_steps=True):
406 """Generator that produces step patches for fake results.""" 411 """Generator that produces step patches for fake results."""
407 commit_pos = revision_data['commit_pos'] 412 commit_pos = revision_data['commit_pos']
408 commit_hash = revision_data['hash'] 413 commit_hash = revision_data['hash']
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash)) 449 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash))
445 step_name = 'Expanding revision range for revision %s on depot %s' 450 step_name = 'Expanding revision range for revision %s on depot %s'
446 step_name %= (interval[-1], depot_name) 451 step_name %= (interval[-1], depot_name)
447 stdout = api.json.output([(r, 0) for r in interval[:-1]]) 452 stdout = api.json.output([(r, 0) for r in interval[:-1]])
448 yield api.step_data(step_name, stdout=stdout) 453 yield api.step_data(step_name, stdout=stdout)
449 454
450 if 'cl_info' in revision_data: 455 if 'cl_info' in revision_data:
451 step_name = 'Reading culprit cl information.' 456 step_name = 'Reading culprit cl information.'
452 stdout = api.json.output(revision_data['cl_info']) 457 stdout = api.json.output(revision_data['cl_info'])
453 yield api.step_data(step_name, stdout=stdout) 458 yield api.step_data(step_name, stdout=stdout)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698