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

Side by Side Diff: scripts/slave/recipe_modules/chromium_tests/steps.py

Issue 1372723002: Empty per_page_values shouldn't imply test success (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Remove dead code Created 5 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/test_utils/test_api.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 re 5 import re
6 import string 6 import string
7 7
8 8
9 class Test(object): 9 class Test(object):
10 """ 10 """
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1238
1239 def compile_targets(self, _): 1239 def compile_targets(self, _):
1240 # TODO(sergiyb): Build 'chrome_public_apk' instead of 'chrome' on Android. 1240 # TODO(sergiyb): Build 'chrome_public_apk' instead of 'chrome' on Android.
1241 return ['chrome', 'telemetry_gpu_test_run'] # pragma: no cover 1241 return ['chrome', 'telemetry_gpu_test_run'] # pragma: no cover
1242 1242
1243 def run(self, api, suffix): # pylint: disable=R0201 1243 def run(self, api, suffix): # pylint: disable=R0201
1244 kwargs = self._runtest_kwargs.copy() 1244 kwargs = self._runtest_kwargs.copy()
1245 kwargs['args'].extend(['--output-format', 'json', 1245 kwargs['args'].extend(['--output-format', 'json',
1246 '--output-dir', api.raw_io.output_dir()]) 1246 '--output-dir', api.raw_io.output_dir()])
1247 step_test_data=lambda: api.test_utils.test_api.canned_telemetry_gpu_output( 1247 step_test_data=lambda: api.test_utils.test_api.canned_telemetry_gpu_output(
1248 passing=False, is_win=api.platform.is_win) 1248 passing=True, is_win=api.platform.is_win)
1249 try: 1249 try:
1250 api.isolate.run_telemetry_test( 1250 api.isolate.run_telemetry_test(
1251 'telemetry_gpu_test', 1251 'telemetry_gpu_test',
1252 self.target_name, 1252 self.target_name,
1253 self._revision, 1253 self._revision,
1254 self._webkit_revision, 1254 self._webkit_revision,
1255 name=self._step_name(suffix), 1255 name=self._step_name(suffix),
1256 spawn_dbus=True, 1256 spawn_dbus=True,
1257 step_test_data=step_test_data, 1257 step_test_data=step_test_data,
1258 **self._runtest_kwargs) 1258 **self._runtest_kwargs)
1259 finally: 1259 finally:
1260 step_result = api.step.active_result 1260 step_result = api.step.active_result
1261 self._test_runs[suffix] = step_result 1261 self._test_runs[suffix] = step_result
1262 1262
1263 try: 1263 try:
1264 res = api.json.loads(step_result.raw_io.output_dir['results.json']) 1264 res = api.json.loads(step_result.raw_io.output_dir['results.json'])
1265 self._failures[suffix] = [res['pages'][str(value['page_id'])]['name'] 1265 failures = [res['pages'][str(value['page_id'])]['name']
1266 for value in res['per_page_values'] 1266 for value in res['per_page_values']
1267 if value['type'] == 'failure'] 1267 if value['type'] == 'failure']
1268 if not failures and step_result.retcode != 0:
1269 failures = ['%s (entire test suite)' % self.name]
1268 1270
1271 self._failures[suffix] = failures
1269 self._valid[suffix] = True 1272 self._valid[suffix] = True
1270 except (ValueError, KeyError, AttributeError): # pragma: no cover 1273 except (ValueError, KeyError, AttributeError): # pragma: no cover
1271 self._valid[suffix] = False 1274 self._valid[suffix] = False
1272 1275
1273 if self._valid[suffix]: 1276 if self._valid[suffix]:
1274 step_result.presentation.step_text += api.test_utils.format_step_text([ 1277 step_result.presentation.step_text += api.test_utils.format_step_text([
1275 ['failures:', self._failures[suffix]] 1278 ['failures:', self._failures[suffix]]
1276 ]) 1279 ])
1277 1280
1278 def has_valid_results(self, api, suffix): 1281 def has_valid_results(self, api, suffix):
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 title=self._step_name(suffix), isolated_hash=isolated_hash, 1317 title=self._step_name(suffix), isolated_hash=isolated_hash,
1315 extra_args=args) 1318 extra_args=args)
1316 1319
1317 def validate_task_results(self, api, step_result): 1320 def validate_task_results(self, api, step_result):
1318 results = getattr(step_result, 'telemetry_results', None) or {} 1321 results = getattr(step_result, 'telemetry_results', None) or {}
1319 1322
1320 try: 1323 try:
1321 failures = [results['pages'][str(value['page_id'])]['name'] 1324 failures = [results['pages'][str(value['page_id'])]['name']
1322 for value in results['per_page_values'] 1325 for value in results['per_page_values']
1323 if value['type'] == 'failure'] 1326 if value['type'] == 'failure']
1327 if not failures and step_result.retcode != 0:
1328 failures = ['%s (entire test suite)' % self.name]
1324 1329
1325 valid = True 1330 valid = True
1326 except (ValueError, KeyError) as e: # pragma: no cover 1331 except (ValueError, KeyError) as e: # pragma: no cover
1327 step_result.presentation.logs['invalid_results_exc'] = [str(e)] 1332 step_result.presentation.logs['invalid_results_exc'] = [str(e)]
1328 valid = False 1333 valid = False
1329 failures = None 1334 failures = None
1330 1335
1331 if valid: 1336 if valid:
1332 step_result.presentation.step_text += api.test_utils.format_step_text([ 1337 step_result.presentation.step_text += api.test_utils.format_step_text([
1333 ['failures:', failures] 1338 ['failures:', failures]
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 def run(self, api, suffix): 1657 def run(self, api, suffix):
1653 api.chromium_android.coverage_report(upload=False) 1658 api.chromium_android.coverage_report(upload=False)
1654 api.chromium_android.get_changed_lines_for_revision() 1659 api.chromium_android.get_changed_lines_for_revision()
1655 api.chromium_android.incremental_coverage_report() 1660 api.chromium_android.incremental_coverage_report()
1656 1661
1657 1662
1658 GOMA_TESTS = [ 1663 GOMA_TESTS = [
1659 GTestTest('base_unittests'), 1664 GTestTest('base_unittests'),
1660 GTestTest('content_unittests'), 1665 GTestTest('content_unittests'),
1661 ] 1666 ]
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/test_utils/test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698