1 #!/usr/bin/env python 2 3 """ 4 This file generates all telemetry_Benchmarks control files from a master list. 5 """ 6 7 # This test list is a subset of telemetry benchmark tests. The full list can be 8 # obtained by executing 9 # /build/${BOARD}/usr/local/telemetry/src/tools/perf/list_benchmarks 10 11 # PLEASE READ THIS: 12 13 # PERF_TESTS: these tests run on each build: tot, tot-1, tot-2 and expensive to 14 # run. 15 16 # PERF_DAILY_RUN_TESTS: these tests run on a nightly build: tot. If you are 17 # trying to gain confidence for a new test, adding your test in this list is a 18 # good start. 19 20 # For adding a new test to any of these lists, please add rohitbm, lafeenstra, 21 # haddowk in the change. 22 23 PERF_PER_BUILD_TESTS = ( 24 'jetstream', 25 'kraken', 26 'octane', 27 'smoothness.top_25_smooth', 28 'speedometer', 29 'startup.cold.blank_page', 30 ) 31 32 PERF_DAILY_RUN_TESTS = ( 33 'dromaeo.domcoreattr', 34 'dromaeo.domcoremodify', 35 'dromaeo.domcorequery', 36 'dromaeo.domcoretraverse', 37 'image_decoding.image_decoding_measurement', 38 'page_cycler_v2.typical_25', 39 'robohornet_pro', 40 'smoothness.tough_animation_cases', 41 'smoothness.tough_canvas_cases', 42 'smoothness.tough_filters_cases', 43 'smoothness.tough_pinch_zoom_cases', 44 'smoothness.tough_scrolling_cases', 45 'smoothness.tough_webgl_cases', 46 'sunspider', 47 'webrtc', 48 ) 49 50 PERF_NO_SUITE = ( 51 'page_cycler.typical_25', 52 ) 53 54 ALL_TESTS = PERF_PER_BUILD_TESTS + PERF_DAILY_RUN_TESTS + PERF_NO_SUITE 55 56 CONTROLFILE_TEMPLATE = ( 57 """# Copyright 2014 The Chromium OS Authors. All rights reserved. 58 # Use of this source code is governed by a BSD-style license that can be 59 # found in the LICENSE file. 60 61 # Do not edit this file! It was created by generate_controlfiles.py. 62 63 from autotest_lib.client.common_lib import utils 64 65 AUTHOR = 'sbasi, achuith, rohitbm' 66 NAME = 'telemetry_Benchmarks.{test}' 67 {attributes} 68 TIME = 'LONG' 69 TEST_CATEGORY = 'Benchmark' 70 TEST_CLASS = 'performance' 71 TEST_TYPE = 'server' 72 73 DOC = ''' 74 This server side test suite executes the Telemetry Benchmark: 75 {test} 76 This is part of Chrome for Chrome OS performance testing. 77 78 Pass local=True to run with local telemetry and no AFE server. 79 ''' 80 81 def run_benchmark(machine): 82 host = hosts.create_host(machine) 83 job.run_test('telemetry_Benchmarks', host=host, 84 benchmark='{test}', 85 tag='{test}', 86 args=utils.args_to_dict(args)) 87 88 parallel_simple(run_benchmark, machines)""") 89 90 91 def _get_suite(test): 92 if test in PERF_PER_BUILD_TESTS: 93 return 'ATTRIBUTES = \'suite:crosbolt_perf_perbuild\'' 94 elif test in PERF_DAILY_RUN_TESTS: 95 return 'ATTRIBUTES = \'suite:crosbolt_perf_nightly\'' 96 return '' 97 98 99 for test in ALL_TESTS: 100 filename = 'control.%s' % test 101 with open(filename, 'w+') as f: 102 content = CONTROLFILE_TEMPLATE.format( 103 test=test, 104 attributes=_get_suite(test)) 105 f.write(content) 106