[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
cjerdonek at webkit.org
cjerdonek at webkit.org
Wed Mar 17 18:24:02 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 9c899ab31cbb4d4156d40ebb0ed5038215e4b529
Author: cjerdonek at webkit.org <cjerdonek at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Mar 6 00:52:59 2010 +0000
Changed the logging code for new-run-webkit-tests to use
module-specific loggers rather than the root logger. This is
a standard practice that allows logging specific to a package
to be configured independently of other modules.
Reviewed by Eric Seidel.
https://bugs.webkit.org/show_bug.cgi?id=35194
Added a line of the form "_log = logging.getLogger(<module>)"
to each module below, where <module> is the fully-qualified
name of the module, and updated the log lines to use the new
_log logger.
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
* Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
* Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
* Scripts/webkitpy/layout_tests/port/apache_http_server.py:
* Scripts/webkitpy/layout_tests/port/chromium.py:
* Scripts/webkitpy/layout_tests/port/chromium_linux.py:
* Scripts/webkitpy/layout_tests/port/chromium_mac.py:
* Scripts/webkitpy/layout_tests/port/chromium_win.py:
* Scripts/webkitpy/layout_tests/port/http_server.py:
* Scripts/webkitpy/layout_tests/port/http_server_base.py:
* Scripts/webkitpy/layout_tests/port/mac.py:
* Scripts/webkitpy/layout_tests/port/websocket_server.py:
* Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
* Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
* Scripts/webkitpy/layout_tests/test_types/image_diff.py:
* Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
* Scripts/webkitpy/layout_tests/test_types/text_diff.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 738c533..a32dbf8 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,38 @@
+2010-03-05 Chris Jerdonek <cjerdonek at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Changed the logging code for new-run-webkit-tests to use
+ module-specific loggers rather than the root logger. This is
+ a standard practice that allows logging specific to a package
+ to be configured independently of other modules.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35194
+
+ Added a line of the form "_log = logging.getLogger(<module>)"
+ to each module below, where <module> is the fully-qualified
+ name of the module, and updated the log lines to use the new
+ _log logger.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
2010-03-05 Dirk Pranke <dpranke at chromium.org>
Reviewed by Eric Siedel.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 9830f66..c73e9fd 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -38,6 +38,9 @@ import xml.dom.minidom
from layout_package import test_expectations
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "json_results_generator")
+
class JSONResultsGenerator(object):
@@ -154,8 +157,8 @@ class JSONResultsGenerator(object):
# Check if we have the archived JSON file on the buildbot server.
results_file_url = (self._builder_base_url +
self._build_name + "/" + self.RESULTS_FILENAME)
- logging.error("Local results.json file does not exist. Grabbing "
- "it off the archive at " + results_file_url)
+ _log.error("Local results.json file does not exist. Grabbing "
+ "it off the archive at " + results_file_url)
try:
results_file = urllib2.urlopen(results_file_url)
@@ -177,11 +180,11 @@ class JSONResultsGenerator(object):
try:
results_json = simplejson.loads(old_results)
except:
- logging.debug("results.json was not valid JSON. Clobbering.")
+ _log.debug("results.json was not valid JSON. Clobbering.")
# The JSON file is not valid JSON. Just clobber the results.
results_json = {}
else:
- logging.debug('Old JSON results do not exist. Starting fresh.')
+ _log.debug('Old JSON results do not exist. Starting fresh.')
results_json = {}
return results_json, error
@@ -192,14 +195,14 @@ class JSONResultsGenerator(object):
if error:
# If there was an error don't write a results.json
# file at all as it would lose all the information on the bot.
- logging.error("Archive directory is inaccessible. Not modifying "
- "or clobbering the results.json file: " + str(error))
+ _log.error("Archive directory is inaccessible. Not modifying "
+ "or clobbering the results.json file: " + str(error))
return None
builder_name = self._builder_name
if results_json and builder_name not in results_json:
- logging.debug("Builder name (%s) is not in the results.json file."
- % builder_name)
+ _log.debug("Builder name (%s) is not in the results.json file."
+ % builder_name)
self._convert_json_to_current_version(results_json)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index cdf4071..192307e 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -38,6 +38,9 @@ import sys
import simplejson
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "test_expectations")
+
# Test expectation and modifier constants.
(PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, TIMEOUT, CRASH, SKIP, WONTFIX,
DEFER, SLOW, REBASELINE, MISSING, FLAKY, NOW, NONE) = range(16)
@@ -400,20 +403,20 @@ class TestExpectationsFile:
platform)
if action == NO_CHANGE:
# Save the original line back to the file
- logging.debug('No change to test: %s', line)
+ _log.debug('No change to test: %s', line)
f_new.append(line)
elif action == REMOVE_TEST:
tests_removed += 1
- logging.info('Test removed: %s', line)
+ _log.info('Test removed: %s', line)
elif action == REMOVE_PLATFORM:
parts = line.split(':')
new_options = parts[0].replace(platform.upper() + ' ', '', 1)
new_line = ('%s:%s' % (new_options, parts[1]))
f_new.append(new_line)
tests_updated += 1
- logging.info('Test updated: ')
- logging.info(' old: %s', line)
- logging.info(' new: %s', new_line)
+ _log.info('Test updated: ')
+ _log.info(' old: %s', line)
+ _log.info(' new: %s', new_line)
elif action == ADD_PLATFORMS_EXCEPT_THIS:
parts = line.split(':')
new_options = parts[0]
@@ -430,15 +433,15 @@ class TestExpectationsFile:
new_line = ('%s:%s' % (new_options, parts[1]))
f_new.append(new_line)
tests_updated += 1
- logging.info('Test updated: ')
- logging.info(' old: %s', line)
- logging.info(' new: %s', new_line)
+ _log.info('Test updated: ')
+ _log.info(' old: %s', line)
+ _log.info(' new: %s', new_line)
else:
- logging.error('Unknown update action: %d; line: %s',
- action, line)
+ _log.error('Unknown update action: %d; line: %s',
+ action, line)
- logging.info('Total tests removed: %d', tests_removed)
- logging.info('Total tests updated: %d', tests_updated)
+ _log.info('Total tests removed: %d', tests_removed)
+ _log.info('Total tests updated: %d', tests_updated)
return "".join(f_new)
@@ -633,13 +636,14 @@ class TestExpectationsFile:
build_type = 'DEBUG'
else:
build_type = 'RELEASE'
- logging.error('')
- logging.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" %
- (self._test_platform_name.upper(), build_type))
+ _log.error('')
+ _log.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" %
+ (self._test_platform_name.upper(), build_type))
for error in self._non_fatal_errors:
- logging.error(error)
- logging.error('')
+ _log.error(error)
+ _log.error('')
+
if len(self._errors):
raise SyntaxError('\n'.join(map(str, self._errors)))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
index 3452035..a8f41f3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
@@ -47,6 +47,9 @@ import time
import test_failures
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "test_shell_thread")
+
def process_output(port, test_info, test_types, test_args, target, output_dir,
crash, timeout, test_run_time, actual_checksum,
@@ -79,7 +82,7 @@ def process_output(port, test_info, test_types, test_args, target, output_dir,
failures.append(test_failures.FailureTimeout())
if crash:
- logging.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
+ _log.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
# Strip off "file://" since RelativeTestFilename expects
# filesystem paths.
filename = os.path.join(output_dir, test_info.filename)
@@ -87,8 +90,8 @@ def process_output(port, test_info, test_types, test_args, target, output_dir,
port.maybe_make_directory(os.path.split(filename)[0])
open(filename, "wb").write(error)
elif error:
- logging.debug("Previous test output extra lines after dump:\n%s" %
- error)
+ _log.debug("Previous test output extra lines after dump:\n%s" %
+ error)
# Check the output and save the results.
start_time = time.time()
@@ -242,17 +245,17 @@ class TestShellThread(threading.Thread):
self._start_time = time.time()
self._num_tests = 0
try:
- logging.debug('%s starting' % (self.getName()))
+ _log.debug('%s starting' % (self.getName()))
self._run(test_runner=None, result_summary=None)
- logging.debug('%s done (%d tests)' % (self.getName(),
- self.get_num_tests()))
+ _log.debug('%s done (%d tests)' % (self.getName(),
+ self.get_num_tests()))
except:
# Save the exception for our caller to see.
self._exception_info = sys.exc_info()
self._stop_time = time.time()
# Re-raise it and die.
- logging.error('%s dying: %s' % (self.getName(),
- self._exception_info))
+ _log.error('%s dying: %s' % (self.getName(),
+ self._exception_info))
raise
self._stop_time = time.time()
@@ -275,8 +278,8 @@ class TestShellThread(threading.Thread):
try:
batch_size = int(self._options.batch_size)
except:
- logging.info("Ignoring invalid batch size '%s'" %
- self._options.batch_size)
+ _log.info("Ignoring invalid batch size '%s'" %
+ self._options.batch_size)
# Append tests we're running to the existing tests_run.txt file.
# This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
@@ -286,7 +289,7 @@ class TestShellThread(threading.Thread):
while True:
if self._canceled:
- logging.info('Testing canceled')
+ _log.info('Testing canceled')
tests_run_file.close()
return
@@ -327,12 +330,12 @@ class TestShellThread(threading.Thread):
batch_count = 0
# Print the error message(s).
error_str = '\n'.join([' ' + f.message() for f in failures])
- logging.debug("%s %s failed:\n%s" % (self.getName(),
- self._port.relative_test_filename(filename),
- error_str))
+ _log.debug("%s %s failed:\n%s" % (self.getName(),
+ self._port.relative_test_filename(filename),
+ error_str))
else:
- logging.debug("%s %s passed" % (self.getName(),
- self._port.relative_test_filename(filename)))
+ _log.debug("%s %s passed" % (self.getName(),
+ self._port.relative_test_filename(filename)))
self._result_queue.put((filename, failures))
if batch_size > 0 and batch_count > batch_size:
@@ -379,7 +382,7 @@ class TestShellThread(threading.Thread):
# test_shells too, introducing spurious crashes. We accept that
# tradeoff in order to avoid losing the rest of this thread's
# results.
- logging.error('Test thread hung: killing all test_shells')
+ _log.error('Test thread hung: killing all test_shells')
worker._driver.stop()
try:
@@ -388,8 +391,8 @@ class TestShellThread(threading.Thread):
failures = stats.failures
except AttributeError, e:
failures = []
- logging.error('Cannot get results of test: %s' %
- test_info.filename)
+ _log.error('Cannot get results of test: %s' %
+ test_info.filename)
return failures
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
index 9ff3671..3cf0f5b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
@@ -38,6 +38,8 @@ import sys
import http_server_base
+_log = logging.getLogger("webkitpy.layout_tests.port.apache_http_server")
+
class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
@@ -188,7 +190,7 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
shell=True)
err = self._httpd_proc.stderr.read()
if len(err):
- logging.debug(err)
+ _log.debug(err)
return False
return True
@@ -197,21 +199,21 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
# Stop any currently running servers.
self.stop()
- logging.debug("Starting apache http server")
+ _log.debug("Starting apache http server")
server_started = self.wait_for_action(self._start_httpd_process)
if server_started:
- logging.debug("Apache started. Testing ports")
+ _log.debug("Apache started. Testing ports")
server_started = self.wait_for_action(
self.is_server_running_on_all_ports)
if server_started:
- logging.debug("Server successfully started")
+ _log.debug("Server successfully started")
else:
raise Exception('Failed to start http server')
def stop(self):
"""Stops the apache http server."""
- logging.debug("Shutting down any running http servers")
+ _log.debug("Shutting down any running http servers")
httpd_pid = None
if os.path.exists(self._pid_file):
httpd_pid = int(open(self._pid_file).readline())
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 4648dec..37e5699 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -41,6 +41,8 @@ import base
import http_server
import websocket_server
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium")
+
def check_file_exists(path_to_file, file_description, override_step=None):
"""Verify the file is present where expected or log an error.
@@ -50,11 +52,11 @@ def check_file_exists(path_to_file, file_description, override_step=None):
you're looking for (e.g., "HTTP Server"). Used for error logging.
override_step: An optional string to be logged if the check fails."""
if not os.path.exists(path_to_file):
- logging.error('Unable to find %s' % file_description)
- logging.error(' at %s' % path_to_file)
+ _log.error('Unable to find %s' % file_description)
+ _log.error(' at %s' % path_to_file)
if override_step:
- logging.error(' %s' % override_step)
- logging.error('')
+ _log.error(' %s' % override_step)
+ _log.error('')
return False
return True
@@ -78,7 +80,7 @@ class ChromiumPort(base.Port):
result = (self._check_driver_build_up_to_date(self._options.target)
and result)
else:
- logging.error('')
+ _log.error('')
helper_path = self._path_to_helper()
if helper_path:
@@ -97,9 +99,9 @@ class ChromiumPort(base.Port):
proc = subprocess.Popen([test_shell_binary_path,
'--check-layout-test-sys-deps'])
if proc.wait():
- logging.error('System dependencies check failed.')
- logging.error('To override, invoke with --nocheck-sys-deps')
- logging.error('')
+ _log.error('System dependencies check failed.')
+ _log.error('To override, invoke with --nocheck-sys-deps')
+ _log.error('')
return False
return True
@@ -138,16 +140,16 @@ class ChromiumPort(base.Port):
def start_helper(self):
helper_path = self._path_to_helper()
if helper_path:
- logging.debug("Starting layout helper %s" % helper_path)
+ _log.debug("Starting layout helper %s" % helper_path)
self._helper = subprocess.Popen([helper_path],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None)
is_ready = self._helper.stdout.readline()
if not is_ready.startswith('ready'):
- logging.error("layout_test_helper failed to be ready")
+ _log.error("layout_test_helper failed to be ready")
def stop_helper(self):
if self._helper:
- logging.debug("Stopping layout test helper")
+ _log.debug("Stopping layout test helper")
self._helper.stdin.write("x\n")
self._helper.stdin.close()
self._helper.wait()
@@ -185,11 +187,11 @@ class ChromiumPort(base.Port):
if (debug_mtime > release_mtime and target == 'Release' or
release_mtime > debug_mtime and target == 'Debug'):
- logging.warning('You are not running the most '
- 'recent test_shell binary. You need to '
- 'pass --debug or not to select between '
- 'Debug and Release.')
- logging.warning('')
+ _log.warning('You are not running the most '
+ 'recent test_shell binary. You need to '
+ 'pass --debug or not to select between '
+ 'Debug and Release.')
+ _log.warning('')
# This will fail if we don't have both a debug and release binary.
# That's fine because, in this case, we must already be running the
# most up-to-date one.
@@ -283,8 +285,8 @@ class ChromiumDriver(base.Driver):
if line.startswith("#URL:"):
actual_uri = line.rstrip()[5:]
if uri != actual_uri:
- logging.fatal("Test got out of sync:\n|%s|\n|%s|" %
- (uri, actual_uri))
+ _log.fatal("Test got out of sync:\n|%s|\n|%s|" %
+ (uri, actual_uri))
raise AssertionError("test out of sync")
elif line.startswith("#MD5:"):
actual_checksum = line.rstrip()[5:]
@@ -318,8 +320,8 @@ class ChromiumDriver(base.Driver):
while self._proc.poll() is None and time.time() < timeout:
time.sleep(0.1)
if self._proc.poll() is None:
- logging.warning('stopping test driver timed out, '
- 'killing it')
+ _log.warning('stopping test driver timed out, '
+ 'killing it')
null = open(os.devnull, "w")
subprocess.Popen(["kill", "-9",
str(self._proc.pid)], stderr=null)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index 53df348..435e1e0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -37,6 +37,8 @@ import subprocess
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_linux")
+
class ChromiumLinuxPort(chromium.ChromiumPort):
"""Chromium Linux implementation of the Port class."""
@@ -64,10 +66,10 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
result = self._check_wdiff_install() and result
if not result:
- logging.error('For complete Linux build requirements, please see:')
- logging.error('')
- logging.error(' http://code.google.com/p/chromium/wiki/'
- 'LinuxBuildInstructions')
+ _log.error('For complete Linux build requirements, please see:')
+ _log.error('')
+ _log.error(' http://code.google.com/p/chromium/wiki/'
+ 'LinuxBuildInstructions')
return result
def num_cores(self):
@@ -101,9 +103,9 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
result = chromium.check_file_exists(self._path_to_apache_config_file(),
"apache2 config file") and result
if not result:
- logging.error(' Please install using: "sudo apt-get install '
- 'apache2 libapache2-mod-php5"')
- logging.error('')
+ _log.error(' Please install using: "sudo apt-get install '
+ 'apache2 libapache2-mod-php5"')
+ _log.error('')
return result
def _check_lighttpd_install(self):
@@ -114,17 +116,17 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
result = chromium.check_file_exists(self._path_to_lighttpd_modules(),
"LigHTTPd modules") and result
if not result:
- logging.error(' Please install using: "sudo apt-get install '
- 'lighttpd php5-cgi"')
- logging.error('')
+ _log.error(' Please install using: "sudo apt-get install '
+ 'lighttpd php5-cgi"')
+ _log.error('')
return result
def _check_wdiff_install(self):
result = chromium.check_file_exists(self._path_to_wdiff(), 'wdiff')
if not result:
- logging.error(' Please install using: "sudo apt-get install '
- 'wdiff"')
- logging.error('')
+ _log.error(' Please install using: "sudo apt-get install '
+ 'wdiff"')
+ _log.error('')
return result
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index 1093517..f649001 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -37,6 +37,8 @@ import subprocess
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac")
+
class ChromiumMacPort(chromium.ChromiumPort):
"""Chromium Mac implementation of the Port class."""
@@ -57,10 +59,10 @@ class ChromiumMacPort(chromium.ChromiumPort):
result = chromium.ChromiumPort.check_build(self, needs_http)
result = self._check_wdiff_install() and result
if not result:
- logging.error('For complete Mac build requirements, please see:')
- logging.error('')
- logging.error(' http://code.google.com/p/chromium/wiki/'
- 'MacBuildInstructions')
+ _log.error('For complete Mac build requirements, please see:')
+ _log.error('')
+ _log.error(' http://code.google.com/p/chromium/wiki/'
+ 'MacBuildInstructions')
return result
def num_cores(self):
@@ -96,8 +98,8 @@ class ChromiumMacPort(chromium.ChromiumPort):
try:
rcode = subprocess.call(['wdiff'], stderr=f)
except OSError:
- logging.warning('wdiff not found. Install using MacPorts or some '
- 'other means')
+ _log.warning('wdiff not found. Install using MacPorts or some '
+ 'other means')
pass
f.close()
return True
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 555244c..6d9d120 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -38,6 +38,8 @@ import sys
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_win")
+
class ChromiumWinPort(chromium.ChromiumPort):
"""Chromium Win implementation of the Port class."""
@@ -63,11 +65,11 @@ class ChromiumWinPort(chromium.ChromiumPort):
def check_build(self, needs_http):
result = chromium.ChromiumPort.check_build(self, needs_http)
if not result:
- logging.error('For complete Windows build requirements, please '
- 'see:')
- logging.error('')
- logging.error(' http://dev.chromium.org/developers/how-tos/'
- 'build-instructions-windows')
+ _log.error('For complete Windows build requirements, please '
+ 'see:')
+ _log.error('')
+ _log.error(' http://dev.chromium.org/developers/how-tos/'
+ 'build-instructions-windows')
return result
def get_absolute_path(self, filename):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
index 160668c..cc434bc 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
@@ -43,6 +43,8 @@ import urllib
import factory
import http_server_base
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server")
+
class HttpdNotStarted(Exception):
pass
@@ -205,7 +207,7 @@ class Lighttpd(http_server_base.HttpServerBase):
'cygwin', 'setup_mount.bat')
subprocess.Popen(setup_mount).wait()
- logging.debug('Starting http server')
+ _log.debug('Starting http server')
self._process = subprocess.Popen(start_cmd, env=env)
# Wait for server to start.
@@ -217,7 +219,7 @@ class Lighttpd(http_server_base.HttpServerBase):
if not server_started or self._process.returncode != None:
raise google.httpd_utils.HttpdNotStarted('Failed to start httpd.')
- logging.debug("Server successfully started")
+ _log.debug("Server successfully started")
# TODO(deanm): Find a nicer way to shutdown cleanly. Our log files are
# probably not being flushed, etc... why doesn't our python have os.kill ?
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
index e82943e..387390f 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
@@ -34,6 +34,8 @@ import os
import time
import urllib
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server_base")
+
class HttpServerBase(object):
@@ -63,9 +65,9 @@ class HttpServerBase(object):
try:
response = urllib.urlopen(url)
- logging.debug("Server running at %s" % url)
+ _log.debug("Server running at %s" % url)
except IOError:
- logging.debug("Server NOT running at %s" % url)
+ _log.debug("Server NOT running at %s" % url)
return False
return True
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index e55a78d..fbba4a8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -46,6 +46,9 @@ import base
import webkitpy
from webkitpy import executive
+_log = logging.getLogger("webkitpy.layout_tests.port.mac")
+
+
class MacPort(base.Port):
"""WebKit Mac implementation of the Port class."""
@@ -73,7 +76,7 @@ class MacPort(base.Port):
driver_path = self._path_to_driver()
if not os.path.exists(driver_path):
- logging.error("DumpRenderTree was not found at %s" % driver_path)
+ _log.error("DumpRenderTree was not found at %s" % driver_path)
return False
# This should also validate that the ImageDiff path is valid
@@ -158,7 +161,7 @@ class MacPort(base.Port):
tests_to_skip = []
for filename in self._skipped_file_paths():
if not os.path.exists(filename):
- logging.warn("Failed to open Skipped file: %s" % filename)
+ _log.warn("Failed to open Skipped file: %s" % filename)
continue
skipped_file = file(filename)
tests_to_skip.extend(self._tests_from_skipped_file(skipped_file))
@@ -304,7 +307,7 @@ class MacDriver(base.Driver):
# FIXME: This is a hack around our lack of ImageDiff support for now.
if not self._port._options.no_pixel_tests:
- logging.warn("This port does not yet support pixel tests.")
+ _log.warn("This port does not yet support pixel tests.")
self._port._options.no_pixel_tests = True
#cmd.append('--pixel-tests')
@@ -440,8 +443,8 @@ class MacDriver(base.Driver):
while self._proc.poll() is None and time.time() < timeout:
time.sleep(0.1)
if self._proc.poll() is None:
- logging.warning('stopping test driver timed out, '
- 'killing it')
+ _log.warning('stopping test driver timed out, '
+ 'killing it')
null = open(os.devnull, "w")
subprocess.Popen(["kill", "-9",
str(self._proc.pid)], stderr=null)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
index 0c4146e..b4b3d97 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
@@ -42,6 +42,8 @@ import urllib
import factory
import http_server
+_log = logging.getLogger("webkitpy.layout_tests.port.websocket_server")
+
_WS_LOG_PREFIX = 'pywebsocket.ws.log-'
_WSS_LOG_PREFIX = 'pywebsocket.wss.log-'
@@ -127,7 +129,7 @@ class PyWebSocket(http_server.Lighttpd):
def start(self):
if not self._web_socket_tests:
- logging.info('No need to start %s server.' % self._server_name)
+ _log.info('No need to start %s server.' % self._server_name)
return
if self.is_running():
raise PyWebSocketNotStarted('%s is already running.' %
@@ -166,11 +168,11 @@ class PyWebSocket(http_server.Lighttpd):
handler_map_file = os.path.join(self._web_socket_tests,
'handler_map.txt')
if os.path.exists(handler_map_file):
- logging.debug('Using handler_map_file: %s' % handler_map_file)
+ _log.debug('Using handler_map_file: %s' % handler_map_file)
start_cmd.append('-m')
start_cmd.append(handler_map_file)
else:
- logging.warning('No handler_map_file found')
+ _log.warning('No handler_map_file found')
if self._use_tls:
start_cmd.extend(['-t', '-k', self._private_key,
@@ -192,9 +194,9 @@ class PyWebSocket(http_server.Lighttpd):
env['PYTHONPATH'] = (pywebsocket_base + os.path.pathsep +
env.get('PYTHONPATH', ''))
- logging.debug('Starting %s server on %d.' % (
- self._server_name, self._port))
- logging.debug('cmdline: %s' % ' '.join(start_cmd))
+ _log.debug('Starting %s server on %d.' % (
+ self._server_name, self._port))
+ _log.debug('cmdline: %s' % ' '.join(start_cmd))
self._process = subprocess.Popen(start_cmd, stdout=self._wsout,
stderr=subprocess.STDOUT,
env=env)
@@ -211,7 +213,7 @@ class PyWebSocket(http_server.Lighttpd):
fp = open(output_log)
try:
for line in fp:
- logging.error(line)
+ _log.error(line)
finally:
fp.close()
raise PyWebSocketNotStarted(
@@ -242,7 +244,7 @@ class PyWebSocket(http_server.Lighttpd):
raise PyWebSocketNotFound(
'Failed to find %s server pid.' % self._server_name)
- logging.debug('Shutting down %s server %d.' % (self._server_name, pid))
+ _log.debug('Shutting down %s server %d.' % (self._server_name, pid))
self._port_obj._kill_process(pid)
if self._process:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
index 4604a1a..8beee3b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -59,6 +59,9 @@ from layout_package import test_expectations
from test_types import image_diff
from test_types import text_diff
+_log = logging.getLogger("webkitpy.layout_tests."
+ "rebaseline_chromium_webkit_tests")
+
# Repository type constants.
REPO_SVN, REPO_UNKNOWN = range(2)
@@ -137,11 +140,11 @@ def log_dashed_string(text, platform, logging_level=logging.INFO):
msg = '%s %s %s' % (dashes, msg, dashes)
if logging_level == logging.ERROR:
- logging.error(msg)
+ _log.error(msg)
elif logging_level == logging.WARNING:
- logging.warn(msg)
+ _log.warn(msg)
else:
- logging.info(msg)
+ _log.info(msg)
def setup_html_directory(html_directory):
@@ -163,11 +166,11 @@ def setup_html_directory(html_directory):
os.mkdir(html_directory)
html_directory = os.path.join(html_directory, 'rebaseline_html')
- logging.info('Html directory: "%s"', html_directory)
+ _log.info('Html directory: "%s"', html_directory)
if os.path.exists(html_directory):
shutil.rmtree(html_directory, True)
- logging.info('Deleted file at html directory: "%s"', html_directory)
+ _log.info('Deleted file at html directory: "%s"', html_directory)
if not os.path.exists(html_directory):
os.mkdir(html_directory)
@@ -191,7 +194,7 @@ def get_result_file_fullpath(html_directory, baseline_filename, platform,
base, ext = os.path.splitext(baseline_filename)
result_filename = '%s-%s-%s%s' % (base, platform, result_type, ext)
fullpath = os.path.join(html_directory, result_filename)
- logging.debug(' Result file full path: "%s".', fullpath)
+ _log.debug(' Result file full path: "%s".', fullpath)
return fullpath
@@ -233,9 +236,9 @@ class Rebaseliner(object):
log_dashed_string('Downloading archive', self._platform)
archive_file = self._download_buildbot_archive()
- logging.info('')
+ _log.info('')
if not archive_file:
- logging.error('No archive found.')
+ _log.error('No archive found.')
return False
log_dashed_string('Extracting and adding new baselines',
@@ -246,19 +249,19 @@ class Rebaseliner(object):
log_dashed_string('Updating rebaselined tests in file',
self._platform)
self._update_rebaselined_tests_in_file(backup)
- logging.info('')
+ _log.info('')
if len(self._rebaselining_tests) != len(self._rebaselined_tests):
- logging.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
- 'REBASELINED.')
- logging.warning(' Total tests needing rebaselining: %d',
- len(self._rebaselining_tests))
- logging.warning(' Total tests rebaselined: %d',
- len(self._rebaselined_tests))
+ _log.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
+ 'REBASELINED.')
+ _log.warning(' Total tests needing rebaselining: %d',
+ len(self._rebaselining_tests))
+ _log.warning(' Total tests rebaselined: %d',
+ len(self._rebaselined_tests))
return False
- logging.warning('All tests needing rebaselining were successfully '
- 'rebaselined.')
+ _log.warning('All tests needing rebaselining were successfully '
+ 'rebaselined.')
return True
@@ -285,16 +288,16 @@ class Rebaseliner(object):
self._rebaselining_tests = \
self._test_expectations.get_rebaselining_failures()
if not self._rebaselining_tests:
- logging.warn('No tests found that need rebaselining.')
+ _log.warn('No tests found that need rebaselining.')
return None
- logging.info('Total number of tests needing rebaselining '
- 'for "%s": "%d"', self._platform,
- len(self._rebaselining_tests))
+ _log.info('Total number of tests needing rebaselining '
+ 'for "%s": "%d"', self._platform,
+ len(self._rebaselining_tests))
test_no = 1
for test in self._rebaselining_tests:
- logging.info(' %d: %s', test_no, test)
+ _log.info(' %d: %s', test_no, test)
test_no += 1
return self._rebaselining_tests
@@ -310,7 +313,7 @@ class Rebaseliner(object):
None on failure.
"""
- logging.debug('Url to retrieve revision: "%s"', url)
+ _log.debug('Url to retrieve revision: "%s"', url)
f = urllib.urlopen(url)
content = f.read()
@@ -318,11 +321,11 @@ class Rebaseliner(object):
revisions = re.findall(self.REVISION_REGEX, content)
if not revisions:
- logging.error('Failed to find revision, content: "%s"', content)
+ _log.error('Failed to find revision, content: "%s"', content)
return None
revisions.sort(key=int)
- logging.info('Latest revision: "%s"', revisions[len(revisions) - 1])
+ _log.info('Latest revision: "%s"', revisions[len(revisions) - 1])
return revisions[len(revisions) - 1]
def _get_archive_dir_name(self, platform, webkit_canary):
@@ -339,8 +342,8 @@ class Rebaseliner(object):
if platform in ARCHIVE_DIR_NAME_DICT:
return ARCHIVE_DIR_NAME_DICT[platform]
else:
- logging.error('Cannot find platform key %s in archive '
- 'directory name dictionary', platform)
+ _log.error('Cannot find platform key %s in archive '
+ 'directory name dictionary', platform)
return None
def _get_archive_url(self):
@@ -356,7 +359,7 @@ class Rebaseliner(object):
if not dir_name:
return None
- logging.debug('Buildbot platform dir name: "%s"', dir_name)
+ _log.debug('Buildbot platform dir name: "%s"', dir_name)
url_base = '%s/%s/' % (self._options.archive_url, dir_name)
latest_revision = self._get_latest_revision(url_base)
@@ -364,7 +367,7 @@ class Rebaseliner(object):
return None
archive_url = ('%s%s/layout-test-results.zip' % (url_base,
latest_revision))
- logging.info('Archive url: "%s"', archive_url)
+ _log.info('Archive url: "%s"', archive_url)
return archive_url
def _download_buildbot_archive(self):
@@ -380,7 +383,7 @@ class Rebaseliner(object):
return None
fn = urllib.urlretrieve(url)[0]
- logging.info('Archive downloaded and saved to file: "%s"', fn)
+ _log.info('Archive downloaded and saved to file: "%s"', fn)
return fn
def _extract_and_add_new_baselines(self, archive_file):
@@ -397,17 +400,17 @@ class Rebaseliner(object):
zip_file = zipfile.ZipFile(archive_file, 'r')
zip_namelist = zip_file.namelist()
- logging.debug('zip file namelist:')
+ _log.debug('zip file namelist:')
for name in zip_namelist:
- logging.debug(' ' + name)
+ _log.debug(' ' + name)
platform = self._port.name()
- logging.debug('Platform dir: "%s"', platform)
+ _log.debug('Platform dir: "%s"', platform)
test_no = 1
self._rebaselined_tests = []
for test in self._rebaselining_tests:
- logging.info('Test %d: %s', test_no, test)
+ _log.info('Test %d: %s', test_no, test)
found = False
svn_error = False
@@ -415,14 +418,14 @@ class Rebaseliner(object):
for suffix in BASELINE_SUFFIXES:
archive_test_name = ('layout-test-results/%s-actual%s' %
(test_basename, suffix))
- logging.debug(' Archive test file name: "%s"',
- archive_test_name)
+ _log.debug(' Archive test file name: "%s"',
+ archive_test_name)
if not archive_test_name in zip_namelist:
- logging.info(' %s file not in archive.', suffix)
+ _log.info(' %s file not in archive.', suffix)
continue
found = True
- logging.info(' %s file found in archive.', suffix)
+ _log.info(' %s file found in archive.', suffix)
# Extract new baseline from archive and save it to a temp file.
data = zip_file.read(archive_test_name)
@@ -436,8 +439,8 @@ class Rebaseliner(object):
self._port._chromium_baseline_path(platform),
expected_filename)
expected_fullpath = os.path.normpath(expected_fullpath)
- logging.debug(' Expected file full path: "%s"',
- expected_fullpath)
+ _log.debug(' Expected file full path: "%s"',
+ expected_fullpath)
# TODO(victorw): for now, the rebaselining tool checks whether
# or not THIS baseline is duplicate and should be skipped.
@@ -466,12 +469,12 @@ class Rebaseliner(object):
self._create_html_baseline_files(expected_fullpath)
if not found:
- logging.warn(' No new baselines found in archive.')
+ _log.warn(' No new baselines found in archive.')
else:
if svn_error:
- logging.warn(' Failed to add baselines to SVN.')
+ _log.warn(' Failed to add baselines to SVN.')
else:
- logging.info(' Rebaseline succeeded.')
+ _log.info(' Rebaseline succeeded.')
self._rebaselined_tests.append(test)
test_no += 1
@@ -509,8 +512,8 @@ class Rebaseliner(object):
if fallback_fullpath.lower() != baseline_path.lower():
if not self._diff_baselines(new_baseline,
fallback_fullpath):
- logging.info(' Found same baseline at %s',
- fallback_fullpath)
+ _log.info(' Found same baseline at %s',
+ fallback_fullpath)
return True
else:
return False
@@ -531,8 +534,8 @@ class Rebaseliner(object):
ext1 = os.path.splitext(file1)[1].upper()
ext2 = os.path.splitext(file2)[1].upper()
if ext1 != ext2:
- logging.warn('Files to compare have different ext. '
- 'File1: %s; File2: %s', file1, file2)
+ _log.warn('Files to compare have different ext. '
+ 'File1: %s; File2: %s', file1, file2)
return True
if ext1 == '.PNG':
@@ -582,13 +585,13 @@ class Rebaseliner(object):
backup_file = ('%s.orig.%s' % (path, date_suffix))
if os.path.exists(backup_file):
os.remove(backup_file)
- logging.info('Saving original file to "%s"', backup_file)
+ _log.info('Saving original file to "%s"', backup_file)
os.rename(path, backup_file)
f = open(path, "w")
f.write(new_expectations)
f.close()
else:
- logging.info('No test was rebaselined so nothing to remove.')
+ _log.info('No test was rebaselined so nothing to remove.')
def _svn_add(self, filename):
"""Add the file to SVN repository.
@@ -607,7 +610,7 @@ class Rebaseliner(object):
parent_dir, basename = os.path.split(filename)
if self._repo_type != REPO_SVN or parent_dir == filename:
- logging.info("No svn checkout found, skip svn add.")
+ _log.info("No svn checkout found, skip svn add.")
return True
original_dir = os.getcwd()
@@ -616,12 +619,12 @@ class Rebaseliner(object):
os.chdir(original_dir)
output = status_output.upper()
if output.startswith('A') or output.startswith('M'):
- logging.info(' File already added to SVN: "%s"', filename)
+ _log.info(' File already added to SVN: "%s"', filename)
return True
if output.find('IS NOT A WORKING COPY') >= 0:
- logging.info(' File is not a working copy, add its parent: "%s"',
- parent_dir)
+ _log.info(' File is not a working copy, add its parent: "%s"',
+ parent_dir)
return self._svn_add(parent_dir)
os.chdir(parent_dir)
@@ -629,19 +632,19 @@ class Rebaseliner(object):
os.chdir(original_dir)
output = add_output.upper().rstrip()
if output.startswith('A') and output.find(basename.upper()) >= 0:
- logging.info(' Added new file: "%s"', filename)
+ _log.info(' Added new file: "%s"', filename)
self._svn_prop_set(filename)
return True
if (not status_output) and (add_output.upper().find(
'ALREADY UNDER VERSION CONTROL') >= 0):
- logging.info(' File already under SVN and has no change: "%s"',
- filename)
+ _log.info(' File already under SVN and has no change: "%s"',
+ filename)
return True
- logging.warn(' Failed to add file to SVN: "%s"', filename)
- logging.warn(' Svn status output: "%s"', status_output)
- logging.warn(' Svn add output: "%s"', add_output)
+ _log.warn(' Failed to add file to SVN: "%s"', filename)
+ _log.warn(' Svn status output: "%s"', status_output)
+ _log.warn(' Svn add output: "%s"', add_output)
return False
def _svn_prop_set(self, filename):
@@ -667,7 +670,7 @@ class Rebaseliner(object):
else:
cmd = ['svn', 'pset', 'svn:eol-style', 'LF', basename]
- logging.debug(' Set svn prop: %s', ' '.join(cmd))
+ _log.debug(' Set svn prop: %s', ' '.join(cmd))
run_shell(cmd, False)
os.chdir(original_dir)
@@ -689,14 +692,14 @@ class Rebaseliner(object):
baseline_filename, self._platform,
'new')
shutil.copyfile(baseline_fullpath, new_file)
- logging.info(' Html: copied new baseline file from "%s" to "%s".',
- baseline_fullpath, new_file)
+ _log.info(' Html: copied new baseline file from "%s" to "%s".',
+ baseline_fullpath, new_file)
# Get the old baseline from SVN and save to the html directory.
output = run_shell(['svn', 'cat', '-r', 'BASE', baseline_fullpath])
if (not output) or (output.upper().rstrip().endswith(
'NO SUCH FILE OR DIRECTORY')):
- logging.info(' No base file: "%s"', baseline_fullpath)
+ _log.info(' No base file: "%s"', baseline_fullpath)
return
base_file = get_result_file_fullpath(self._options.html_directory,
baseline_filename, self._platform,
@@ -704,8 +707,8 @@ class Rebaseliner(object):
f = open(base_file, 'wb')
f.write(output)
f.close()
- logging.info(' Html: created old baseline file: "%s".',
- base_file)
+ _log.info(' Html: created old baseline file: "%s".',
+ base_file)
# Get the diff between old and new baselines and save to the html dir.
if baseline_filename.upper().endswith('.TXT'):
@@ -721,7 +724,7 @@ class Rebaseliner(object):
else:
parent_dir = sys.path[0] # tempdir is not secure.
bogus_dir = os.path.join(parent_dir, "temp_svn_config")
- logging.debug(' Html: temp config dir: "%s".', bogus_dir)
+ _log.debug(' Html: temp config dir: "%s".', bogus_dir)
if not os.path.exists(bogus_dir):
os.mkdir(bogus_dir)
delete_bogus_dir = True
@@ -737,13 +740,13 @@ class Rebaseliner(object):
f = open(diff_file, 'wb')
f.write(output)
f.close()
- logging.info(' Html: created baseline diff file: "%s".',
- diff_file)
+ _log.info(' Html: created baseline diff file: "%s".',
+ diff_file)
if delete_bogus_dir:
shutil.rmtree(bogus_dir, True)
- logging.debug(' Html: removed temp config dir: "%s".',
- bogus_dir)
+ _log.debug(' Html: removed temp config dir: "%s".',
+ bogus_dir)
class HtmlGenerator(object):
@@ -803,7 +806,7 @@ class HtmlGenerator(object):
def generate_html(self):
"""Generate html file for rebaselining result comparison."""
- logging.info('Generating html file')
+ _log.info('Generating html file')
html_body = ''
if not self._rebaselining_tests:
@@ -814,29 +817,29 @@ class HtmlGenerator(object):
test_no = 1
for test in tests:
- logging.info('Test %d: %s', test_no, test)
+ _log.info('Test %d: %s', test_no, test)
html_body += self._generate_html_for_one_test(test)
html = self.HTML_REBASELINE % ({'time': time.asctime(),
'body': html_body})
- logging.debug(html)
+ _log.debug(html)
f = open(self._html_file, 'w')
f.write(html)
f.close()
- logging.info('Baseline comparison html generated at "%s"',
- self._html_file)
+ _log.info('Baseline comparison html generated at "%s"',
+ self._html_file)
def show_html(self):
"""Launch the rebaselining html in brwoser."""
- logging.info('Launching html: "%s"', self._html_file)
+ _log.info('Launching html: "%s"', self._html_file)
html_uri = self._port.filename_to_uri(self._html_file)
webbrowser.open(html_uri, 1)
- logging.info('Html launched.')
+ _log.info('Html launched.')
def _generate_baseline_links(self, test_basename, suffix, platform):
"""Generate links for baseline results (old, new and diff).
@@ -851,18 +854,18 @@ class HtmlGenerator(object):
"""
baseline_filename = '%s-expected%s' % (test_basename, suffix)
- logging.debug(' baseline filename: "%s"', baseline_filename)
+ _log.debug(' baseline filename: "%s"', baseline_filename)
new_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform, 'new')
- logging.info(' New baseline file: "%s"', new_file)
+ _log.info(' New baseline file: "%s"', new_file)
if not os.path.exists(new_file):
- logging.info(' No new baseline file: "%s"', new_file)
+ _log.info(' No new baseline file: "%s"', new_file)
return ''
old_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform, 'old')
- logging.info(' Old baseline file: "%s"', old_file)
+ _log.info(' Old baseline file: "%s"', old_file)
if suffix == '.png':
html_td_link = self.HTML_TD_LINK_IMG
else:
@@ -874,7 +877,7 @@ class HtmlGenerator(object):
'uri': self._port.filename_to_uri(old_file),
'name': baseline_filename}
else:
- logging.info(' No old baseline file: "%s"', old_file)
+ _log.info(' No old baseline file: "%s"', old_file)
links += self.HTML_TD_NOLINK % ''
links += html_td_link % {'uri': self._port.filename_to_uri(new_file),
@@ -883,12 +886,12 @@ class HtmlGenerator(object):
diff_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform,
'diff')
- logging.info(' Baseline diff file: "%s"', diff_file)
+ _log.info(' Baseline diff file: "%s"', diff_file)
if os.path.exists(diff_file):
links += html_td_link % {'uri': self._port.filename_to_uri(
diff_file), 'name': 'Diff'}
else:
- logging.info(' No baseline diff file: "%s"', diff_file)
+ _log.info(' No baseline diff file: "%s"', diff_file)
links += self.HTML_TD_NOLINK % ''
return links
@@ -904,13 +907,13 @@ class HtmlGenerator(object):
"""
test_basename = os.path.basename(os.path.splitext(test)[0])
- logging.info(' basename: "%s"', test_basename)
+ _log.info(' basename: "%s"', test_basename)
rows = []
for suffix in BASELINE_SUFFIXES:
if suffix == '.checksum':
continue
- logging.info(' Checking %s files', suffix)
+ _log.info(' Checking %s files', suffix)
for platform in self._platforms:
links = self._generate_baseline_links(test_basename, suffix,
platform)
@@ -919,7 +922,7 @@ class HtmlGenerator(object):
suffix)
row += self.HTML_TD_NOLINK % platform
row += links
- logging.debug(' html row: %s', row)
+ _log.debug(' html row: %s', row)
rows.append(self.HTML_TR % row)
@@ -929,7 +932,7 @@ class HtmlGenerator(object):
test)
html += self.HTML_TEST_DETAIL % ' '.join(rows)
- logging.debug(' html for test: %s', html)
+ _log.debug(' html for test: %s', html)
return self.HTML_TABLE_TEST % html
return ''
@@ -996,13 +999,13 @@ def main():
# Verify 'platforms' option is valid
if not options.platforms:
- logging.error('Invalid "platforms" option. --platforms must be '
- 'specified in order to rebaseline.')
+ _log.error('Invalid "platforms" option. --platforms must be '
+ 'specified in order to rebaseline.')
sys.exit(1)
platforms = [p.strip().lower() for p in options.platforms.split(',')]
for platform in platforms:
if not platform in REBASELINE_PLATFORM_ORDER:
- logging.error('Invalid platform: "%s"' % (platform))
+ _log.error('Invalid platform: "%s"' % (platform))
sys.exit(1)
# Adjust the platform order so rebaseline tool is running at the order of
@@ -1021,7 +1024,7 @@ def main():
for platform in rebaseline_platforms:
rebaseliner = Rebaseliner(port_obj, platform, options)
- logging.info('')
+ _log.info('')
log_dashed_string('Rebaseline started', platform)
if rebaseliner.run(backup):
# Only need to backup one original copy of test expectation file.
@@ -1032,7 +1035,7 @@ def main():
rebaselining_tests |= set(rebaseliner.get_rebaselining_tests())
- logging.info('')
+ _log.info('')
log_dashed_string('Rebaselining result comparison started', None)
html_generator = HtmlGenerator(port_obj,
options,
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 042e791..1c139af 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -73,6 +73,8 @@ from test_types import text_diff
import port
+_log = logging.getLogger("webkitpy.layout_tests.run_webkit_tests")
+
# Indicates that we want detailed progress updates in the output (prints
# directory-by-directory feedback).
LOG_DETAILED_PROGRESS = 'detailed-progress'
@@ -198,13 +200,13 @@ class TestRunner:
self._current_test_number = 0
def __del__(self):
- logging.debug("flushing stdout")
+ _log.debug("flushing stdout")
sys.stdout.flush()
- logging.debug("flushing stderr")
+ _log.debug("flushing stderr")
sys.stderr.flush()
- logging.debug("stopping http server")
+ _log.debug("stopping http server")
self._port.stop_http_server()
- logging.debug("stopping websocket server")
+ _log.debug("stopping websocket server")
self._port.stop_websocket_server()
def gather_file_paths(self, paths):
@@ -274,7 +276,7 @@ class TestRunner:
test_size = int(chunk_len)
assert(test_size > 0)
except:
- logging.critical("invalid chunk '%s'" % chunk_value)
+ _log.critical("invalid chunk '%s'" % chunk_value)
sys.exit(1)
# Get the number of tests
@@ -633,7 +635,7 @@ class TestRunner:
retry_summary = result_summary
while (retries < self.NUM_RETRY_ON_UNEXPECTED_FAILURE and
len(failures)):
- logging.debug("Retrying %d unexpected failure(s)" % len(failures))
+ _log.debug("Retrying %d unexpected failure(s)" % len(failures))
retries += 1
retry_summary = ResultSummary(self._expectations, failures.keys())
self._run_tests(failures.keys(), retry_summary)
@@ -871,8 +873,8 @@ class TestRunner:
individual_test_timings: list of test times (used by the flakiness
dashboard).
"""
- logging.debug("Writing JSON files in %s." %
- self._options.results_directory)
+ _log.debug("Writing JSON files in %s." %
+ self._options.results_directory)
unexpected_file = open(os.path.join(self._options.results_directory,
"unexpected_results.json"), "w")
unexpected_file.write(simplejson.dumps(unexpected_results,
@@ -894,7 +896,7 @@ class TestRunner:
BUILDER_BASE_URL, individual_test_timings,
self._expectations, result_summary, self._test_files_list)
- logging.debug("Finished writing JSON files.")
+ _log.debug("Finished writing JSON files.")
def _print_expected_results_of_type(self, write, result_summary,
result_type, result_type_str):
@@ -1346,7 +1348,7 @@ def read_test_files(files):
def create_logging_writer(options, log_option):
- """Returns a write() function that will write the string to logging.info()
+ """Returns a write() function that will write the string to _log.info()
if comp was specified in --log or if --verbose is true. Otherwise the
message is dropped.
@@ -1356,7 +1358,7 @@ def create_logging_writer(options, log_option):
to be logged (e.g., 'actual' or 'expected')
"""
if options.verbose or log_option in options.log.split(","):
- return logging.info
+ return _log.info
return lambda str: 1
@@ -1500,7 +1502,7 @@ def main(options, args):
port_obj.stop_helper()
- logging.debug("Exit status: %d" % has_new_failures)
+ _log.debug("Exit status: %d" % has_new_failures)
sys.exit(has_new_failures)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
index 89dd192..f232d23 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
@@ -39,6 +39,8 @@ import shutil
from layout_package import test_failures
from test_types import test_type_base
+_log = logging.getLogger("webkitpy.layout_tests.test_types.fuzzy_image_diff")
+
class FuzzyImageDiff(test_type_base.TestTypeBase):
@@ -55,7 +57,7 @@ class FuzzyImageDiff(test_type_base.TestTypeBase):
expected_png_file = self._port.expected_filename(filename, '.png')
if test_args.show_sources:
- logging.debug('Using %s' % expected_png_file)
+ _log.debug('Using %s' % expected_png_file)
# Also report a missing expected PNG file.
if not os.path.isfile(expected_png_file):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
index 94c3467..42928ba 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
@@ -46,6 +46,8 @@ from test_types import test_type_base
_compare_available = True
_compare_msg_printed = False
+_log = logging.getLogger("webkitpy.layout_tests.test_types.image_diff")
+
class ImageDiff(test_type_base.TestTypeBase):
@@ -133,8 +135,8 @@ class ImageDiff(test_type_base.TestTypeBase):
expected_png_file = self._port.expected_filename(filename, '.png')
if test_args.show_sources:
- logging.debug('Using %s' % expected_hash_file)
- logging.debug('Using %s' % expected_png_file)
+ _log.debug('Using %s' % expected_hash_file)
+ _log.debug('Using %s' % expected_png_file)
try:
expected_hash = open(expected_hash_file, "r").read()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
index efa2e8c..60f50a3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
@@ -37,6 +37,8 @@ import errno
import logging
import os.path
+_log = logging.getLogger("webkitpy.layout_tests.test_types.test_type_base")
+
class TestArguments(object):
"""Struct-like wrapper for additional arguments needed by
@@ -109,7 +111,7 @@ class TestTypeBase(object):
self._port.maybe_make_directory(output_dir)
output_path = os.path.join(output_dir, output_file)
- logging.debug('writing new baseline to "%s"' % (output_path))
+ _log.debug('writing new baseline to "%s"' % (output_path))
open(output_path, "wb").write(data)
def output_filename(self, filename, modifier):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
index 54b332b..0eabc5c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -40,6 +40,8 @@ import os.path
from layout_package import test_failures
from test_types import test_type_base
+_log = logging.getLogger("webkitpy.layout_tests.test_types.text_diff")
+
def is_render_tree_dump(data):
"""Returns true if data appears to be a render tree dump as opposed to a
@@ -63,7 +65,7 @@ class TestTextDiff(test_type_base.TestTypeBase):
# Read the port-specific expected text.
expected_filename = self._port.expected_filename(filename, '.txt')
if show_sources:
- logging.debug('Using %s' % expected_filename)
+ _log.debug('Using %s' % expected_filename)
return self.get_normalized_text(expected_filename)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list