WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
204484
_log.info() not showing up on webkitpy tests
https://bugs.webkit.org/show_bug.cgi?id=204484
Summary
_log.info() not showing up on webkitpy tests
Simon Fraser (smfr)
Reported
2019-11-21 17:44:42 PST
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
Comment 1
2019-11-21 17:51:57 PST
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)
Comment 2
2019-11-21 18:28:12 PST
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)
Comment 3
2019-11-21 18:29:08 PST
For example try adding some print statements in PorTest.test_diff_text()
Jonathan Bedard
Comment 4
2019-11-21 18:47:24 PST
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug