OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 import os | 31 import os |
32 import json | 32 import json |
33 import logging | 33 import logging |
34 import optparse | 34 import optparse |
35 import time | 35 import time |
36 import datetime | 36 import datetime |
37 | 37 |
38 from webkitpy.common import find_files | 38 from webkitpy.common import find_files |
39 from webkitpy.common.checkout.scm.detection import SCMDetector | 39 from webkitpy.common.checkout.scm.detection import SCMDetector |
40 from webkitpy.common.config.urls import view_source_url | |
41 from webkitpy.common.host import Host | 40 from webkitpy.common.host import Host |
42 from webkitpy.common.net.file_uploader import FileUploader | 41 from webkitpy.common.net.file_uploader import FileUploader |
43 from webkitpy.performance_tests.perftest import PerfTestFactory | 42 from webkitpy.performance_tests.perftest import PerfTestFactory |
44 from webkitpy.performance_tests.perftest import DEFAULT_TEST_RUNNER_COUNT | 43 from webkitpy.performance_tests.perftest import DEFAULT_TEST_RUNNER_COUNT |
45 | 44 |
46 | 45 |
47 _log = logging.getLogger(__name__) | 46 _log = logging.getLogger(__name__) |
48 | 47 |
49 | 48 |
50 class PerfTestsRunner(object): | 49 class PerfTestsRunner(object): |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 282 |
284 for test, metrics in self._results: | 283 for test, metrics in self._results: |
285 for metric_name, iteration_values in metrics.iteritems(): | 284 for metric_name, iteration_values in metrics.iteritems(): |
286 if not isinstance(iteration_values, list): # We can't reports r
esults without individual measurements. | 285 if not isinstance(iteration_values, list): # We can't reports r
esults without individual measurements. |
287 continue | 286 continue |
288 | 287 |
289 tests = contents['tests'] | 288 tests = contents['tests'] |
290 path = test.test_name_without_file_extension().split('/') | 289 path = test.test_name_without_file_extension().split('/') |
291 for i in range(0, len(path)): | 290 for i in range(0, len(path)): |
292 is_last_token = i + 1 == len(path) | 291 is_last_token = i + 1 == len(path) |
293 url = view_source_url('PerformanceTests/' + (test.test_name(
) if is_last_token else '/'.join(path[0:i + 1]))) | 292 url = self.view_source_url( |
| 293 'PerformanceTests/' + (test.test_name() if is_last_token
else '/'.join(path[0:i + 1]))) |
294 tests.setdefault(path[i], {'url': url}) | 294 tests.setdefault(path[i], {'url': url}) |
295 current_test = tests[path[i]] | 295 current_test = tests[path[i]] |
296 if is_last_token: | 296 if is_last_token: |
297 current_test.setdefault('metrics', {}) | 297 current_test.setdefault('metrics', {}) |
298 assert metric_name not in current_test['metrics'] | 298 assert metric_name not in current_test['metrics'] |
299 current_test['metrics'][metric_name] = {'current': itera
tion_values} | 299 current_test['metrics'][metric_name] = {'current': itera
tion_values} |
300 else: | 300 else: |
301 current_test.setdefault('tests', {}) | 301 current_test.setdefault('tests', {}) |
302 tests = current_test['tests'] | 302 tests = current_test['tests'] |
303 | 303 |
304 return contents | 304 return contents |
305 | 305 |
306 @staticmethod | 306 @staticmethod |
| 307 def view_source_url(path_from_blink): |
| 308 return 'https://chromium.googlesource.com/chromium/src/+/master/third_pa
rty/WebKit/%s' % path_from_blink |
| 309 |
| 310 @staticmethod |
307 def _datetime_in_ES5_compatible_iso_format(datetime): | 311 def _datetime_in_ES5_compatible_iso_format(datetime): |
308 return datetime.strftime('%Y-%m-%dT%H:%M:%S.%f') | 312 return datetime.strftime('%Y-%m-%dT%H:%M:%S.%f') |
309 | 313 |
310 def _merge_slave_config_json(self, slave_config_json_path, contents): | 314 def _merge_slave_config_json(self, slave_config_json_path, contents): |
311 if not self._host.filesystem.isfile(slave_config_json_path): | 315 if not self._host.filesystem.isfile(slave_config_json_path): |
312 _log.error("Missing slave configuration JSON file: %s", slave_config
_json_path) | 316 _log.error("Missing slave configuration JSON file: %s", slave_config
_json_path) |
313 return None | 317 return None |
314 | 318 |
315 try: | 319 try: |
316 slave_config_json = self._host.filesystem.open_text_file_for_reading
(slave_config_json_path) | 320 slave_config_json = self._host.filesystem.open_text_file_for_reading
(slave_config_json_path) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if metrics: | 373 if metrics: |
370 self._results.append((test, metrics)) | 374 self._results.append((test, metrics)) |
371 else: | 375 else: |
372 failures += 1 | 376 failures += 1 |
373 _log.error('FAILED') | 377 _log.error('FAILED') |
374 | 378 |
375 _log.info('Finished: %f s', time.time() - start_time) | 379 _log.info('Finished: %f s', time.time() - start_time) |
376 _log.info('') | 380 _log.info('') |
377 | 381 |
378 return failures | 382 return failures |
OLD | NEW |