OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import find_depot_tools | 7 import os |
8 import subprocess | |
8 import sys | 9 import sys |
9 | 10 |
10 find_depot_tools.add_depot_tools_to_path() | |
11 | |
12 from git_cl import Changelist | |
13 | |
14 BOTS = { | 11 BOTS = { |
15 '--arm32': 'v8_arm32_perf_try', | 12 '--arm32': 'v8_arm32_perf_try', |
16 '--linux32': 'v8_linux32_perf_try', | 13 '--linux32': 'v8_linux32_perf_try', |
17 '--linux64': 'v8_linux64_perf_try', | 14 '--linux64': 'v8_linux64_perf_try', |
18 '--linux64_haswell': 'v8_linux64_haswell_perf_try', | 15 '--linux64_haswell': 'v8_linux64_haswell_perf_try', |
19 '--nexus5': 'v8_nexus5_perf_try', | 16 '--nexus5': 'v8_nexus5_perf_try', |
20 '--nexus7': 'v8_nexus7_perf_try', | 17 '--nexus7': 'v8_nexus7_perf_try', |
21 '--nexus9': 'v8_nexus9_perf_try', | 18 '--nexus9': 'v8_nexus9_perf_try', |
22 '--nexus10': 'v8_nexus10_perf_try', | 19 '--nexus10': 'v8_nexus10_perf_try', |
23 } | 20 } |
24 | 21 |
25 DEFAULT_BOTS = [ | 22 DEFAULT_BOTS = [ |
23 'v8_arm32_perf_try', | |
26 'v8_linux32_perf_try', | 24 'v8_linux32_perf_try', |
27 'v8_linux64_haswell_perf_try', | 25 'v8_linux64_haswell_perf_try', |
26 'v8_nexus10_perf_try', | |
28 ] | 27 ] |
29 | 28 |
29 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) | |
30 | |
30 def main(): | 31 def main(): |
31 parser = argparse.ArgumentParser(description='') | 32 parser = argparse.ArgumentParser(description='') |
32 parser.add_argument("benchmarks", nargs="+", help="The benchmarks to run.") | 33 parser.add_argument("benchmarks", nargs="+", help="The benchmarks to run.") |
33 for option in sorted(BOTS): | 34 for option in sorted(BOTS): |
34 parser.add_argument( | 35 parser.add_argument( |
35 option, dest='bots', action='append_const', const=BOTS[option], | 36 option, dest='bots', action='append_const', const=BOTS[option], |
36 help='Add %s trybot.' % BOTS[option]) | 37 help='Add %s trybot.' % BOTS[option]) |
37 options = parser.parse_args() | 38 options = parser.parse_args() |
38 if not options.bots: | 39 if not options.bots: |
39 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) | 40 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) |
40 options.bots = DEFAULT_BOTS | 41 options.bots = DEFAULT_BOTS |
41 | 42 |
42 cl = Changelist() | |
43 if not cl.GetIssue(): | |
44 print 'Need to upload first' | |
45 return 1 | |
46 | |
47 props = cl.GetIssueProperties() | |
48 if props.get('closed'): | |
49 print 'Cannot send tryjobs for a closed CL' | |
50 return 1 | |
51 | |
52 if props.get('private'): | |
53 print 'Cannot use trybots with private issue' | |
54 return 1 | |
55 | |
56 if not options.benchmarks: | 43 if not options.benchmarks: |
57 print 'Please specify the benchmarks to run as arguments.' | 44 print 'Please specify the benchmarks to run as arguments.' |
58 return 1 | 45 return 1 |
59 | 46 |
60 masters = { | 47 # Ensure depot_tools are updated. |
tandrii(chromium)
2015/09/17 12:45:21
nice!
| |
61 'internal.client.v8': dict((b, options.benchmarks) for b in options.bots), | 48 subprocess.check_output( |
62 } | 49 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) |
63 cl.RpcServer().trigger_distributed_try_jobs( | 50 |
64 cl.GetIssue(), cl.GetMostRecentPatchset(), cl.GetBranch(), | 51 cmd = ['git cl try -m internal.client.v8'] |
65 False, None, masters) | 52 cmd += ['-b %s' % bot for bot in options.bots] |
tandrii(chromium)
2015/09/17 12:45:21
do bot names always have no spaces?
Michael Achenbach
2015/09/17 12:52:14
For trybots we follow this convention everywhere o
| |
66 return 0 | 53 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] |
54 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] | |
55 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) | |
56 | |
67 | 57 |
68 if __name__ == "__main__": # pragma: no cover | 58 if __name__ == "__main__": # pragma: no cover |
69 sys.exit(main()) | 59 sys.exit(main()) |
OLD | NEW |