Add a standalone GN isolate map.

This will allow us to use trigger.py in a standalone checkout
to fire off swarming jobs.

Bug: angleproject:5114
Change-Id: I99302a4e8fdfc0f6d9996748a2d6c97dc5f03cde
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2442079
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This commit is contained in:
Jamie Madill
2020-10-01 08:49:58 -04:00
committed by Commit Bot
parent eb1df14b18
commit 7b25b64316
2 changed files with 119 additions and 3 deletions

105
infra/gn_isolate_map.pyl Normal file
View File

@@ -0,0 +1,105 @@
## Copyright 2020 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.
# gn_isolate_map.pyl - A mapping of Ninja build target names to GN labels and
# test type classifications for the tests that are run on the bots.
#
# This mapping is used by MB so that we can uniformly refer to test binaries
# by their Ninja target names in the recipes and not need to worry about how
# they are referred to in GN or GYP specifically (the GYP target name is pretty
# much always the same as the Ninja target name, since GYP target names are not
# hierarchical).
# TODO(crbug.com/816629): Remove the need for this file altogether :). Also,
# see the canonical Chromium copy:
# https://chromium.googlesource.com/chromium/src/+/refs/heads/master/testing/buildbot/gn_isolate_map.pyl
{
"angle_apks": {
"label": "//:angle_apks",
"type": "additional_compile_target",
},
"angle_deqp_egl_tests": {
"args": [],
"label": "//src/tests:angle_deqp_egl_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_gles2_tests": {
"args": [],
"label": "//src/tests:angle_deqp_gles2_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_gles31_tests": {
"args": [],
"label": "//src/tests:angle_deqp_gles31_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_gles3_tests": {
"args": [],
"label": "//src/tests:angle_deqp_gles3_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_khr_gles2_tests": {
"args": [],
"label": "//src/tests:angle_deqp_khr_gles2_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_khr_gles3_tests": {
"args": [],
"label": "//src/tests:angle_deqp_khr_gles3_tests",
"type": "windowed_test_launcher",
},
"angle_deqp_khr_gles31_tests": {
"args": [],
"label": "//src/tests:angle_deqp_khr_gles31_tests",
"type": "windowed_test_launcher",
},
"angle_end2end_tests": {
"args": [],
"label": "//src/tests:angle_end2end_tests",
"type": "windowed_test_launcher",
},
"angle_gles1_conformance_tests": {
"args": [],
"label": "//src/tests:angle_gles1_conformance_tests",
"type": "windowed_test_launcher",
},
"angle_perftests": {
"args": [
"angle_perftests",
"--non-telemetry=true",
"--test-launcher-print-test-stdio=always",
"--test-launcher-jobs=1",
"--test-launcher-retry-limit=0",
],
"label": "//src/tests:angle_perftests",
"script": "//testing/scripts/run_performance_tests.py",
"type": "script",
},
"angle_restricted_trace_gold_tests": {
"type": "script",
"label": "//src/tests/restricted_traces:angle_restricted_trace_gold_tests",
"script": "//src/tests/restricted_traces/restricted_trace_gold_tests.py",
},
"angle_unittests": {
"label": "//src/tests:angle_unittests",
"type": "console_test_launcher",
},
"angle_white_box_perftests": {
"args": [],
"label": "//src/tests:angle_white_box_tests",
"type": "windowed_test_launcher",
},
"angle_white_box_tests": {
"args": [],
"label": "//src/tests:angle_white_box_tests",
"type": "windowed_test_launcher",
},
}

View File

@@ -9,6 +9,7 @@
import argparse
import hashlib
import logging
import os
import subprocess
import sys
@@ -34,8 +35,18 @@ def main():
out_gn_path = '//' + path
out_file_path = os.path.join(*path.split('/'))
# Attempt to detect standalone vs chromium component build.
is_standalone = not os.path.isdir(os.path.join('third_party', 'angle'))
mb_script_path = os.path.join('tools', 'mb', 'mb.py')
subprocess.call(['python', mb_script_path, 'isolate', out_gn_path, args.test])
mb_args = ['python', mb_script_path, 'isolate', out_gn_path, args.test]
if is_standalone:
logging.info('Standalone mode detected.')
mb_args += ['-i', os.path.join('infra', 'gn_isolate_map.pyl')]
if subprocess.call(mb_args):
sys.exit('MB step failed, exiting')
isolate_cmd_path = os.path.join('tools', 'luci-go', 'isolate')
isolate_file = os.path.join(out_file_path, '%s.isolate' % args.test)
@@ -49,7 +60,7 @@ def main():
with open(isolated_file, 'rb') as f:
sha = hashlib.sha1(f.read()).hexdigest()
print('Got an isolated SHA of %s' % sha)
logging.info('Got an isolated SHA of %s' % sha)
swarming_script_path = os.path.join('tools', 'luci-go', 'swarming')
swarming_args = [
@@ -78,7 +89,7 @@ def main():
if unknown:
shard_args += ["--"] + unknown
print(' '.join(shard_args))
logging.info(' '.join(shard_args))
subprocess.call(shard_args)
return 0