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

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

Issue 2618983004: Port Maps test to browser_test_runner harness. (Closed)
Patch Set: Created 3 years, 11 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/test/BUILD.gn ('k') | content/test/gpu/gpu_tests/cloud_storage_test_base.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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 '--test-launcher-jobs=1', 1107 '--test-launcher-jobs=1',
1108 '--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:' + \ 1108 '--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:' + \
1109 'TabCaptureApiPixelTest.EndToEnd*' 1109 'TabCaptureApiPixelTest.EndToEnd*'
1110 ], 1110 ],
1111 'swarming': { 1111 'swarming': {
1112 'can_use_on_swarming_builders': False, 1112 'can_use_on_swarming_builders': False,
1113 }, 1113 },
1114 } 1114 }
1115 } 1115 }
1116 1116
1117 TELEMETRY_TESTS = { 1117 # These tests use Telemetry's new browser_test_runner, which is a much
1118 'maps_pixel_test': { 1118 # simpler harness for correctness testing.
1119 'target_name': 'maps',
1120 'args': [
1121 '--os-type',
1122 '${os_type}',
1123 '--build-revision',
1124 '${got_revision}',
1125 '--test-machine-name',
1126 '${buildername}',
1127 ],
1128 'tester_configs': [
1129 {
1130 'allow_on_android': True,
1131 },
1132 ],
1133 },
1134 }
1135
1136 # These tests use Telemetry's new, simpler, browser_test_runner.
1137 # Eventually all of the Telemetry based tests above will be ported to
1138 # this harness, and the old harness will be deleted.
1139 TELEMETRY_GPU_INTEGRATION_TESTS = { 1119 TELEMETRY_GPU_INTEGRATION_TESTS = {
1140 'context_lost': { 1120 'context_lost': {
1141 'tester_configs': [ 1121 'tester_configs': [
1142 { 1122 {
1143 'allow_on_android': True, 1123 'allow_on_android': True,
1144 }, 1124 },
1145 ] 1125 ]
1146 }, 1126 },
1147 'depth_capture': { 1127 'depth_capture': {
1148 'tester_configs': [ 1128 'tester_configs': [
(...skipping 10 matching lines...) Expand all
1159 } 1139 }
1160 ], 1140 ],
1161 }, 1141 },
1162 'hardware_accelerated_feature': { 1142 'hardware_accelerated_feature': {
1163 'tester_configs': [ 1143 'tester_configs': [
1164 { 1144 {
1165 'allow_on_android': True, 1145 'allow_on_android': True,
1166 }, 1146 },
1167 ], 1147 ],
1168 }, 1148 },
1149 'maps_pixel_test': {
1150 'target_name': 'maps',
1151 'args': [
1152 '--os-type',
1153 '${os_type}',
1154 '--build-revision',
1155 '${got_revision}',
1156 '--test-machine-name',
1157 '${buildername}',
1158 ],
1159 'tester_configs': [
1160 {
1161 'allow_on_android': True,
1162 },
1163 ],
1164 },
1169 'pixel_test': { 1165 'pixel_test': {
1170 'target_name': 'pixel', 1166 'target_name': 'pixel',
1171 'args': [ 1167 'args': [
1172 '--refimg-cloud-storage-bucket', 1168 '--refimg-cloud-storage-bucket',
1173 'chromium-gpu-archive/reference-images', 1169 'chromium-gpu-archive/reference-images',
1174 '--os-type', 1170 '--os-type',
1175 '${os_type}', 1171 '${os_type}',
1176 '--build-revision', 1172 '--build-revision',
1177 '${got_revision}', 1173 '${got_revision}',
1178 '--test-machine-name', 1174 '--test-machine-name',
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 result.pop('desktop_swarming') 1509 result.pop('desktop_swarming')
1514 1510
1515 # This flag only has an effect on the Linux bots that run tests 1511 # This flag only has an effect on the Linux bots that run tests
1516 # locally (as opposed to via Swarming), which are only those couple 1512 # locally (as opposed to via Swarming), which are only those couple
1517 # on the chromium.gpu.fyi waterfall. Still, there is no harm in 1513 # on the chromium.gpu.fyi waterfall. Still, there is no harm in
1518 # specifying it everywhere. 1514 # specifying it everywhere.
1519 result['use_xvfb'] = False 1515 result['use_xvfb'] = False
1520 return result 1516 return result
1521 1517
1522 def generate_telemetry_test(tester_name, tester_config, 1518 def generate_telemetry_test(tester_name, tester_config,
1523 test, test_config, is_fyi, 1519 test, test_config, is_fyi):
1524 use_gpu_integration_test_harness):
1525 if not should_run_on_tester(tester_name, tester_config, test_config, is_fyi): 1520 if not should_run_on_tester(tester_name, tester_config, test_config, is_fyi):
1526 return None 1521 return None
1527 test_args = ['-v'] 1522 test_args = ['-v']
1528 # --expose-gc allows the WebGL conformance tests to more reliably 1523 # --expose-gc allows the WebGL conformance tests to more reliably
1529 # reproduce GC-related bugs in the V8 bindings. 1524 # reproduce GC-related bugs in the V8 bindings.
1530 extra_browser_args_string = ( 1525 extra_browser_args_string = (
1531 '--enable-logging=stderr --js-flags=--expose-gc') 1526 '--enable-logging=stderr --js-flags=--expose-gc')
1532 if 'extra_browser_args' in test_config: 1527 if 'extra_browser_args' in test_config:
1533 extra_browser_args_string += ' ' + ' '.join( 1528 extra_browser_args_string += ' ' + ' '.join(
1534 test_config['extra_browser_args']) 1529 test_config['extra_browser_args'])
(...skipping 23 matching lines...) Expand all
1558 swarming = { 1553 swarming = {
1559 # Always say this is true regardless of whether the tester 1554 # Always say this is true regardless of whether the tester
1560 # supports swarming. It doesn't hurt. 1555 # supports swarming. It doesn't hurt.
1561 'can_use_on_swarming_builders': True, 1556 'can_use_on_swarming_builders': True,
1562 'dimension_sets': tester_config['swarming_dimensions'] 1557 'dimension_sets': tester_config['swarming_dimensions']
1563 } 1558 }
1564 if 'swarming' in test_config: 1559 if 'swarming' in test_config:
1565 swarming.update(test_config['swarming']) 1560 swarming.update(test_config['swarming'])
1566 result = { 1561 result = {
1567 'args': prefix_args + test_args, 1562 'args': prefix_args + test_args,
1568 'isolate_name': ( 1563 'isolate_name': 'telemetry_gpu_integration_test',
1569 'telemetry_gpu_integration_test' if use_gpu_integration_test_harness
1570 else 'telemetry_gpu_test'),
1571 'name': step_name, 1564 'name': step_name,
1572 'override_compile_targets': [ 1565 'override_compile_targets': ['telemetry_gpu_integration_test_run'],
1573 ('telemetry_gpu_integration_test_run' if use_gpu_integration_test_harness
1574 else 'telemetry_gpu_test_run')
1575 ],
1576 'swarming': swarming, 1566 'swarming': swarming,
1577 } 1567 }
1578 if 'non_precommit_args' in test_config: 1568 if 'non_precommit_args' in test_config:
1579 result['non_precommit_args'] = test_config['non_precommit_args'] 1569 result['non_precommit_args'] = test_config['non_precommit_args']
1580 if 'precommit_args' in test_config: 1570 if 'precommit_args' in test_config:
1581 result['precommit_args'] = test_config['precommit_args'] 1571 result['precommit_args'] = test_config['precommit_args']
1582 return result 1572 return result
1583 1573
1584 def generate_gtests(tester_name, tester_config, test_dictionary, is_fyi): 1574 def generate_gtests(tester_name, tester_config, test_dictionary, is_fyi):
1585 # The relative ordering of some of the tests is important to 1575 # The relative ordering of some of the tests is important to
1586 # minimize differences compared to the handwritten JSON files, since 1576 # minimize differences compared to the handwritten JSON files, since
1587 # Python's sorts are stable and there are some tests with the same 1577 # Python's sorts are stable and there are some tests with the same
1588 # key (see gles2_conform_d3d9_test and similar variants). Avoid 1578 # key (see gles2_conform_d3d9_test and similar variants). Avoid
1589 # losing the order by avoiding coalescing the dictionaries into one. 1579 # losing the order by avoiding coalescing the dictionaries into one.
1590 gtests = [] 1580 gtests = []
1591 for test_name, test_config in sorted(test_dictionary.iteritems()): 1581 for test_name, test_config in sorted(test_dictionary.iteritems()):
1592 test = generate_gtest(tester_name, tester_config, 1582 test = generate_gtest(tester_name, tester_config,
1593 test_name, test_config, is_fyi) 1583 test_name, test_config, is_fyi)
1594 if test: 1584 if test:
1595 # generate_gtest may veto the test generation on this platform. 1585 # generate_gtest may veto the test generation on this platform.
1596 gtests.append(test) 1586 gtests.append(test)
1597 return gtests 1587 return gtests
1598 1588
1599 def generate_telemetry_tests(tester_name, tester_config, 1589 def generate_telemetry_tests(tester_name, tester_config,
1600 test_dictionary, is_fyi, 1590 test_dictionary, is_fyi):
1601 use_gpu_integration_test_harness):
1602 isolated_scripts = [] 1591 isolated_scripts = []
1603 for test_name, test_config in sorted(test_dictionary.iteritems()): 1592 for test_name, test_config in sorted(test_dictionary.iteritems()):
1604 test = generate_telemetry_test( 1593 test = generate_telemetry_test(
1605 tester_name, tester_config, test_name, test_config, is_fyi, 1594 tester_name, tester_config, test_name, test_config, is_fyi)
1606 use_gpu_integration_test_harness)
1607 if test: 1595 if test:
1608 isolated_scripts.append(test) 1596 isolated_scripts.append(test)
1609 return isolated_scripts 1597 return isolated_scripts
1610 1598
1611 def generate_all_tests(waterfall, is_fyi): 1599 def generate_all_tests(waterfall, is_fyi):
1612 tests = {} 1600 tests = {}
1613 for builder, config in waterfall['builders'].iteritems(): 1601 for builder, config in waterfall['builders'].iteritems():
1614 tests[builder] = config 1602 tests[builder] = config
1615 for name, config in waterfall['testers'].iteritems(): 1603 for name, config in waterfall['testers'].iteritems():
1616 gtests = generate_gtests(name, config, COMMON_GTESTS, is_fyi) 1604 gtests = generate_gtests(name, config, COMMON_GTESTS, is_fyi)
1617 isolated_scripts = \ 1605 isolated_scripts = \
1618 generate_telemetry_tests(name, config, TELEMETRY_TESTS, is_fyi, False) + \ 1606 generate_telemetry_tests(
1619 generate_telemetry_tests(name, config, TELEMETRY_GPU_INTEGRATION_TESTS, 1607 name, config, TELEMETRY_GPU_INTEGRATION_TESTS, is_fyi)
1620 is_fyi, True)
1621 tests[name] = { 1608 tests[name] = {
1622 'gtest_tests': sorted(gtests, key=lambda x: x['test']), 1609 'gtest_tests': sorted(gtests, key=lambda x: x['test']),
1623 'isolated_scripts': sorted(isolated_scripts, key=lambda x: x['name']) 1610 'isolated_scripts': sorted(isolated_scripts, key=lambda x: x['name'])
1624 } 1611 }
1625 tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {} 1612 tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {}
1626 tests['AAAAA2 See generate_buildbot_json.py to make changes'] = {} 1613 tests['AAAAA2 See generate_buildbot_json.py to make changes'] = {}
1627 filename = 'chromium.gpu.fyi.json' if is_fyi else 'chromium.gpu.json' 1614 filename = 'chromium.gpu.fyi.json' if is_fyi else 'chromium.gpu.json'
1628 with open(os.path.join(SRC_DIR, 'testing', 'buildbot', filename), 'wb') as fp: 1615 with open(os.path.join(SRC_DIR, 'testing', 'buildbot', filename), 'wb') as fp:
1629 json.dump(tests, fp, indent=2, separators=(',', ': '), sort_keys=True) 1616 json.dump(tests, fp, indent=2, separators=(',', ': '), sort_keys=True)
1630 fp.write('\n') 1617 fp.write('\n')
1631 1618
1632 def main(): 1619 def main():
1633 generate_all_tests(FYI_WATERFALL, True) 1620 generate_all_tests(FYI_WATERFALL, True)
1634 generate_all_tests(WATERFALL, False) 1621 generate_all_tests(WATERFALL, False)
1635 return 0 1622 return 0
1636 1623
1637 if __name__ == "__main__": 1624 if __name__ == "__main__":
1638 sys.exit(main()) 1625 sys.exit(main())
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | content/test/gpu/gpu_tests/cloud_storage_test_base.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698