| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 '--run-python-script', | 33 '--run-python-script', |
| 34 os.path.join(common.SRC_DIR, 'tools', 'telemetry', 'run_tests'), | 34 os.path.join(common.SRC_DIR, 'tools', 'telemetry', 'run_tests'), |
| 35 '--browser', args.build_config_fs.lower(), | 35 '--browser', args.build_config_fs.lower(), |
| 36 '--retry-limit', '3', | 36 '--retry-limit', '3', |
| 37 '--write-full-results-to', tempfile_path, | 37 '--write-full-results-to', tempfile_path, |
| 38 ] + filter_tests) | 38 ] + filter_tests) |
| 39 | 39 |
| 40 with open(tempfile_path) as f: | 40 with open(tempfile_path) as f: |
| 41 results = json.load(f) | 41 results = json.load(f) |
| 42 | 42 |
| 43 parsed_results = common.parse_common_test_results(results) | 43 parsed_results = common.parse_common_test_results(results, test_separator='.') |
| 44 failures = parsed_results['unexpected_failures'] | 44 failures = parsed_results['unexpected_failures'] |
| 45 | 45 |
| 46 json.dump({ | 46 json.dump({ |
| 47 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and | 47 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and |
| 48 ((rc == 0) or failures)), | 48 ((rc == 0) or failures)), |
| 49 'failures': failures.keys(), | 49 'failures': failures.keys(), |
| 50 }, args.output) | 50 }, args.output) |
| 51 | 51 |
| 52 return rc | 52 return rc |
| 53 | 53 |
| 54 | 54 |
| 55 def main_compile_targets(args): | 55 def main_compile_targets(args): |
| 56 json.dump(['chrome'], args.output) | 56 json.dump(['chrome'], args.output) |
| 57 | 57 |
| 58 | 58 |
| 59 if __name__ == '__main__': | 59 if __name__ == '__main__': |
| 60 funcs = { | 60 funcs = { |
| 61 'run': main_run, | 61 'run': main_run, |
| 62 'compile_targets': main_compile_targets, | 62 'compile_targets': main_compile_targets, |
| 63 } | 63 } |
| 64 sys.exit(common.run_script(sys.argv[1:], funcs)) | 64 sys.exit(common.run_script(sys.argv[1:], funcs)) |
| OLD | NEW |