Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: testing/scripts/run_isolated_script_test.py

Issue 2678153003: buildbot: Run the webkit layout tests under swarming on RandomOrder bots. (Closed)
Patch Set: Rebase onto master. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/buildbot/manage.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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 """Runs a script that can run as an isolate (or not).
7
8 The main requirement is that
9
10 --isolated-script-test-output=[FILENAME]
11
12 is passed on the command line to run_isolated_script_tests. This gets
13 remapped to the command line argument --write-full-results-to.
14
15 json is written to that file in the format produced by
16 common.parse_common_test_results.
17
18 This script is intended to be the base command invoked by the isolate,
19 followed by a subsequent Python script. It could be generalized to
20 invoke an arbitrary executable.
21 """
22
23 # TODO(tansell): Remove this script once LayoutTests can accept the isolated
24 # arguments and start xvfb itself.
25
26 import argparse
27 import json
28 import os
29 import pprint
30 import sys
31
32
33 import common
34
35 # Add src/testing/ into sys.path for importing xvfb.
36 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
37 import xvfb
38
39
40 def main():
41 parser = argparse.ArgumentParser()
42 parser.add_argument('--isolated-script-test-output', type=str,
43 required=True)
44 parser.add_argument('--xvfb', help='start xvfb', action='store_true')
45
46 # This argument is ignored for now.
47 parser.add_argument('--isolated-script-test-chartjson-output', type=str)
48
49 args, rest_args = parser.parse_known_args()
50
51 env = os.environ
52 cmd = [sys.executable] + rest_args
53 cmd += ['--write-full-results-to', args.isolated_script_test_output]
54 if args.xvfb:
55 return xvfb.run_executable(cmd, env)
56 else:
57 return common.run_command(cmd, env=env)
58
59
60 # This is not really a "script test" so does not need to manually add
61 # any additional compile targets.
62 def main_compile_targets(args):
63 json.dump([], args.output)
64
65
66 if __name__ == '__main__':
67 # Conform minimally to the protocol defined by ScriptTest.
68 if 'compile_targets' in sys.argv:
69 funcs = {
70 'run': None,
71 'compile_targets': main_compile_targets,
72 }
73 sys.exit(common.run_script(sys.argv[1:], funcs))
74 sys.exit(main())
OLDNEW
« no previous file with comments | « testing/buildbot/manage.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698