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

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

Issue 649683005: Add src-side launcher for telemetry_unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get_compile_targets.py Created 6 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2014 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 json
7 import os
8 import sys
9
10
11 import common
12
13
14 def mode_run(args):
15 filter_tests = []
16 if args.filter_file:
17 filter_tests = json.load(args.filter_file)
18
19 with common.temporary_file() as tempfile_path:
20 rc = common.run_command([
21 os.path.join(args.paths['build'], 'scripts', 'tools', 'runit.py'),
22 '--show-path',
23 os.path.join(args.paths['build'], 'scripts', 'slave', 'runtest.py'),
24 '--target', args.build_config_fs,
25 '--xvfb',
26 '--annotate', 'gtest',
27 '--test-type', 'telemetry_unittests',
28 '--builder-name', args.properties['buildername'],
29 '--slave-name', args.properties['slavename'],
30 '--build-number', str(args.properties['buildnumber']),
31 '--run-python-script',
32 os.path.join(common.SRC_DIR, 'tools', 'telemetry', 'run_tests'),
33 '--browser', args.build_config_fs.lower(),
34 '--retry-limit', '3',
35 '--write-full-results-to', tempfile_path,
36 ] + filter_tests)
37
38 with open(tempfile_path) as f:
39 results = json.load(f)
40
41 parsed_results = common.parse_common_test_results(results)
42 failures = parsed_results['unexpected_failures']
43
44 with open(args.output, 'w') as f:
45 json.dump({
46 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and
47 ((rc == 0) or failures)),
48 'failures': failures.keys(),
49 }, f)
50
51 return rc
52
53
54 def mode_compile_targets(args):
55 with open(args.output, 'w') as f:
56 json.dump(['chrome'], f)
57
58
59 if __name__ == '__main__':
60 sys.exit(common.run_script(sys.argv[1:], mode_run, mode_compile_targets))
OLDNEW
« testing/scripts/get_compile_targets.py ('K') | « testing/scripts/get_compile_targets.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698