From 29dc2b6e5df41f9a95d30ac8c1f2027e1a38f658 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Tue, 13 Apr 2021 09:32:30 -0400 Subject: [PATCH] infra: Move and check gn_isolate_map. In preparation for more source-side configuration. Also adds a presubmit check and some empty files to enable the presubmit to function. Bug: angleproject:5114 Change-Id: Id9a0cbe1e78949720be39c65efab73c1345d4f39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2819942 Reviewed-by: Yuly Novikov Commit-Queue: Jamie Madill --- infra/specs/PRESUBMIT.py | 38 +++++++++++++++++++++++++++ infra/{ => specs}/gn_isolate_map.pyl | 0 infra/specs/mixins.pyl | 13 +++++++++ infra/specs/test_suite_exceptions.pyl | 13 +++++++++ infra/specs/test_suites.pyl | 15 +++++++++++ infra/specs/variants.pyl | 13 +++++++++ infra/specs/waterfalls.pyl | 13 +++++++++ scripts/trigger.py | 2 +- 8 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 infra/specs/PRESUBMIT.py rename infra/{ => specs}/gn_isolate_map.pyl (100%) create mode 100644 infra/specs/mixins.pyl create mode 100644 infra/specs/test_suite_exceptions.pyl create mode 100644 infra/specs/test_suites.pyl create mode 100644 infra/specs/variants.pyl create mode 100644 infra/specs/waterfalls.pyl diff --git a/infra/specs/PRESUBMIT.py b/infra/specs/PRESUBMIT.py new file mode 100644 index 000000000..4a5879365 --- /dev/null +++ b/infra/specs/PRESUBMIT.py @@ -0,0 +1,38 @@ +# 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. +""" +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more details on the presubmit API built into depot_tools. +""" + +import os + + +def _CommonChecks(input_api, output_api): + d = os.path.dirname + angle_root = d(d(input_api.PresubmitLocalPath())) + gen_script = os.path.join(angle_root, 'testing', 'buildbot', 'generate_buildbot_json.py') + + commands = [ + input_api.Command( + name='generate_buildbot_json', + cmd=[ + input_api.python_executable, gen_script, '--check', '--verbose', '--pyl-files-dir', + input_api.PresubmitLocalPath() + ], + kwargs={}, + message=output_api.PresubmitError), + ] + messages = [] + + messages.extend(input_api.RunTests(commands)) + return messages + + +def CheckChangeOnUpload(input_api, output_api): + return _CommonChecks(input_api, output_api) + + +def CheckChangeOnCommit(input_api, output_api): + return _CommonChecks(input_api, output_api) diff --git a/infra/gn_isolate_map.pyl b/infra/specs/gn_isolate_map.pyl similarity index 100% rename from infra/gn_isolate_map.pyl rename to infra/specs/gn_isolate_map.pyl diff --git a/infra/specs/mixins.pyl b/infra/specs/mixins.pyl new file mode 100644 index 000000000..d55e77ba4 --- /dev/null +++ b/infra/specs/mixins.pyl @@ -0,0 +1,13 @@ +# 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. + +{} \ No newline at end of file diff --git a/infra/specs/test_suite_exceptions.pyl b/infra/specs/test_suite_exceptions.pyl new file mode 100644 index 000000000..1ee746505 --- /dev/null +++ b/infra/specs/test_suite_exceptions.pyl @@ -0,0 +1,13 @@ +# 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 test_suite_exceptions.pyl in testing/buildbot. + +{} \ No newline at end of file diff --git a/infra/specs/test_suites.pyl b/infra/specs/test_suites.pyl new file mode 100644 index 000000000..35ae59983 --- /dev/null +++ b/infra/specs/test_suites.pyl @@ -0,0 +1,15 @@ +# 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 test_suites.pyl in testing/buildbot. + +{ + 'basic_suites': {}, +} \ No newline at end of file diff --git a/infra/specs/variants.pyl b/infra/specs/variants.pyl new file mode 100644 index 000000000..1de9ae94f --- /dev/null +++ b/infra/specs/variants.pyl @@ -0,0 +1,13 @@ +# 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 variants.pyl in testing/buildbot. + +{} diff --git a/infra/specs/waterfalls.pyl b/infra/specs/waterfalls.pyl new file mode 100644 index 000000000..b241f5e8a --- /dev/null +++ b/infra/specs/waterfalls.pyl @@ -0,0 +1,13 @@ +# 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 waterfalls.pyl in testing/buildbot. + +[] diff --git a/scripts/trigger.py b/scripts/trigger.py index 3d695342a..b1383fb68 100755 --- a/scripts/trigger.py +++ b/scripts/trigger.py @@ -48,7 +48,7 @@ def invoke_mb(args): if is_standalone: logging.info('Standalone mode detected.') - mb_args += ['-i', os.path.join('infra', 'gn_isolate_map.pyl')] + mb_args += ['-i', os.path.join('infra', 'specs', 'gn_isolate_map.pyl')] logging.info('Invoking mb: %s' % ' '.join(mb_args)) return subprocess.check_output(mb_args)