Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7b25b64

Browse files
null77Commit Bot
authored andcommitted
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 <[email protected]> Reviewed-by: Dirk Pranke <[email protected]> Reviewed-by: Yuly Novikov <[email protected]>
1 parent eb1df14 commit 7b25b64

File tree

2 files changed

+119
-3
lines changed

2 files changed

+119
-3
lines changed

infra/gn_isolate_map.pyl

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
## Copyright 2020 The ANGLE Project Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
# This is a .pyl, or "Python Literal", file. You can treat it just like a
6+
# .json file, with the following exceptions:
7+
# * all keys must be quoted (use single quotes, please);
8+
# * comments are allowed, using '#' syntax; and
9+
# * trailing commas are allowed.
10+
11+
# gn_isolate_map.pyl - A mapping of Ninja build target names to GN labels and
12+
# test type classifications for the tests that are run on the bots.
13+
#
14+
# This mapping is used by MB so that we can uniformly refer to test binaries
15+
# by their Ninja target names in the recipes and not need to worry about how
16+
# they are referred to in GN or GYP specifically (the GYP target name is pretty
17+
# much always the same as the Ninja target name, since GYP target names are not
18+
# hierarchical).
19+
20+
# TODO(crbug.com/816629): Remove the need for this file altogether :). Also,
21+
# see the canonical Chromium copy:
22+
# https://chromium.googlesource.com/chromium/src/+/refs/heads/master/testing/buildbot/gn_isolate_map.pyl
23+
24+
{
25+
"angle_apks": {
26+
"label": "//:angle_apks",
27+
"type": "additional_compile_target",
28+
},
29+
"angle_deqp_egl_tests": {
30+
"args": [],
31+
"label": "//src/tests:angle_deqp_egl_tests",
32+
"type": "windowed_test_launcher",
33+
},
34+
"angle_deqp_gles2_tests": {
35+
"args": [],
36+
"label": "//src/tests:angle_deqp_gles2_tests",
37+
"type": "windowed_test_launcher",
38+
},
39+
"angle_deqp_gles31_tests": {
40+
"args": [],
41+
"label": "//src/tests:angle_deqp_gles31_tests",
42+
"type": "windowed_test_launcher",
43+
},
44+
"angle_deqp_gles3_tests": {
45+
"args": [],
46+
"label": "//src/tests:angle_deqp_gles3_tests",
47+
"type": "windowed_test_launcher",
48+
},
49+
"angle_deqp_khr_gles2_tests": {
50+
"args": [],
51+
"label": "//src/tests:angle_deqp_khr_gles2_tests",
52+
"type": "windowed_test_launcher",
53+
},
54+
"angle_deqp_khr_gles3_tests": {
55+
"args": [],
56+
"label": "//src/tests:angle_deqp_khr_gles3_tests",
57+
"type": "windowed_test_launcher",
58+
},
59+
"angle_deqp_khr_gles31_tests": {
60+
"args": [],
61+
"label": "//src/tests:angle_deqp_khr_gles31_tests",
62+
"type": "windowed_test_launcher",
63+
},
64+
"angle_end2end_tests": {
65+
"args": [],
66+
"label": "//src/tests:angle_end2end_tests",
67+
"type": "windowed_test_launcher",
68+
},
69+
"angle_gles1_conformance_tests": {
70+
"args": [],
71+
"label": "//src/tests:angle_gles1_conformance_tests",
72+
"type": "windowed_test_launcher",
73+
},
74+
"angle_perftests": {
75+
"args": [
76+
"angle_perftests",
77+
"--non-telemetry=true",
78+
"--test-launcher-print-test-stdio=always",
79+
"--test-launcher-jobs=1",
80+
"--test-launcher-retry-limit=0",
81+
],
82+
"label": "//src/tests:angle_perftests",
83+
"script": "//testing/scripts/run_performance_tests.py",
84+
"type": "script",
85+
},
86+
"angle_restricted_trace_gold_tests": {
87+
"type": "script",
88+
"label": "//src/tests/restricted_traces:angle_restricted_trace_gold_tests",
89+
"script": "//src/tests/restricted_traces/restricted_trace_gold_tests.py",
90+
},
91+
"angle_unittests": {
92+
"label": "//src/tests:angle_unittests",
93+
"type": "console_test_launcher",
94+
},
95+
"angle_white_box_perftests": {
96+
"args": [],
97+
"label": "//src/tests:angle_white_box_tests",
98+
"type": "windowed_test_launcher",
99+
},
100+
"angle_white_box_tests": {
101+
"args": [],
102+
"label": "//src/tests:angle_white_box_tests",
103+
"type": "windowed_test_launcher",
104+
},
105+
}

scripts/trigger.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import argparse
1111
import hashlib
12+
import logging
1213
import os
1314
import subprocess
1415
import sys
@@ -34,8 +35,18 @@ def main():
3435
out_gn_path = '//' + path
3536
out_file_path = os.path.join(*path.split('/'))
3637

38+
# Attempt to detect standalone vs chromium component build.
39+
is_standalone = not os.path.isdir(os.path.join('third_party', 'angle'))
40+
3741
mb_script_path = os.path.join('tools', 'mb', 'mb.py')
38-
subprocess.call(['python', mb_script_path, 'isolate', out_gn_path, args.test])
42+
mb_args = ['python', mb_script_path, 'isolate', out_gn_path, args.test]
43+
44+
if is_standalone:
45+
logging.info('Standalone mode detected.')
46+
mb_args += ['-i', os.path.join('infra', 'gn_isolate_map.pyl')]
47+
48+
if subprocess.call(mb_args):
49+
sys.exit('MB step failed, exiting')
3950

4051
isolate_cmd_path = os.path.join('tools', 'luci-go', 'isolate')
4152
isolate_file = os.path.join(out_file_path, '%s.isolate' % args.test)
@@ -49,7 +60,7 @@ def main():
4960
with open(isolated_file, 'rb') as f:
5061
sha = hashlib.sha1(f.read()).hexdigest()
5162

52-
print('Got an isolated SHA of %s' % sha)
63+
logging.info('Got an isolated SHA of %s' % sha)
5364
swarming_script_path = os.path.join('tools', 'luci-go', 'swarming')
5465

5566
swarming_args = [
@@ -78,7 +89,7 @@ def main():
7889
if unknown:
7990
shard_args += ["--"] + unknown
8091

81-
print(' '.join(shard_args))
92+
logging.info(' '.join(shard_args))
8293
subprocess.call(shard_args)
8394
return 0
8495

0 commit comments

Comments
 (0)