Bug 204484
| Summary: | _log.info() not showing up on webkitpy tests | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
| Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ap, jbedard, simon.fraser |
| Priority: | P2 | ||
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Simon Fraser (smfr)
test-webkitpy disables logging:
_log.info("Suppressing most webkitpy logging while running unit tests.")
handler.addFilter(testing_filter)
so it's impossible to debug tests.
--verbose needs to re-enable logging.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Jonathan Bedard
You're going to need to be a bit more specific about which tests you're dealing with.
I suspect you're struggling with some of our tests which capture stdout and stderr....which I think has proven to be a bad design choice over time, but it's not the sort of thing we can dedicate time to unraveling at the moment.
Simon Fraser (smfr)
I'm writing new tests and trying to use 'print' or _log.info() in them, but all that output is dropped.
Printer.configure() explicitly filters this output:
# Filter out most webkitpy messages.
#
# Messages can be selectively re-enabled for this script by updating
# this method accordingly.
def filter_records(record):
"""Filter out autoinstall and non-third-party webkitpy messages."""
# FIXME: Figure out a way not to use strings here, for example by
# using syntax like webkitpy.test.__name__. We want to be
# sure not to import any non-Python 2.4 code, though, until
# after the version-checking code has executed.
if (record.name.startswith("webkitpy.common.system.autoinstall") or
record.name.startswith("webkitpy.test")):
return True
if record.name.startswith("webkitpy"):
return False
return True
testing_filter = logging.Filter()
testing_filter.filter = filter_records
# Display a message so developers are not mystified as to why
# logging does not work in the unit tests.
_log.info("Suppressing most webkitpy logging while running unit tests.")
handler.addFilter(testing_filter)
I want --verbose (or another flag) to remove this filtering.
Simon Fraser (smfr)
For example try adding some print statements in PorTest.test_diff_text()
Jonathan Bedard
It does weird things with newlines, but when I do:
....
def test_diff_text(self):
print '\n\nfoo'
port = self.make_port()
# Make sure that we don't run into decoding exceptions when the
# filenames are unicode, with regular or malformed input (expected or
# actual input is always raw bytes, not unicode).
...
I see:
Skipping QueueStatusServer tests; the Google AppEngine Python SDK is not installed.
Suppressing most webkitpy logging while running unit tests.
Skipping tests in the following modules or packages because they are really, really, slow:
webkitpy.common.checkout.scm.scm_unittest
(https://bugs.webkit.org/show_bug.cgi?id=31818; use --all to include)
[619/1932] webkitpy.performance_tests.perftest_unittest.TestPerfTest.test_parse_output_with_detailed_info passed
foo
Ran 1932 tests in 7.581s
OK
I still think this bug stands though, because you're definitely right about info logging.