| OLD | NEW |
| (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 main_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 json.dump({ | |
| 45 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and | |
| 46 ((rc == 0) or failures)), | |
| 47 'failures': failures.keys(), | |
| 48 }, args.output) | |
| 49 | |
| 50 return rc | |
| 51 | |
| 52 | |
| 53 def main_compile_targets(args): | |
| 54 json.dump(['chrome'], args.output) | |
| 55 | |
| 56 | |
| 57 if __name__ == '__main__': | |
| 58 funcs = { | |
| 59 'run': main_run, | |
| 60 'compile_targets': main_compile_targets, | |
| 61 } | |
| 62 sys.exit(common.run_script(sys.argv[1:], funcs)) | |
| OLD | NEW |