OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
mithro
2017/01/31 23:51:42
This is emulating what the recipes code should be
Dirk Pranke
2017/02/01 01:32:51
Correct. This is a transitional script that I was
| |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import argparse | |
7 import json | |
8 import os | |
9 import shutil | |
10 import sys | |
11 import tempfile | |
12 | |
13 | |
14 import common | |
15 | |
16 # Add src/testing/ into sys.path for importing xvfb. | |
17 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | |
18 import xvfb | |
19 | |
20 | |
21 def main_run(args): | |
22 os.chdir('src/out/Release') | |
qyearsley
2017/01/13 01:09:12
Note, this doesn't matter, but when running this s
| |
23 | |
24 rc = common.run_command([ | |
25 sys.executable, | |
26 '../../tools/mb/mb.py', | |
27 'isolate', | |
28 '//out/Release', | |
29 'webkit_layout_tests_exparchive', | |
30 ]) | |
31 if rc: | |
32 return rc | |
33 | |
34 rc = common.run_command([ | |
35 '../../tools/luci-go/linux64/isolate', | |
36 'exparchive', | |
37 '-verbose', | |
38 '-isolate=webkit_layout_tests_exparchive.isolate', | |
39 '-isolated=webkit_layout_tests_exparchive.isolated', | |
40 '-isolate-server=https://isolateserver.appspot.com', | |
41 ]) | |
42 if rc: | |
43 return rc | |
44 | |
45 blamelist = os.environ.get('BUILDBOT_BLAMELIST', []) | |
46 if (len(blamelist) == 1 and | |
47 os.environ.get('BUILDBOT_MASTERNAME').startswith('tryserver')): | |
48 user_args = ['--user', blamelist[0]] | |
49 else: | |
50 user_args = [] | |
51 | |
52 if isinstance(args.args, dict): | |
53 num_shards = args.args.get('shards', 1) | |
54 else: | |
55 num_shards = 1 | |
56 | |
57 try: | |
58 tmpdir = tempfile.mkdtemp('run_locally_swarmed_webkit_layout_tests_results', | |
59 dir='.') | |
60 rc = common.run_command([ | |
61 sys.executable, | |
62 '../../tools/swarming_client/swarming.py', | |
63 'run', | |
64 '-v', | |
65 ] + user_args + [ | |
66 '-d', 'pool', 'Chrome', | |
67 '-d', 'os', 'Ubuntu-12.04', | |
68 '-d', 'gpu', 'none', | |
69 '--swarming', 'https://chromium-swarm.appspot.com', | |
70 '--isolate-server', 'https://isolateserver.appspot.com', | |
71 '--shards', str(num_shards), | |
72 '--task-output-dir', tmpdir, | |
73 'webkit_layout_tests_exparchive.isolated', | |
74 '--', | |
75 '--isolated-script-test-output', | |
76 '${ISOLATED_OUTDIR}/output.json', | |
77 ]) | |
78 finally: | |
79 # TODO: Merge the output and return real failures. | |
80 shutil.rmtree(tmpdir, ignore_errors=True) | |
81 | |
82 json.dump({ | |
83 'valid': True, | |
84 'failures': ['Failure'] if rc else [], | |
85 }, args.output) | |
86 | |
87 | |
88 def main_compile_targets(args): | |
89 json.dump(["locally_swarmed_webkit_layout_tests"], args.output) | |
90 | |
91 | |
92 if __name__ == '__main__': | |
93 funcs = { | |
94 'run': main_run, | |
95 'compile_targets': main_compile_targets, | |
96 } | |
97 sys.exit(common.run_script(sys.argv[1:], funcs)) | |
OLD | NEW |