Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 contextlib | 5 import contextlib |
| 6 import datetime | 6 import datetime |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import pipes | 9 import pipes |
| 10 import re | 10 import re |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 891 apk_package=None, | 891 apk_package=None, |
| 892 official_build=False, | 892 official_build=False, |
| 893 json_results_file=None, | 893 json_results_file=None, |
| 894 timeout_scale=None, strict_mode=None, | 894 timeout_scale=None, strict_mode=None, |
| 895 suffix=None, num_retries=None, | 895 suffix=None, num_retries=None, |
| 896 device_flags=None, | 896 device_flags=None, |
| 897 wrapper_script_suite_name=None, | 897 wrapper_script_suite_name=None, |
| 898 result_details=False, | 898 result_details=False, |
| 899 cs_base_url=None, | 899 cs_base_url=None, |
| 900 store_tombstones=False, | 900 store_tombstones=False, |
| 901 render_results_dir=None, | |
| 901 **kwargs): | 902 **kwargs): |
| 902 args = [ | 903 args = [ |
| 903 '--blacklist-file', self.blacklist_file, | 904 '--blacklist-file', self.blacklist_file, |
| 904 ] | 905 ] |
| 905 if tool: | 906 if tool: |
| 906 args.append('--tool=%s' % tool) | 907 args.append('--tool=%s' % tool) |
| 907 if flakiness_dashboard: | 908 if flakiness_dashboard: |
| 908 args.extend(['--flakiness-dashboard-server', flakiness_dashboard]) | 909 args.extend(['--flakiness-dashboard-server', flakiness_dashboard]) |
| 909 if annotation: | 910 if annotation: |
| 910 args.extend(['-A', annotation]) | 911 args.extend(['-A', annotation]) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 950 annotation or name, ' (%s)' % suffix if suffix else '') | 951 annotation or name, ' (%s)' % suffix if suffix else '') |
| 951 | 952 |
| 952 try: | 953 try: |
| 953 step_result = self.test_runner( | 954 step_result = self.test_runner( |
| 954 step_name, | 955 step_name, |
| 955 args=args, | 956 args=args, |
| 956 wrapper_script_suite_name=wrapper_script_suite_name, | 957 wrapper_script_suite_name=wrapper_script_suite_name, |
| 957 **kwargs) | 958 **kwargs) |
| 958 finally: | 959 finally: |
| 959 result_step = self.m.step.active_result | 960 result_step = self.m.step.active_result |
| 961 if render_results_dir: | |
| 962 self._upload_render_test_failures(render_results_dir) | |
| 960 if result_details: | 963 if result_details: |
| 961 if (hasattr(result_step, 'test_utils') and | 964 if (hasattr(result_step, 'test_utils') and |
| 962 hasattr(result_step.test_utils, 'gtest_results')): | 965 hasattr(result_step.test_utils, 'gtest_results')): |
| 963 json_results = self.m.json.input( | 966 json_results = self.m.json.input( |
| 964 result_step.test_utils.gtest_results.raw) | 967 result_step.test_utils.gtest_results.raw) |
| 965 details = self.create_result_details(step_name, | 968 details = self.create_result_details(step_name, |
| 966 json_results, | 969 json_results, |
| 967 cs_base_url) | 970 cs_base_url) |
| 968 self.m.step.active_result.presentation.logs[ | 971 self.m.step.active_result.presentation.logs[ |
| 969 'result_details'] = details | 972 'result_details'] = details |
| 970 self.copy_gtest_results(result_step, | 973 # Need to copy gtest results over. A few places call |
| 971 self.m.step.active_result) | 974 # |run_instrumentation_suite| function and then look for results in |
| 972 return step_result | 975 # the active_result. |
| 976 self.copy_gtest_results(result_step, | |
| 977 self.m.step.active_result) | |
|
mikecase (-- gone --)
2016/10/25 20:53:34
So, idk what you think about this. But if render_r
jbudorick
2016/10/25 21:37:32
As written, this is kind of nasty but does work. I
| |
| 973 | 978 |
| 974 def copy_gtest_results(self, result_step, active_step): | 979 def copy_gtest_results(self, result_step, active_step): |
| 975 if (hasattr(result_step, 'test_utils') and | 980 if (hasattr(result_step, 'test_utils') and |
| 976 hasattr(result_step.test_utils, 'gtest_results')): | 981 hasattr(result_step.test_utils, 'gtest_results')): |
| 977 active_step.test_utils = result_step.test_utils | 982 active_step.test_utils = result_step.test_utils |
| 978 | 983 |
| 979 def create_result_details(self, step_name, json_results_file, cs_base_url): | 984 def create_result_details(self, step_name, json_results_file, cs_base_url): |
| 980 presentation_args = ['--json-file', | 985 presentation_args = ['--json-file', |
| 981 json_results_file, | 986 json_results_file, |
| 982 '--master-name', | 987 '--master-name', |
| 983 self.m.properties.get('mastername')] | 988 self.m.properties.get('mastername')] |
| 984 if cs_base_url: | 989 if cs_base_url: |
| 985 presentation_args.extend(['--cs-base-url', cs_base_url]) | 990 presentation_args.extend(['--cs-base-url', cs_base_url]) |
| 986 result_details = self.m.python( | 991 result_details = self.m.python( |
| 987 '%s: generate result details' % step_name, | 992 '%s: generate result details' % step_name, |
| 988 self.resource('test_results_presentation.py'), | 993 self.resource('test_results_presentation.py'), |
| 989 args=presentation_args, | 994 args=presentation_args, |
| 990 stdout=self.m.raw_io.output(), | 995 stdout=self.m.raw_io.output(), |
| 991 step_test_data=( | 996 step_test_data=( |
| 992 lambda: self.m.raw_io.test_api.stream_output( | 997 lambda: self.m.raw_io.test_api.stream_output( |
| 993 '<!DOCTYPE html><html></html>'))) | 998 '<!DOCTYPE html><html></html>'))) |
| 994 return result_details.stdout.splitlines() | 999 return result_details.stdout.splitlines() |
| 995 | 1000 |
| 1001 def _upload_render_test_failures(self, render_results_dir): | |
| 1002 """Uploads render test results. Generates HTML file displaying results.""" | |
| 1003 args = ['--output-html-file', self.m.raw_io.output(), | |
| 1004 '--buildername', self.m.properties['buildername'], | |
| 1005 '--build-number', self.m.properties['buildnumber'], | |
| 1006 '--render-results-dir', render_results_dir] | |
| 1007 step_result = self.m.python( | |
| 1008 name='[Render Tests] Upload Results', | |
| 1009 script=self.m.path['checkout'].join( | |
| 1010 'build', 'android', 'render_tests', | |
| 1011 'process_render_test_results.py'), | |
| 1012 args=args, | |
| 1013 step_test_data=lambda: self.m.raw_io.test_api.output( | |
| 1014 '<!DOCTYPE html><html></html>')) | |
| 1015 step_result.presentation.logs['render results'] = ( | |
| 1016 step_result.raw_io.output.splitlines()) | |
| 1017 | |
| 996 def logcat_dump(self, gs_bucket=None): | 1018 def logcat_dump(self, gs_bucket=None): |
| 997 if gs_bucket: | 1019 if gs_bucket: |
| 998 log_path = self.m.chromium.output_dir.join('full_log') | 1020 log_path = self.m.chromium.output_dir.join('full_log') |
| 999 self.m.python( | 1021 self.m.python( |
| 1000 'logcat_dump', | 1022 'logcat_dump', |
| 1001 self.m.path['checkout'].join('build', 'android', | 1023 self.m.path['checkout'].join('build', 'android', |
| 1002 'adb_logcat_printer.py'), | 1024 'adb_logcat_printer.py'), |
| 1003 [ '--output-path', log_path, | 1025 [ '--output-path', log_path, |
| 1004 self.m.path['checkout'].join('out', 'logcat') ], | 1026 self.m.path['checkout'].join('out', 'logcat') ], |
| 1005 infra_step=True) | 1027 infra_step=True) |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1566 script = self.c.test_runner | 1588 script = self.c.test_runner |
| 1567 if wrapper_script_suite_name: | 1589 if wrapper_script_suite_name: |
| 1568 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1590 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1569 wrapper_script_suite_name) | 1591 wrapper_script_suite_name) |
| 1570 else: | 1592 else: |
| 1571 env = kwargs.get('env', {}) | 1593 env = kwargs.get('env', {}) |
| 1572 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1594 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1573 self.m.chromium.output_dir) | 1595 self.m.chromium.output_dir) |
| 1574 kwargs['env'] = env | 1596 kwargs['env'] = env |
| 1575 return self.m.python(step_name, script, args, **kwargs) | 1597 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |