| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 run the tests, retrying fails tests and collecting the test results, | 34 run the tests, retrying fails tests and collecting the test results, |
| 35 including crash logs, and mismatches with expectations. | 35 including crash logs, and mismatches with expectations. |
| 36 | 36 |
| 37 The Manager object has a constructor and one main method called run. | 37 The Manager object has a constructor and one main method called run. |
| 38 """ | 38 """ |
| 39 | 39 |
| 40 import datetime | 40 import datetime |
| 41 import json | 41 import json |
| 42 import logging | 42 import logging |
| 43 import random | 43 import random |
| 44 import re |
| 44 import sys | 45 import sys |
| 45 import time | 46 import time |
| 46 | 47 |
| 47 from webkitpy.common.net.file_uploader import FileUploader | 48 from webkitpy.common.net.file_uploader import FileUploader |
| 48 from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinde
r | 49 from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinde
r |
| 49 from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunne
r | 50 from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunne
r |
| 50 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite
r | 51 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite
r |
| 51 from webkitpy.layout_tests.layout_package import json_results_generator | 52 from webkitpy.layout_tests.layout_package import json_results_generator |
| 52 from webkitpy.layout_tests.models import test_expectations | 53 from webkitpy.layout_tests.models import test_expectations |
| 53 from webkitpy.layout_tests.models import test_failures | 54 from webkitpy.layout_tests.models import test_failures |
| (...skipping 23 matching lines...) Expand all Loading... |
| 77 self._port = port | 78 self._port = port |
| 78 self._filesystem = port.host.filesystem | 79 self._filesystem = port.host.filesystem |
| 79 self._options = options | 80 self._options = options |
| 80 self._printer = printer | 81 self._printer = printer |
| 81 self._expectations = None | 82 self._expectations = None |
| 82 | 83 |
| 83 self.HTTP_SUBDIR = 'http' + port.TEST_PATH_SEPARATOR | 84 self.HTTP_SUBDIR = 'http' + port.TEST_PATH_SEPARATOR |
| 84 self.INSPECTOR_SUBDIR = 'inspector' + port.TEST_PATH_SEPARATOR | 85 self.INSPECTOR_SUBDIR = 'inspector' + port.TEST_PATH_SEPARATOR |
| 85 self.PERF_SUBDIR = 'perf' | 86 self.PERF_SUBDIR = 'perf' |
| 86 self.WEBSOCKET_SUBDIR = 'websocket' + port.TEST_PATH_SEPARATOR | 87 self.WEBSOCKET_SUBDIR = 'websocket' + port.TEST_PATH_SEPARATOR |
| 87 self.VIRTUAL_HTTP_SUBDIR = port.TEST_PATH_SEPARATOR.join([ | 88 self.VIRTUAL_HTTP_SUBDIR_PATTERN = re.escape( |
| 88 'virtual', 'stable', 'http']) | 89 port.TEST_PATH_SEPARATOR).join(['virtual', '.*', 'http']) |
| 89 self.LAYOUT_TESTS_DIRECTORY = 'LayoutTests' | 90 self.LAYOUT_TESTS_DIRECTORY = 'LayoutTests' |
| 90 self.ARCHIVED_RESULTS_LIMIT = 25 | 91 self.ARCHIVED_RESULTS_LIMIT = 25 |
| 91 self._http_server_started = False | 92 self._http_server_started = False |
| 92 self._wptserve_started = False | 93 self._wptserve_started = False |
| 93 self._websockets_server_started = False | 94 self._websockets_server_started = False |
| 94 | 95 |
| 95 self._results_directory = self._port.results_directory() | 96 self._results_directory = self._port.results_directory() |
| 96 self._finder = LayoutTestFinder(self._port, self._options) | 97 self._finder = LayoutTestFinder(self._port, self._options) |
| 97 self._runner = LayoutTestRunner(self._options, self._port, self._printer
, self._results_directory, self._test_is_slow) | 98 self._runner = LayoutTestRunner(self._options, self._port, self._printer
, self._results_directory, self._test_is_slow) |
| 98 | 99 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 initial_results, all_retry_results, enabled_pixel_tests_in_retry) | 219 initial_results, all_retry_results, enabled_pixel_tests_in_retry) |
| 219 | 220 |
| 220 def _collect_tests(self, args): | 221 def _collect_tests(self, args): |
| 221 return self._finder.find_tests(args, test_list=self._options.test_list, | 222 return self._finder.find_tests(args, test_list=self._options.test_list, |
| 222 fastest_percentile=self._options.fastest) | 223 fastest_percentile=self._options.fastest) |
| 223 | 224 |
| 224 def _is_http_test(self, test): | 225 def _is_http_test(self, test): |
| 225 return ( | 226 return ( |
| 226 test.startswith(self.HTTP_SUBDIR) or | 227 test.startswith(self.HTTP_SUBDIR) or |
| 227 self._is_websocket_test(test) or | 228 self._is_websocket_test(test) or |
| 228 self.VIRTUAL_HTTP_SUBDIR in test | 229 bool(re.match(self.VIRTUAL_HTTP_SUBDIR_PATTERN, test)) |
| 229 ) | 230 ) |
| 230 | 231 |
| 231 def _is_inspector_test(self, test): | 232 def _is_inspector_test(self, test): |
| 232 return self.INSPECTOR_SUBDIR in test | 233 return self.INSPECTOR_SUBDIR in test |
| 233 | 234 |
| 234 def _is_websocket_test(self, test): | 235 def _is_websocket_test(self, test): |
| 235 if self._port.is_wpt_enabled() and self._port.is_wpt_test(test): | 236 if self._port.is_wpt_enabled() and self._port.is_wpt_test(test): |
| 236 return False | 237 return False |
| 237 | 238 |
| 238 return self.WEBSOCKET_SUBDIR in test | 239 return self.WEBSOCKET_SUBDIR in test |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 551 |
| 551 stats = {} | 552 stats = {} |
| 552 for result in initial_results.results_by_name.values(): | 553 for result in initial_results.results_by_name.values(): |
| 553 if result.type != test_expectations.SKIP: | 554 if result.type != test_expectations.SKIP: |
| 554 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( | 555 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( |
| 555 result.test_run_time * 1000), int(result.total_run_time * 10
00))} | 556 result.test_run_time * 1000), int(result.total_run_time * 10
00))} |
| 556 stats_trie = {} | 557 stats_trie = {} |
| 557 for name, value in stats.iteritems(): | 558 for name, value in stats.iteritems(): |
| 558 json_results_generator.add_path_to_trie(name, value, stats_trie) | 559 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 559 return stats_trie | 560 return stats_trie |
| OLD | NEW |