Commit 7c53d6af by Jamie Madill Committed by Commit Bot

infra: Auto-generate mixins.pyl.

The generate_test_spec_json.py file now reads ANGLE's waterfalls.pyl and Chromium's mixins.pyl to find the referenced mixins and copy them into ANGLE's mixins.pyl. This way we can update ANGLE's mixins easily without needing to manually copy them from Chromium's. In a follow-up we could make this run on the Chromium auto-roller. Bug: angleproject:5114 Change-Id: I332b3182732985b261e107dfe9a5c7c413c410a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2849184Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 904ac340
......@@ -6,6 +6,7 @@
"""
import os
import pprint
import sys
import subprocess
......@@ -16,9 +17,72 @@ sys.path.insert(0, TESTING_DIR)
import generate_buildbot_json
# Add custom mixins here.
ADDITIONAL_MIXINS = {}
MIXIN_FILE_NAME = os.path.join(THIS_DIR, 'mixins.pyl')
MIXINS_PYL_TEMPLATE = """\
# GENERATED FILE - DO NOT EDIT.
# Generated by {script_name} using data from {data_source}
#
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This is a .pyl, or "Python Literal", file. You can treat it just like a
# .json file, with the following exceptions:
# * all keys must be quoted (use single quotes, please);
# * comments are allowed, using '#' syntax; and
# * trailing commas are allowed.
#
# For more info see Chromium's mixins.pyl in testing/buildbot.
{mixin_data}
"""
if __name__ == '__main__': # pragma: no cover
# Append the path to the isolate map.
chromium_args = generate_buildbot_json.BBJSONGenerator.parse_args(sys.argv[1:])
chromium_generator = generate_buildbot_json.BBJSONGenerator(chromium_args)
chromium_generator.load_configuration_files()
override_args = sys.argv[1:] + ['--pyl-files-dir', THIS_DIR]
parsed_args = generate_buildbot_json.BBJSONGenerator.parse_args(override_args)
generator = generate_buildbot_json.BBJSONGenerator(parsed_args)
sys.exit(generator.main())
angle_args = generate_buildbot_json.BBJSONGenerator.parse_args(override_args)
angle_generator = generate_buildbot_json.BBJSONGenerator(angle_args)
angle_generator.load_configuration_files()
angle_generator.resolve_configuration_files()
seen_mixins = set()
for waterfall in angle_generator.waterfalls:
seen_mixins = seen_mixins.union(waterfall.get('mixins', set()))
for bot_name, tester in waterfall['machines'].iteritems():
seen_mixins = seen_mixins.union(tester.get('mixins', set()))
for suite in angle_generator.test_suites.values():
if isinstance(suite, list):
# Don't care about this, it's a composition, which shouldn't include a
# swarming mixin.
continue
for test in suite.values():
assert isinstance(test, dict)
seen_mixins = seen_mixins.union(test.get('mixins', set()))
found_mixins = {}
for mixin in seen_mixins:
assert (mixin in chromium_generator.mixins)
found_mixins[mixin] = chromium_generator.mixins[mixin]
for mixin_name, mixin in ADDITIONAL_MIXINS.items():
found_mixins[mixin_name] = mixin
pp = pprint.PrettyPrinter(indent=2)
format_data = {
'script_name': os.path.basename(__file__),
'data_source': 'waterfall.pyl and Chromium\'s mixins.pyl',
'mixin_data': pp.pformat(found_mixins),
}
generated_mixin_pyl = MIXINS_PYL_TEMPLATE.format(**format_data)
with open(MIXIN_FILE_NAME, 'w') as f:
f.write(generated_mixin_pyl)
f.close()
sys.exit(angle_generator.main())
# GENERATED FILE - DO NOT EDIT.
# Generated by generate_test_spec_json.py using data from waterfall.pyl and Chromium's mixins.pyl
#
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This is a .pyl, or "Python Literal", file. You can treat it just like a
# .json file, with the following exceptions:
# * all keys must be quoted (use single quotes, please);
......@@ -10,119 +13,38 @@
#
# For more info see Chromium's mixins.pyl in testing/buildbot.
{
'angle_skia_gold_test': {
'$mixin_append': {
'args': [
'--git-revision=${got_angle_revision}',
# BREAK GLASS IN CASE OF EMERGENCY
# Uncommenting this argument will bypass all interactions with Skia
# Gold in any tests that use it. This is meant as a temporary
# emergency stop in case of a Gold outage that's affecting the bots.
# '--bypass-skia-gold-functionality',
],
'precommit_args': [
'--gerrit-issue=${patch_issue}',
'--gerrit-patchset=${patch_set}',
'--buildbucket-id=${buildbucket_build_id}',
],
}
},
'chrome-gpu-gold-service-account': {
'swarming': {
'service_account': 'chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com',
},
},
'chromium-tester-service-account': {
'swarming': {
'service_account': 'chromium-tester@chops-service-accounts.iam.gserviceaccount.com',
},
},
'linux_intel_hd_630_stable': {
'swarming': {
'dimensions': {
'gpu': '8086:5912-19.0.2',
'os': 'Ubuntu-19.04',
'pool': 'chromium.tests.gpu',
}
}
},
'linux_nvidia_quadro_p400_stable': {
'swarming': {
'dimensions': {
'gpu': '10de:1cb3-418.56',
'os': 'Ubuntu-19.04',
'pool': 'chromium.tests.gpu',
}
}
},
'mac_mini_intel_gpu_stable': {
'swarming': {
'dimensions': {
'gpu': '8086:0a2e',
'os': 'Mac-10.15.5',
},
},
},
'mac_retina_amd_gpu_stable': {
'swarming': {
'dimensions': {
'gpu': '1002:6821',
'hidpi': '1',
'os': 'Mac-10.14.6',
'pool': 'chromium.tests.gpu',
},
},
},
'mac_retina_nvidia_gpu_stable': {
'swarming': {
'dimensions': {
'gpu': '10de:0fe9',
'hidpi': '1',
'os': 'Mac-10.14.6',
'pool': 'chromium.tests.gpu',
},
},
},
'swarming_containment_auto': {
'swarming': {
'containment_type': 'AUTO',
},
},
'win10_intel_hd_630_stable': {
'swarming': {
'dimensions': {
'gpu': '8086:5912-26.20.100.8141|8086:3e92-26.20.100.8141',
'os': 'Windows-10',
'pool': 'chromium.tests.gpu',
},
},
},
'win10_nvidia_quadro_p400_stable': {
'swarming': {
'dimensions': {
'gpu': '10de:1cb3-27.21.14.5148',
'os': 'Windows-10-18363',
'pool': 'chromium.tests.gpu',
},
},
},
'win7_amd_r7_240': {
'swarming': {
'dimensions': {
'gpu': '1002:6613',
'os': 'Windows-2008ServerR2-SP1',
'pool': 'chromium.tests.gpu',
},
},
},
'win7_nvidia_quadro_p400': {
'swarming': {
'dimensions': {
'gpu': '10de:1cb3-24.21.14.1195',
'os': 'Windows-2008ServerR2-SP1',
'pool': 'chromium.tests.gpu',
},
},
},
}
{ 'angle_skia_gold_test': { '$mixin_append': { 'args': [ '--git-revision=${got_angle_revision}'],
'precommit_args': [ '--gerrit-issue=${patch_issue}',
'--gerrit-patchset=${patch_set}',
'--buildbucket-id=${buildbucket_build_id}']}},
'chrome-gpu-gold-service-account': { 'swarming': { 'service_account': 'chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com'}},
'chromium-tester-service-account': { 'swarming': { 'service_account': 'chromium-tester@chops-service-accounts.iam.gserviceaccount.com'}},
'linux_intel_hd_630_stable': { 'swarming': { 'dimensions': { 'gpu': '8086:5912-19.0.2',
'os': 'Ubuntu-19.04',
'pool': 'chromium.tests.gpu'}}},
'linux_nvidia_quadro_p400_stable': { 'swarming': { 'dimensions': { 'gpu': '10de:1cb3-418.56',
'os': 'Ubuntu-19.04',
'pool': 'chromium.tests.gpu'}}},
'mac_mini_intel_gpu_stable': { 'swarming': { 'dimensions': { 'gpu': '8086:0a2e',
'os': 'Mac-10.15.5'}}},
'mac_retina_amd_gpu_stable': { 'swarming': { 'dimensions': { 'gpu': '1002:6821',
'hidpi': '1',
'os': 'Mac-10.14.6',
'pool': 'chromium.tests.gpu'}}},
'mac_retina_nvidia_gpu_stable': { 'swarming': { 'dimensions': { 'gpu': '10de:0fe9',
'hidpi': '1',
'os': 'Mac-10.14.6',
'pool': 'chromium.tests.gpu'}}},
'swarming_containment_auto': { 'swarming': { 'containment_type': 'AUTO'}},
'win10_intel_hd_630_stable': { 'swarming': { 'dimensions': { 'gpu': '8086:5912-26.20.100.8141|8086:3e92-26.20.100.8141',
'os': 'Windows-10',
'pool': 'chromium.tests.gpu'}}},
'win10_nvidia_quadro_p400_stable': { 'swarming': { 'dimensions': { 'gpu': '10de:1cb3-27.21.14.5148',
'os': 'Windows-10-18363',
'pool': 'chromium.tests.gpu'}}},
'win7_amd_r7_240': { 'swarming': { 'dimensions': { 'gpu': '1002:6613',
'os': 'Windows-2008ServerR2-SP1',
'pool': 'chromium.tests.gpu'}}},
'win7_nvidia_quadro_p400': { 'swarming': { 'dimensions': { 'gpu': '10de:1cb3-24.21.14.1195',
'os': 'Windows-2008ServerR2-SP1',
'pool': 'chromium.tests.gpu'}}}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment