Skip to content

Commit e3dc0df

Browse files
null77Commit Bot
authored and
Commit Bot
committed
Add a helper script for triggering tests on swarming.
Usage: trigger.py <GN path> <test> <os_dim> <gpu_dim> <-s shards> This script can circumvent the trybots when attempting a job on a specific configuration. It must be used within a Chromium checkout currently. In the future we can likely use it in standalone. Optional arguments can specify the number of swarming shards, the pool, and extra command line test parameters like --gtest_filter. Bug: angleproject:3272 Change-Id: Ia79f4422786c463378fc7e0f7f5ae4d07bd097a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524700 Commit-Queue: Jamie Madill <[email protected]> Reviewed-by: Yuly Novikov <[email protected]>
1 parent cda4383 commit e3dc0df

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

scripts/trigger.bat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@python %~dp0\trigger.py %*

scripts/trigger.py

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/python2
2+
#
3+
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
#
7+
# trigger.py:
8+
# Helper script for triggering GPU tests on swarming.
9+
10+
import argparse
11+
import os
12+
import subprocess
13+
import sys
14+
15+
16+
def parse_args():
17+
parser = argparse.ArgumentParser(os.path.basename(sys.argv[0]))
18+
parser.add_argument('gn_path', help='path to GN. (e.g. out/Release)')
19+
parser.add_argument('test', help='test name. (e.g. angle_end2end_tests)')
20+
parser.add_argument('os_dim', help='OS dimension. (e.g. Windows-10)')
21+
parser.add_argument('gpu_dim', help='GPU dimension. (e.g. intel-hd-630-win10-stable)')
22+
parser.add_argument('-s', '--shards', default=1, help='number of shards', type=int)
23+
parser.add_argument('-p', '--pool', default='Chrome-GPU', help='swarming pool')
24+
parser.add_argument('extra_args', help='extra test command line arguments', nargs='*')
25+
return parser.parse_args()
26+
27+
28+
def main():
29+
args = parse_args()
30+
path = args.gn_path.replace('\\', '/')
31+
out_gn_path = '//' + path
32+
out_file_path = os.path.join(*path.split('/'))
33+
34+
mb_script_path = os.path.join('tools', 'mb', 'mb.py')
35+
subprocess.call(['python', mb_script_path, 'isolate', out_gn_path, args.test])
36+
37+
isolate_script_path = os.path.join('tools', 'swarming_client', 'isolate.py')
38+
isolate_file = os.path.join(out_file_path, '%s.isolate' % args.test)
39+
isolated_file = os.path.join(out_file_path, '%s.isolated' % args.test)
40+
41+
isolate_args = [
42+
'python', isolate_script_path, 'archive',
43+
'-I', 'https://isolateserver.appspot.com',
44+
'-i', isolate_file,
45+
'-s', isolated_file]
46+
stdout = subprocess.check_output(isolate_args)
47+
sha = stdout[:40]
48+
49+
print('Got an isolated SHA of %s' % sha)
50+
swarming_script_path = os.path.join('tools', 'swarming_client', 'swarming.py')
51+
52+
swarmings_args = [
53+
'python', swarming_script_path, 'trigger',
54+
'-S', 'chromium-swarm.appspot.com',
55+
'-I', 'isolateserver.appspot.com',
56+
'-d', 'os', args.os_dim,
57+
'-d', 'pool', args.pool,
58+
'-d', 'gpu', args.gpu_dim,
59+
'--shards=%d' % args.shards,
60+
'-s', sha]
61+
62+
if args.extra_args:
63+
swarmings_args += ['--'] + args.extra_args
64+
65+
print(' '.join(swarmings_args))
66+
subprocess.call(swarmings_args)
67+
return 0
68+
69+
70+
if __name__ == '__main__':
71+
sys.exit(main())

0 commit comments

Comments
 (0)