Changeset 55373 in webkit
- Timestamp:
- Mar 1, 2010 12:41:29 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r55372 r55373 1 2010-03-01 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by David Levin. 4 5 General cleanup of error handling in new-run-webkit-tests. 6 7 Add Port.check_build() call that is separate from Port.check_sys_deps() 8 (and add a --nocheck-build flag to skip). This breaks a circular 9 dependency where you would start the layout test helper before 10 checking sys deps, but checking sys deps was the thing that told 11 you if your binaries where there. 12 13 Also, made Port.check_sys_deps(), start_helper() and stop_helper() 14 optional by providing default implementations in the base class 15 rather than requiring ports to implement the routines regardless 16 of whether or not they were needed. 17 18 Lastly, tweak a bunch of log messages to be cleaner, including 19 changing messages in thirdparty/autoinstall.py to be silent at 20 the default log level. 21 22 http://bugs.webkit.org/show_bug.cgi?id=35416 23 24 * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py: 25 * Scripts/webkitpy/layout_tests/port/base.py: 26 * Scripts/webkitpy/layout_tests/port/chromium.py: 27 * Scripts/webkitpy/layout_tests/port/chromium_linux.py: 28 * Scripts/webkitpy/layout_tests/port/chromium_mac.py: 29 * Scripts/webkitpy/layout_tests/port/chromium_win.py: 30 * Scripts/webkitpy/layout_tests/port/mac.py: 31 * Scripts/webkitpy/layout_tests/port/passing.py: 32 * Scripts/webkitpy/layout_tests/port/test.py: 33 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 34 * Scripts/webkitpy/thirdparty/autoinstall.py 35 1 36 2010-03-01 Dirk Pranke <dpranke@chromium.org> 2 37 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
r54760 r55373 634 634 else: 635 635 build_type = 'RELEASE' 636 print "\nFAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" \ 637 % (self._test_platform_name.upper(), build_type) 636 logging.error('') 637 logging.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" % 638 (self._test_platform_name.upper(), build_type)) 638 639 639 640 for error in self._non_fatal_errors: 640 641 logging.error(error) 642 logging.error('') 641 643 if len(self._errors): 642 644 raise SyntaxError('\n'.join(map(str, self._errors))) -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
r55372 r55373 69 69 raise NotImplementedError('Port.baseline_search_path') 70 70 71 def check_build(self, needs_http): 72 """This routine is used to ensure that the build is up to date 73 and all the needed binaries are present.""" 74 raise NotImplementedError('Port.check_build') 75 71 76 def check_sys_deps(self, needs_http): 72 77 """If the port needs to do some runtime checks to ensure that the 73 tests can be run successfully, they should be done here. 78 tests can be run successfully, it should override this routine. 79 This step can be skipped with --nocheck-sys-deps. 74 80 75 81 Returns whether the system is properly configured.""" 76 r aise NotImplementedError('Port.check_sys_deps')82 return True 77 83 78 84 def compare_text(self, expected_text, actual_text): … … 382 388 383 389 def start_helper(self): 384 """ Start a layout test helper if needed on this port. The test helper385 is used to reconfigure graphics settings and do other things that386 m ay be necessary to ensure a known test configuration."""387 raise NotImplementedError('Port.start_helper')390 """If a port needs to reconfigure graphics settings or do other 391 things to ensure a known test configuration, it should override this 392 method.""" 393 pass 388 394 389 395 def start_http_server(self): … … 409 415 def stop_helper(self): 410 416 """Shut down the test helper if it is running. Do nothing if 411 it isn't, or it isn't available.""" 412 raise NotImplementedError('Port.stop_helper') 417 it isn't, or it isn't available. If a port overrides start_helper() 418 it must override this routine as well.""" 419 pass 413 420 414 421 def stop_http_server(self): -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
r55372 r55373 43 43 44 44 45 def check_file_exists(path_to_file, str): 46 """Verify the executable is present where expected or log an error.""" 45 def check_file_exists(path_to_file, file_description, override_step=None): 46 """Verify the file is present where expected or log an error. 47 48 Args: 49 file_name: The (human friendly) name or description of the file 50 you're looking for (e.g., "HTTP Server"). Used for error logging. 51 override_step: An optional string to be logged if the check fails.""" 47 52 if not os.path.exists(path_to_file): 48 logging.error('Unable to find %s at %s' % (str, path_to_file)) 53 logging.error('Unable to find %s' % file_description) 54 logging.error(' at %s' % path_to_file) 55 if override_step: 56 logging.error(' %s' % override_step) 57 logging.error('') 49 58 return False 50 59 return True … … 61 70 return self._chromium_baseline_path(self._name) 62 71 63 def check_ sys_deps(self, needs_http):72 def check_build(self, needs_http): 64 73 result = True 65 74 test_shell_binary_path = self._path_to_driver() … … 67 76 'test driver') 68 77 if result: 69 result = (self._check_ build_up_to_date(self._options.target)78 result = (self._check_driver_build_up_to_date(self._options.target) 70 79 and result) 71 72 proc = subprocess.Popen([test_shell_binary_path,73 '--check-layout-test-sys-deps'])74 if proc.wait() != 0:75 logging.error('System dependencies check failed.')76 logging.error('To override, invoke with --nocheck-sys-deps')77 logging.error('')78 result = False79 80 80 else: 81 81 logging.error('') 82 82 83 helper_path = self._path_to_helper() 84 result = check_file_exists(helper_path, 85 'layout test helper') and result 83 86 84 87 if not self._options.no_pixel_tests: 85 88 image_diff_path = self._path_to_image_diff() 86 if not check_file_exists(image_diff_path, 'image diff exe'): 87 logging.error('To override, invoke with --no-pixel-tests') 88 logging.error('') 89 result = False 89 result = check_file_exists(image_diff_path, 'image diff exe', 90 'To override, invoke with --no-pixel-tests') and result 90 91 91 92 return result 93 94 def check_sys_deps(self, needs_http): 95 proc = subprocess.Popen([test_shell_binary_path, 96 '--check-layout-test-sys-deps']) 97 if proc.wait(): 98 logging.error('System dependencies check failed.') 99 logging.error('To override, invoke with --nocheck-sys-deps') 100 logging.error('') 101 result = False 102 return True 92 103 93 104 def path_from_chromium_base(self, *comps): … … 162 173 # 163 174 164 def _check_ build_up_to_date(self, target):175 def _check_driver_build_up_to_date(self, target): 165 176 if target in ('Debug', 'Release'): 166 177 try: -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
r55123 r55373 55 55 self._webkit_baseline_path('mac')] 56 56 57 def check_ sys_deps(self, needs_http):58 result = chromium.ChromiumPort.check_ sys_deps(self, needs_http)57 def check_build(self, needs_http): 58 result = chromium.ChromiumPort.check_build(self, needs_http) 59 59 if needs_http: 60 60 if self._options.use_apache: … … 102 102 "apache2 config file") and result 103 103 if not result: 104 logging.error(' Please install using: "sudo apt-get install '104 logging.error(' Please install using: "sudo apt-get install ' 105 105 'apache2 libapache2-mod-php5"') 106 106 logging.error('') … … 115 115 "LigHTTPd modules") and result 116 116 if not result: 117 logging.error(' Please install using: "sudo apt-get install '117 logging.error(' Please install using: "sudo apt-get install ' 118 118 'lighttpd php5-cgi"') 119 119 logging.error('') … … 123 123 result = chromium.check_file_exists(self._path_to_wdiff(), 'wdiff') 124 124 if not result: 125 logging.error(' Please install using: "sudo apt-get install '125 logging.error(' Please install using: "sudo apt-get install ' 126 126 'wdiff"') 127 127 logging.error('') -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
r55210 r55373 54 54 self._webkit_baseline_path('mac')] 55 55 56 def check_ sys_deps(self, needs_http):57 result = chromium.ChromiumPort.check_ sys_deps(self, needs_http)56 def check_build(self, needs_http): 57 result = chromium.ChromiumPort.check_build(self, needs_http) 58 58 result = self._check_wdiff_install() and result 59 59 if not result: -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
r55123 r55373 61 61 return dirs 62 62 63 def check_ sys_deps(self, needs_http):64 result = chromium.ChromiumPort.check_ sys_deps(self, needs_http)63 def check_build(self, needs_http): 64 result = chromium.ChromiumPort.check_build(self, needs_http) 65 65 if not result: 66 66 logging.error('For complete Windows build requirements, please ' -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
r55208 r55373 67 67 return dirs 68 68 69 def check_sys_deps(self, needs_http): 70 if executive.run_command([self.script_path("build-dumprendertree")], return_exit_code=True) != 0: 69 def check_build(self, needs_http): 70 if executive.run_command([self.script_path("build-dumprendertree")], 71 return_exit_code=True): 71 72 return False 72 73 … … 76 77 return False 77 78 78 # This should also validate that the ImageDiff path is valid (once this script knows how to use ImageDiff). 79 # This should also validate that the ImageDiff path is valid 80 # (once this script knows how to use ImageDiff). 79 81 # https://bugs.webkit.org/show_bug.cgi?id=34826 80 82 return True … … 98 100 """Starts a new Driver and returns a handle to it.""" 99 101 return MacDriver(self, image_path, options) 100 101 def start_helper(self):102 # This port doesn't use a helper process.103 pass104 105 def stop_helper(self):106 # This port doesn't use a helper process.107 pass108 102 109 103 def test_base_platform_names(self): -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py
r55268 r55373 39 39 Note that because this is really acting as a wrapper around the underlying 40 40 port, you must be able to run the underlying port as well 41 (check_ sys_deps() must pass and the layout_test_helper must work). You42 may be able to get around this with --nocheck-sys-deps and --nostart-helper.41 (check_build() and check_sys_deps() must pass and auxiliary binaries 42 like layout_test_helper and httpd must work). 43 43 44 44 This implementation also modifies the test expectations so that all … … 61 61 def __getattr__(self, name): 62 62 return getattr(self.__delegate, name) 63 63 64 64 def start_driver(self, image_path, options): 65 65 return PassingDriver(self, image_path, options) … … 99 99 if image_hash: 100 100 image_filename = self._port.expected_filename(test_name, '.png') 101 image = file(image_filename, 'rb').read() 102 output_file = file(self._image_path, 'w') 103 output_file.write(image) 104 output_file.close() 101 try: 102 image = file(image_filename, 'rb').read() 103 except IOError: 104 image = '' 105 if self._image_path: 106 output_file = file(self._image_path, 'w') 107 output_file.write(image) 108 output_file.close() 105 109 hash_filename = self._port.expected_filename(test_name, 106 110 '.checksum') 107 hash = file(hash_filename, 'r').read() 111 try: 112 hash = file(hash_filename, 'r').read() 113 except IOError: 114 hash = '' 108 115 else: 109 116 hash = None -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
r55372 r55373 53 53 return [self.baseline_path()] 54 54 55 def check_ sys_deps(self, needs_http):55 def check_build(self, needs_http): 56 56 return True 57 58 def compare_text(self, expected_text, actual_text): 59 return False 57 60 58 61 def diff_image(self, expected_filename, actual_filename, 59 62 diff_filename=None): 60 return False61 62 def compare_text(self, expected_text, actual_text):63 63 return False 64 64 … … 94 94 pass 95 95 96 def start_helper(self):97 pass98 99 96 def stop_http_server(self): 100 97 pass 101 98 102 99 def stop_websocket_server(self): 103 pass104 105 def stop_helper(self):106 100 pass 107 101 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r55341 r55373 553 553 result_summary: summary object to populate with the results 554 554 """ 555 self._meter.update('Starting test shells ...') 555 556 threads = self._instantiate_test_shell_threads(file_list, 556 557 result_summary) … … 615 616 616 617 if self.needs_http(): 618 self._meter.update('Starting HTTP server ...') 617 619 self._port.start_http_server() 618 620 619 621 if self._contains_tests(self.WEBSOCKET_SUBDIR): 622 self._meter.update('Starting WebSocket server ...') 620 623 self._port.start_websocket_server() 621 624 # self._websocket_secure_server.Start() … … 1469 1472 options.target == 'Debug') 1470 1473 1471 if not options.nostart_helper: 1472 port_obj.start_helper() 1474 meter.update("Checking build ...") 1475 if not port_obj.check_build(test_runner.needs_http()): 1476 sys.exit(1) 1477 1478 meter.update("Starting helper ...") 1479 port_obj.start_helper() 1473 1480 1474 1481 # Check that the system dependencies (themes, fonts, ...) are correct. 1475 if (not options.nocheck_sys_deps and 1476 not port_obj.check_sys_deps(test_runner.needs_http())): 1477 sys.exit(1) 1482 if not options.nocheck_sys_deps: 1483 meter.update("Checking system dependencies ...") 1484 if not port_obj.check_sys_deps(test_runner.needs_http()): 1485 sys.exit(1) 1478 1486 1479 1487 meter.update("Preparing tests ...") … … 1489 1497 test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff) 1490 1498 1491 meter.update("Starting ...")1492 1499 has_new_failures = test_runner.run(result_summary) 1493 1500 1494 if not options.nostart_helper: 1495 port_obj.stop_helper() 1501 port_obj.stop_helper() 1496 1502 1497 1503 logging.debug("Exit status: %d" % has_new_failures) … … 1622 1628 action="store_true", default=False, 1623 1629 help="run all tests in parallel") 1624 option_parser.add_option("", "--nostart-helper",1625 action="store_true", default=False,1626 help="don't run layout_test_helper")1627 1630 option_parser.add_option("", "--chromium", 1628 1631 action="store_true", default=False, -
trunk/WebKitTools/Scripts/webkitpy/thirdparty/autoinstall.py
r55363 r55373 294 294 295 295 def bind(self, package_name, url, zip_subpath): 296 _logger.info("binding: %s -> %s subpath: %s" % (package_name, url, zip_subpath)) 296 _logger.debug("binding: %s -> %s subpath: %s" % 297 (package_name, url, zip_subpath)) 297 298 self.packages[package_name] = (url, zip_subpath) 298 299
Note: See TracChangeset
for help on using the changeset viewer.