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

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

Issue 2442663004: Adding isolate for cc_perftests and triggering job on FYI waterfall (Closed)
Patch Set: Using cc build target Created 4 years, 1 month 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/gn_isolate_map.pyl ('k') | testing/scripts/run_gtest_perf_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import argparse 5 import argparse
6 import contextlib 6 import contextlib
7 import json 7 import json
8 import os 8 import os
9 import subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return args.func(args) 63 return args.func(args)
64 64
65 65
66 def run_command(argv, env=None, cwd=None): 66 def run_command(argv, env=None, cwd=None):
67 print 'Running %r in %r (env: %r)' % (argv, cwd, env) 67 print 'Running %r in %r (env: %r)' % (argv, cwd, env)
68 rc = subprocess.call(argv, env=env, cwd=cwd) 68 rc = subprocess.call(argv, env=env, cwd=cwd)
69 print 'Command %r returned exit code %d' % (argv, rc) 69 print 'Command %r returned exit code %d' % (argv, rc)
70 return rc 70 return rc
71 71
72 72
73 def run_command_with_output(argv, env=None, cwd=None, stdoutfile=None):
74 print 'Running %r in %r (env: %r)' % (argv, cwd, env)
75 rc = 1
76 try:
77 output = subprocess.check_output(argv, env=env, cwd=cwd)
78 if stdoutfile:
79 with open(stdoutfile, 'w') as fp:
80 fp.write(output)
81 rc = 0
82 except Exception:
83 # Exit code remains 1 and we don't write output
84 pass
85 print 'Command %r returned exit code %d' % (argv, rc)
86 return rc
87
88
73 def run_runtest(cmd_args, runtest_args): 89 def run_runtest(cmd_args, runtest_args):
74 if cmd_args.use_src_side_runtest_py: 90 if cmd_args.use_src_side_runtest_py:
75 cmd = [ 91 cmd = [
76 sys.executable, 92 sys.executable,
77 os.path.join( 93 os.path.join(
78 cmd_args.paths['checkout'], 'infra', 'scripts', 'runtest_wrapper.py'), 94 cmd_args.paths['checkout'], 'infra', 'scripts', 'runtest_wrapper.py'),
79 '--', 95 '--',
80 ] 96 ]
81 else: 97 else:
82 cmd = [ 98 cmd = [
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 [sys.executable, script_to_run] + extra_args) 179 [sys.executable, script_to_run] + extra_args)
164 180
165 with open(log_file) as f: 181 with open(log_file) as f:
166 failures = json.load(f) 182 failures = json.load(f)
167 json.dump({ 183 json.dump({
168 'valid': integration_test_res == 0, 184 'valid': integration_test_res == 0,
169 'failures': failures, 185 'failures': failures,
170 }, output) 186 }, output)
171 187
172 return integration_test_res 188 return integration_test_res
OLDNEW
« no previous file with comments | « testing/buildbot/gn_isolate_map.pyl ('k') | testing/scripts/run_gtest_perf_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698