[tor-bugs] #33797 [Core Tor/sbws]: Provide better logging for unit test runs in sbws

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 2 13:30:35 UTC 2020


#33797: Provide better logging for unit test runs in sbws
-------------------------------+--------------------
     Reporter:  gk             |      Owner:  (none)
         Type:  enhancement    |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/sbws  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 When I tried to figure out why my patch for #33009 did suddenly stall some
 unit test I got confused as I assumed all the log statements in the code
 would be shown during the test run. That is I thought I could be sure that
 logging output not shown meant the code paths were not touched. I was
 wrong.

 Even though some DEBUG logs are shown during the test run this does not
 hold for every DEBUG log (the former are available thanks to `caplog`
 fixture in some tests).

 I think it is worth getting this confusion fixed e.g. by providing an easy
 knob to tune the debug output for tests to the needs of the dev. One thing
 juga pointed out to me is creating a `pytest.ini` file in the root of the
 project containing something like
 {{{
 [pytest]
 log_cli=true
 log_cli_level=DEBUG
 }}}
 which would show debug output for all tests.

 Additionally, we should write some documentation explaining these things.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33797>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list