The logger testing module is handy, but having a diag option to output all log lines currently sitting in the logger object would be helpful. This would aid in later debugging.
Created attachment 176120 [details] [review] Bug 38818: Add diag option to t::lib::Mocks::Logger This patch adds a diag method to the Mocks::Logger object. This aids in debugging logging errors by simply outputting all log lines to screen in a diag statement.
Created attachment 176125 [details] [review] Bug 38818: Add diag option to t::lib::Mocks::Logger This patch adds a diag method to the Mocks::Logger object. This aids in debugging logging errors by simply outputting all log lines to screen in a diag statement.
Created attachment 176126 [details] [review] Bug 38818: Add diag option to t::lib::Mocks::Logger This patch adds a diag method to the Mocks::Logger object. This aids in debugging logging errors by simply outputting all log lines to screen in a diag statement.
This is tested nicely using bug 38689.. just uncomment the `#$logger->debug()` lines added to the unit tests in that bug and run the tests to see the pretty output this produces
Created attachment 176385 [details] [review] Bug 38818: Add diag option to t::lib::Mocks::Logger This patch adds a diag method to the Mocks::Logger object. This aids in debugging logging errors by simply outputting all log lines to screen in a diag statement. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
1) Unit tests I think this was referring to testing the functionality, not unit tests? (In reply to Martin Renvoize (ashimema) from comment #4) > This is tested nicely using bug 38689.. just uncomment the > `#$logger->debug()` lines added to the unit tests in that bug and run the > tests to see the pretty output this produces Could you please write some tests to cover the new method? 2) Typo I was going to fix inline, but so we don't forget: FAIL t/lib/Mocks/Logger.pm FAIL spelling recieved ==> received
Created attachment 178357 [details] [review] Bug 38818: Add diag option to t::lib::Mocks::Logger This patch adds a diag method to the Mocks::Logger object. This aids in debugging logging errors by simply outputting all log lines to screen in a diag statement. Sponsored-by: PTFS Europe <https://ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 178358 [details] [review] Bug 38818: Unit tests Add unit tests for the updated mock module Sponsored-by: PTFS Europe <https://ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Unit tests added for Mocking module
Pushed for 25.05! Well done everyone, thank you!
Pushed to 24.11.x for 24.11.08 Enhancement backported to ease the backports of test suite patches during LTS life