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

Side by Side Diff: content/test/gpu/generate_buildbot_json.py

Issue 2077443002: Switch webgl2_conformance_tests to new harness, and shard them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug in harness. Mark flaky test. Add Ned and me as per-file OWNERS. Created 4 years, 6 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | content/test/gpu/gpu_tests/webgl2_conformance_expectations.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Script to generate chromium.gpu.json and chromium.gpu.fyi.json in 6 """Script to generate chromium.gpu.json and chromium.gpu.fyi.json in
7 the src/testing/buildbot directory. Maintaining these files by hand is 7 the src/testing/buildbot directory. Maintaining these files by hand is
8 too unwieldy. 8 too unwieldy.
9 """ 9 """
10 10
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 { 878 {
879 'fyi_only': True, 879 'fyi_only': True,
880 'os_types': ['linux'] 880 'os_types': ['linux']
881 } 881 }
882 ], 882 ],
883 'target_name': 'webgl_conformance', 883 'target_name': 'webgl_conformance',
884 'extra_browser_args': [ 884 'extra_browser_args': [
885 '--use-gl=angle', 885 '--use-gl=angle',
886 ], 886 ],
887 }, 887 },
888 }
889
890 # These tests use Telemetry's new, simpler, browser_test_runner.
891 # Eventually all of the Telemetry based tests above will be ported to
892 # this harness, and the old harness will be deleted.
893 TELEMETRY_GPU_INTEGRATION_TESTS = {
888 'webgl2_conformance_tests': { 894 'webgl2_conformance_tests': {
889 'tester_configs': [ 895 'tester_configs': [
890 { 896 {
891 # The WebGL 2.0 conformance tests take over an hour to run on 897 # The WebGL 2.0 conformance tests take over an hour to run on
892 # the Debug bots, which is too long. 898 # the Debug bots, which is too long.
893 'build_configs': ['Release', 'Release_x64'], 899 'build_configs': ['Release', 'Release_x64'],
894 'fyi_only': True, 900 'fyi_only': True,
895 'run_on_optional': True, 901 'run_on_optional': True,
896 }, 902 },
897 ], 903 ],
898 'disabled_tester_configs': [ 904 'disabled_tester_configs': [
899 { 905 {
900 'names': [ 906 'names': [
901 # http://crbug.com/599451: this test is currently too slow 907 # http://crbug.com/599451: this test is currently too slow
902 # to run on x64 in Debug mode. Need to shard the tests. 908 # to run on x64 in Debug mode. Need to shard the tests.
903 'Win7 x64 Debug (NVIDIA)', 909 'Win7 x64 Debug (NVIDIA)',
904 # http://crbug.com/540543: Linux Intel driver is GL 3.0 and 910 # http://crbug.com/540543: Linux Intel driver is GL 3.0 and
905 # doesn't support features needed for ES3 911 # doesn't support features needed for ES3
906 'Linux Release (New Intel)', 912 'Linux Release (New Intel)',
907 'Linux Debug (New Intel)', 913 'Linux Debug (New Intel)',
908 ], 914 ],
909 }, 915 },
910 ], 916 ],
911 'target_name': 'webgl_conformance', 917 'target_name': 'webgl_conformance',
912 'args': [ 918 'args': [
913 '--webgl-conformance-version=2.0.0', 919 '--webgl-conformance-version=2.0.0',
914 '--webgl2-only=true', 920 '--webgl2-only=true',
915 ], 921 ],
922 'swarming': {
923 # These tests currently take about an hour to run. Split them
924 # into roughly 5-minute shards.
925 'shards': 12,
926 },
916 }, 927 },
917 'webgl2_conformance_angle_tests': { 928 'webgl2_conformance_angle_tests': {
918 'tester_configs': [ 929 'tester_configs': [
919 { 930 {
920 # The WebGL 2.0 conformance tests take over an hour to run on 931 # The WebGL 2.0 conformance tests take over an hour to run on
921 # the Debug bots, which is too long. 932 # the Debug bots, which is too long.
922 'build_configs': ['Release'], 933 'build_configs': ['Release'],
923 'fyi_only': True, 934 'fyi_only': True,
924 'run_on_optional': False, 935 'run_on_optional': False,
925 # Only run on the NVIDIA Release and New Intel Release Linux bots 936 # Only run on the NVIDIA Release and New Intel Release Linux bots
(...skipping 10 matching lines...) Expand all
936 }, 947 },
937 ], 948 ],
938 'target_name': 'webgl_conformance', 949 'target_name': 'webgl_conformance',
939 'extra_browser_args': [ 950 'extra_browser_args': [
940 '--use-gl=angle', 951 '--use-gl=angle',
941 ], 952 ],
942 'args': [ 953 'args': [
943 '--webgl-conformance-version=2.0.0', 954 '--webgl-conformance-version=2.0.0',
944 '--webgl2-only=true', 955 '--webgl2-only=true',
945 ], 956 ],
957 'swarming': {
958 # These tests currently take about an hour to run. Split them
959 # into roughly 5-minute shards.
960 'shards': 12,
961 },
946 }, 962 },
947 } 963 }
948 964
949 def substitute_args(tester_config, args): 965 def substitute_args(tester_config, args):
950 """Substitutes the ${os_type} variable in |args| from the 966 """Substitutes the ${os_type} variable in |args| from the
951 tester_config's "os_type" property. 967 tester_config's "os_type" property.
952 """ 968 """
953 substitutions = { 969 substitutions = {
954 'os_type': tester_config['os_type'] 970 'os_type': tester_config['os_type']
955 } 971 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 result.pop('desktop_args') 1069 result.pop('desktop_args')
1054 1070
1055 # This flag only has an effect on the Linux bots that run tests 1071 # This flag only has an effect on the Linux bots that run tests
1056 # locally (as opposed to via Swarming), which are only those couple 1072 # locally (as opposed to via Swarming), which are only those couple
1057 # on the chromium.gpu.fyi waterfall. Still, there is no harm in 1073 # on the chromium.gpu.fyi waterfall. Still, there is no harm in
1058 # specifying it everywhere. 1074 # specifying it everywhere.
1059 result['use_xvfb'] = False 1075 result['use_xvfb'] = False
1060 return result 1076 return result
1061 1077
1062 def generate_telemetry_test(tester_name, tester_config, 1078 def generate_telemetry_test(tester_name, tester_config,
1063 test, test_config, is_fyi): 1079 test, test_config, is_fyi,
1080 use_gpu_integration_test_harness):
1064 if not should_run_on_tester(tester_name, tester_config, test_config, is_fyi): 1081 if not should_run_on_tester(tester_name, tester_config, test_config, is_fyi):
1065 return None 1082 return None
1066 test_args = ['-v'] 1083 test_args = ['-v']
1067 # --expose-gc allows the WebGL conformance tests to more reliably 1084 # --expose-gc allows the WebGL conformance tests to more reliably
1068 # reproduce GC-related bugs in the V8 bindings. 1085 # reproduce GC-related bugs in the V8 bindings.
1069 extra_browser_args_string = ( 1086 extra_browser_args_string = (
1070 '--enable-logging=stderr --js-flags=--expose-gc') 1087 '--enable-logging=stderr --js-flags=--expose-gc')
1071 if 'extra_browser_args' in test_config: 1088 if 'extra_browser_args' in test_config:
1072 extra_browser_args_string += ' ' + ' '.join( 1089 extra_browser_args_string += ' ' + ' '.join(
1073 test_config['extra_browser_args']) 1090 test_config['extra_browser_args'])
(...skipping 10 matching lines...) Expand all
1084 step_name = test 1101 step_name = test
1085 if not (step_name.endswith('test') or step_name.endswith('tests')): 1102 if not (step_name.endswith('test') or step_name.endswith('tests')):
1086 step_name = '%s_tests' % step_name 1103 step_name = '%s_tests' % step_name
1087 # Prepend Telemetry GPU-specific flags. 1104 # Prepend Telemetry GPU-specific flags.
1088 benchmark_name = test_config.get('target_name') or test 1105 benchmark_name = test_config.get('target_name') or test
1089 prefix_args = [ 1106 prefix_args = [
1090 benchmark_name, 1107 benchmark_name,
1091 '--show-stdout', 1108 '--show-stdout',
1092 '--browser=%s' % tester_config['build_config'].lower() 1109 '--browser=%s' % tester_config['build_config'].lower()
1093 ] 1110 ]
1111 swarming = {
1112 # Always say this is true regardless of whether the tester
1113 # supports swarming. It doesn't hurt.
1114 'can_use_on_swarming_builders': True,
1115 'dimension_sets': [
1116 tester_config['swarming_dimensions']
1117 ]
1118 }
1119 if 'swarming' in test_config:
1120 swarming.update(test_config['swarming'])
1094 result = { 1121 result = {
1095 'args': prefix_args + test_args, 1122 'args': prefix_args + test_args,
1096 'isolate_name': 'telemetry_gpu_test', 1123 'isolate_name': (
1124 'telemetry_gpu_integration_test' if use_gpu_integration_test_harness
1125 else 'telemetry_gpu_test'),
Dirk Pranke 2016/06/22 22:33:32 nit: shouldn't this be indented 4 spaces?
Ken Russell (switch to Gerrit) 2016/06/22 23:01:04 I don't know. I'm using emacs' default Python inde
Ken Russell (switch to Gerrit) 2016/06/22 23:20:55 P.S. Ned suggested adding (require 'google) to my
1097 'name': step_name, 1126 'name': step_name,
1098 'override_compile_targets': [ 1127 'override_compile_targets': [
1099 'telemetry_gpu_test_run' 1128 ('telemetry_gpu_integration_test_run' if use_gpu_integration_test_harness
Dirk Pranke 2016/06/22 22:33:32 ditto ...
Ken Russell (switch to Gerrit) 2016/06/22 23:01:04 Same here.
1129 else 'telemetry_gpu_test_run')
1100 ], 1130 ],
1101 'swarming': { 1131 'swarming': swarming,
1102 # Always say this is true regardless of whether the tester
1103 # supports swarming. It doesn't hurt.
1104 'can_use_on_swarming_builders': True,
1105 'dimension_sets': [
1106 tester_config['swarming_dimensions']
1107 ]
1108 },
1109 } 1132 }
1110 if 'non_precommit_args' in test_config: 1133 if 'non_precommit_args' in test_config:
1111 result['non_precommit_args'] = test_config['non_precommit_args'] 1134 result['non_precommit_args'] = test_config['non_precommit_args']
1112 if 'precommit_args' in test_config: 1135 if 'precommit_args' in test_config:
1113 result['precommit_args'] = test_config['precommit_args'] 1136 result['precommit_args'] = test_config['precommit_args']
1114 return result 1137 return result
1115 1138
1116 def generate_gtests(tester_name, tester_config, test_dictionary, is_fyi): 1139 def generate_gtests(tester_name, tester_config, test_dictionary, is_fyi):
1117 # The relative ordering of some of the tests is important to 1140 # The relative ordering of some of the tests is important to
1118 # minimize differences compared to the handwritten JSON files, since 1141 # minimize differences compared to the handwritten JSON files, since
1119 # Python's sorts are stable and there are some tests with the same 1142 # Python's sorts are stable and there are some tests with the same
1120 # key (see gles2_conform_d3d9_test and similar variants). Avoid 1143 # key (see gles2_conform_d3d9_test and similar variants). Avoid
1121 # losing the order by avoiding coalescing the dictionaries into one. 1144 # losing the order by avoiding coalescing the dictionaries into one.
1122 gtests = [] 1145 gtests = []
1123 for test_name, test_config in sorted(test_dictionary.iteritems()): 1146 for test_name, test_config in sorted(test_dictionary.iteritems()):
1124 test = generate_gtest(tester_name, tester_config, 1147 test = generate_gtest(tester_name, tester_config,
1125 test_name, test_config, is_fyi) 1148 test_name, test_config, is_fyi)
1126 if test: 1149 if test:
1127 # generate_gtest may veto the test generation on this platform. 1150 # generate_gtest may veto the test generation on this platform.
1128 gtests.append(test) 1151 gtests.append(test)
1129 return gtests 1152 return gtests
1130 1153
1131 def generate_telemetry_tests(tester_name, tester_config, 1154 def generate_telemetry_tests(tester_name, tester_config,
1132 test_dictionary, is_fyi): 1155 test_dictionary, is_fyi,
1156 use_gpu_integration_test_harness):
1133 isolated_scripts = [] 1157 isolated_scripts = []
1134 for test_name, test_config in sorted(test_dictionary.iteritems()): 1158 for test_name, test_config in sorted(test_dictionary.iteritems()):
1135 test = generate_telemetry_test( 1159 test = generate_telemetry_test(
1136 tester_name, tester_config, test_name, test_config, is_fyi) 1160 tester_name, tester_config, test_name, test_config, is_fyi,
1161 use_gpu_integration_test_harness)
1137 if test: 1162 if test:
1138 isolated_scripts.append(test) 1163 isolated_scripts.append(test)
1139 return isolated_scripts 1164 return isolated_scripts
1140 1165
1141 def generate_all_tests(waterfall, is_fyi): 1166 def generate_all_tests(waterfall, is_fyi):
1142 tests = {} 1167 tests = {}
1143 for builder in waterfall['builders']: 1168 for builder in waterfall['builders']:
1144 tests[builder] = {} 1169 tests[builder] = {}
1145 for name, config in waterfall['testers'].iteritems(): 1170 for name, config in waterfall['testers'].iteritems():
1146 gtests = generate_gtests(name, config, COMMON_GTESTS, is_fyi) 1171 gtests = generate_gtests(name, config, COMMON_GTESTS, is_fyi)
1147 isolated_scripts = \ 1172 isolated_scripts = \
1148 generate_telemetry_tests(name, config, TELEMETRY_TESTS, is_fyi) 1173 generate_telemetry_tests(name, config, TELEMETRY_TESTS, is_fyi, False) + \
Dirk Pranke 2016/06/22 22:33:32 ditto ...
Ken Russell (switch to Gerrit) 2016/06/22 23:01:04 Same here.
1174 generate_telemetry_tests(name, config, TELEMETRY_GPU_INTEGRATION_TESTS,
1175 is_fyi, True)
1149 tests[name] = { 1176 tests[name] = {
1150 'gtest_tests': sorted(gtests, key=lambda x: x['test']), 1177 'gtest_tests': sorted(gtests, key=lambda x: x['test']),
1151 'isolated_scripts': sorted(isolated_scripts, key=lambda x: x['name']) 1178 'isolated_scripts': sorted(isolated_scripts, key=lambda x: x['name'])
1152 } 1179 }
1153 tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {} 1180 tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {}
1154 tests['AAAAA2 See generate_buildbot_json.py to make changes'] = {} 1181 tests['AAAAA2 See generate_buildbot_json.py to make changes'] = {}
1155 filename = 'chromium.gpu.fyi.json' if is_fyi else 'chromium.gpu.json' 1182 filename = 'chromium.gpu.fyi.json' if is_fyi else 'chromium.gpu.json'
1156 with open(os.path.join(SRC_DIR, 'testing', 'buildbot', filename), 'w') as fp: 1183 with open(os.path.join(SRC_DIR, 'testing', 'buildbot', filename), 'w') as fp:
1157 json.dump(tests, fp, indent=2, separators=(',', ': '), sort_keys=True) 1184 json.dump(tests, fp, indent=2, separators=(',', ': '), sort_keys=True)
1158 fp.write('\n') 1185 fp.write('\n')
1159 1186
1160 def main(): 1187 def main():
1161 generate_all_tests(FYI_WATERFALL, True) 1188 generate_all_tests(FYI_WATERFALL, True)
1162 generate_all_tests(WATERFALL, False) 1189 generate_all_tests(WATERFALL, False)
1163 return 0 1190 return 0
1164 1191
1165 if __name__ == "__main__": 1192 if __name__ == "__main__":
1166 sys.exit(main()) 1193 sys.exit(main())
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | content/test/gpu/gpu_tests/webgl2_conformance_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698