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 ) 30 31 PERF_DAILY_RUN_TESTS = ( 32 'cros_ui_smoothness', 33 'dromaeo.domcoreattr', 34 'dromaeo.domcoremodify', 35 'dromaeo.domcorequery', 36 'dromaeo.domcoretraverse', 37 'image_decoding.image_decoding_measurement', 38 'memory.desktop', 39 'page_cycler_v2.typical_25', 40 'robohornet_pro', 41 'smoothness.tough_animation_cases', 42 'smoothness.tough_canvas_cases', 43 'smoothness.tough_filters_cases', 44 'smoothness.tough_pinch_zoom_cases', 45 'smoothness.tough_scrolling_cases', 46 'smoothness.tough_webgl_cases', 47 'sunspider', 48 'webrtc', 49 ) 50 51 PERF_WEEKLY_RUN_TESTS = ( 52 'system_health.memory_desktop', 53 ) 54 55 PERF_NO_SUITE = ( 56 'page_cycler.typical_25', 57 ) 58 59 ALL_TESTS = (PERF_PER_BUILD_TESTS + 60 PERF_DAILY_RUN_TESTS + 61 PERF_WEEKLY_RUN_TESTS + 62 PERF_NO_SUITE) 63 64 CONTROLFILE_TEMPLATE = ( 65 """# Copyright 2018 The Chromium OS Authors. All rights reserved. 66 # Use of this source code is governed by a BSD-style license that can be 67 # found in the LICENSE file. 68 69 # Do not edit this file! It was created by generate_controlfiles.py. 70 71 from autotest_lib.client.common_lib import utils 72 73 AUTHOR = 'sbasi, achuith, rohitbm' 74 NAME = 'telemetry_Benchmarks.{test}' 75 {attributes} 76 TIME = 'LONG' 77 TEST_CATEGORY = 'Benchmark' 78 TEST_CLASS = 'performance' 79 TEST_TYPE = 'server' 80 81 DOC = ''' 82 This server side test suite executes the Telemetry Benchmark: 83 {test} 84 This is part of Chrome for Chrome OS performance testing. 85 86 Pass local=True to run with local telemetry and no AFE server. 87 ''' 88 89 def run_benchmark(machine): 90 host = hosts.create_host(machine) 91 job.run_test('telemetry_Benchmarks', host=host, 92 benchmark='{test}', 93 tag='{test}', 94 args=utils.args_to_dict(args)) 95 96 parallel_simple(run_benchmark, machines)""") 97 98 99 def _get_suite(test): 100 if test in PERF_PER_BUILD_TESTS: 101 return 'ATTRIBUTES = \'suite:crosbolt_perf_perbuild\'' 102 elif test in PERF_DAILY_RUN_TESTS: 103 return 'ATTRIBUTES = \'suite:crosbolt_perf_nightly\'' 104 elif test in PERF_WEEKLY_RUN_TESTS: 105 return 'ATTRIBUTES = \'suite:crosbolt_perf_weekly\'' 106 return '' 107 108 109 for test in ALL_TESTS: 110 filename = 'control.%s' % test 111 with open(filename, 'w+') as f: 112 content = CONTROLFILE_TEMPLATE.format( 113 test=test, 114 attributes=_get_suite(test)) 115 f.write(content) 116