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

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2439213002: Add step to process Render Test results. (Closed)
Patch Set: Rebase Created 3 years, 11 months 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 | « no previous file | scripts/slave/recipe_modules/chromium_android/example.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 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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 apk_package=None, 1025 apk_package=None,
1026 official_build=False, 1026 official_build=False,
1027 json_results_file=None, 1027 json_results_file=None,
1028 timeout_scale=None, strict_mode=None, 1028 timeout_scale=None, strict_mode=None,
1029 suffix=None, num_retries=None, 1029 suffix=None, num_retries=None,
1030 device_flags=None, 1030 device_flags=None,
1031 wrapper_script_suite_name=None, 1031 wrapper_script_suite_name=None,
1032 result_details=False, 1032 result_details=False,
1033 cs_base_url=None, 1033 cs_base_url=None,
1034 store_tombstones=False, 1034 store_tombstones=False,
1035 render_results_dir=None,
1035 args=None, 1036 args=None,
1036 **kwargs): 1037 **kwargs):
1037 args = args or [] 1038 args = args or []
1038 args.extend(['--blacklist-file', self.blacklist_file,]) 1039 args.extend(['--blacklist-file', self.blacklist_file,])
1039 if tool: 1040 if tool:
1040 args.append('--tool=%s' % tool) 1041 args.append('--tool=%s' % tool)
1041 if flakiness_dashboard: 1042 if flakiness_dashboard:
1042 args.extend(['--flakiness-dashboard-server', flakiness_dashboard]) 1043 args.extend(['--flakiness-dashboard-server', flakiness_dashboard])
1043 if annotation: 1044 if annotation:
1044 args.extend(['-A', annotation]) 1045 args.extend(['-A', annotation])
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 annotation or name, ' (%s)' % suffix if suffix else '') 1083 annotation or name, ' (%s)' % suffix if suffix else '')
1083 1084
1084 try: 1085 try:
1085 step_result = self.test_runner( 1086 step_result = self.test_runner(
1086 step_name, 1087 step_name,
1087 args=args, 1088 args=args,
1088 wrapper_script_suite_name=wrapper_script_suite_name, 1089 wrapper_script_suite_name=wrapper_script_suite_name,
1089 **kwargs) 1090 **kwargs)
1090 finally: 1091 finally:
1091 result_step = self.m.step.active_result 1092 result_step = self.m.step.active_result
1093 if render_results_dir:
1094 self._upload_render_test_failures(render_results_dir)
1092 if result_details: 1095 if result_details:
1093 if (hasattr(result_step, 'test_utils') and 1096 if (hasattr(result_step, 'test_utils') and
1094 hasattr(result_step.test_utils, 'gtest_results')): 1097 hasattr(result_step.test_utils, 'gtest_results')):
1095 json_results = self.m.json.input( 1098 json_results = self.m.json.input(
1096 result_step.test_utils.gtest_results.raw) 1099 result_step.test_utils.gtest_results.raw)
1097 details = self.create_result_details(step_name, 1100 details = self.create_result_details(step_name,
1098 json_results, 1101 json_results,
1099 cs_base_url) 1102 cs_base_url)
1100 self.m.step.active_result.presentation.logs[ 1103 self.m.step.active_result.presentation.logs['result_details'] = (
1101 'result_details'] = details 1104 details)
1102 self.copy_gtest_results(result_step, 1105 # Need to copy gtest results over. A few places call
1103 self.m.step.active_result) 1106 # |run_instrumentation_suite| function and then look for results in
1107 # the active_result.
1108 self.copy_gtest_results(result_step, self.m.step.active_result)
1104 return step_result 1109 return step_result
1105 1110
1106 def copy_gtest_results(self, result_step, active_step): 1111 def copy_gtest_results(self, result_step, active_step):
1107 if (hasattr(result_step, 'test_utils') and 1112 if (hasattr(result_step, 'test_utils') and
1108 hasattr(result_step.test_utils, 'gtest_results')): 1113 hasattr(result_step.test_utils, 'gtest_results')):
1109 active_step.test_utils = result_step.test_utils 1114 active_step.test_utils = result_step.test_utils
1110 1115
1111 def create_result_details(self, step_name, json_results_file, cs_base_url): 1116 def create_result_details(self, step_name, json_results_file, cs_base_url):
1112 presentation_args = ['--json-file', 1117 presentation_args = ['--json-file',
1113 json_results_file, 1118 json_results_file,
1114 '--master-name', 1119 '--master-name',
1115 self.m.properties.get('mastername')] 1120 self.m.properties.get('mastername')]
1116 if cs_base_url: 1121 if cs_base_url:
1117 presentation_args.extend(['--cs-base-url', cs_base_url]) 1122 presentation_args.extend(['--cs-base-url', cs_base_url])
1118 result_details = self.m.python( 1123 result_details = self.m.python(
1119 '%s: generate result details' % step_name, 1124 '%s: generate result details' % step_name,
1120 self.resource('test_results_presentation.py'), 1125 self.resource('test_results_presentation.py'),
1121 args=presentation_args, 1126 args=presentation_args,
1122 stdout=self.m.raw_io.output(), 1127 stdout=self.m.raw_io.output(),
1123 step_test_data=( 1128 step_test_data=(
1124 lambda: self.m.raw_io.test_api.stream_output( 1129 lambda: self.m.raw_io.test_api.stream_output(
1125 '<!DOCTYPE html><html></html>'))) 1130 '<!DOCTYPE html><html></html>')))
1126 return result_details.stdout.splitlines() 1131 return result_details.stdout.splitlines()
1127 1132
1133 def _upload_render_test_failures(self, render_results_dir):
1134 """Uploads render test results. Generates HTML file displaying results."""
1135 args = ['--output-html-file', self.m.raw_io.output(),
1136 '--buildername', self.m.properties['buildername'],
1137 '--build-number', self.m.properties['buildnumber'],
1138 '--render-results-dir', render_results_dir]
1139 step_result = self.m.python(
1140 name='[Render Tests] Upload Results',
1141 script=self.m.path['checkout'].join(
1142 'build', 'android', 'render_tests',
1143 'process_render_test_results.py'),
1144 args=args,
1145 step_test_data=lambda: self.m.raw_io.test_api.output(
1146 '<!DOCTYPE html><html></html>'))
1147 step_result.presentation.logs['render results'] = (
1148 step_result.raw_io.output.splitlines())
1149
1128 def logcat_dump(self, gs_bucket=None): 1150 def logcat_dump(self, gs_bucket=None):
1129 if gs_bucket: 1151 if gs_bucket:
1130 log_path = self.m.chromium.output_dir.join('full_log') 1152 log_path = self.m.chromium.output_dir.join('full_log')
1131 self.m.python( 1153 self.m.python(
1132 'logcat_dump', 1154 'logcat_dump',
1133 self.m.path['checkout'].join('build', 'android', 1155 self.m.path['checkout'].join('build', 'android',
1134 'adb_logcat_printer.py'), 1156 'adb_logcat_printer.py'),
1135 [ '--output-path', log_path, 1157 [ '--output-path', log_path,
1136 self.m.path['checkout'].join('out', 'logcat') ], 1158 self.m.path['checkout'].join('out', 'logcat') ],
1137 infra_step=True) 1159 infra_step=True)
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 def run_java_unit_test_suite(self, suite, verbose=True, 1421 def run_java_unit_test_suite(self, suite, verbose=True,
1400 json_results_file=None, suffix=None, **kwargs): 1422 json_results_file=None, suffix=None, **kwargs):
1401 args = [] 1423 args = []
1402 if verbose: 1424 if verbose:
1403 args.append('--verbose') 1425 args.append('--verbose')
1404 if self.c.BUILD_CONFIG == 'Release': 1426 if self.c.BUILD_CONFIG == 'Release':
1405 args.append('--release') 1427 args.append('--release')
1406 if json_results_file: 1428 if json_results_file:
1407 args.extend(['--json-results-file', json_results_file]) 1429 args.extend(['--json-results-file', json_results_file])
1408 1430
1409 self.test_runner( 1431 return self.test_runner(
1410 '%s%s' % (str(suite), ' (%s)' % suffix if suffix else ''), 1432 '%s%s' % (str(suite), ' (%s)' % suffix if suffix else ''),
1411 ['junit', '-s', suite] + args, 1433 ['junit', '-s', suite] + args,
1412 env=self.m.chromium.get_env(), 1434 env=self.m.chromium.get_env(),
1413 **kwargs) 1435 **kwargs)
1414 1436
1415 def _set_webview_command_line(self, command_line_args): 1437 def _set_webview_command_line(self, command_line_args):
1416 """Set the Android WebView command line. 1438 """Set the Android WebView command line.
1417 1439
1418 Args: 1440 Args:
1419 command_line_args: A list of command line arguments you want set for 1441 command_line_args: A list of command line arguments you want set for
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 script = self.c.test_runner 1698 script = self.c.test_runner
1677 if wrapper_script_suite_name: 1699 if wrapper_script_suite_name:
1678 script = self.m.chromium.output_dir.join('bin', 'run_%s' % 1700 script = self.m.chromium.output_dir.join('bin', 'run_%s' %
1679 wrapper_script_suite_name) 1701 wrapper_script_suite_name)
1680 else: 1702 else:
1681 env = kwargs.get('env', {}) 1703 env = kwargs.get('env', {})
1682 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', 1704 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR',
1683 self.m.chromium.output_dir) 1705 self.m.chromium.output_dir)
1684 kwargs['env'] = env 1706 kwargs['env'] = env
1685 return self.m.python(step_name, script, args, **kwargs) 1707 return self.m.python(step_name, script, args, **kwargs)
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698