Trivial enhancement
Created attachment 146727 [details] [review] Bug 32979: Add Test::Exception to Logger.t Test plan: Run t/Logger.t Note: Run under koha user, not root. Root wont have the permission failure which is tested. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Ready for QA
Created attachment 146728 [details] [review] Bug 32979: Add Test::Exception to Logger.t Test plan: Run t/Logger.t Note: Run under koha user, not root. Root wont have the permission failure which is tested. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tests fail on a freshly created koha testing docker: root@kohadevbox:koha(bug32979-qa)$ prove t/Logger.t t/Logger.t .. # Failed test 'Logger did not init correctly without permission' # at t/Logger.t line 51. # expecting: Regexp ((?^u:Permission denied)) # found: normal exit # Looks like you failed 1 test of 10. t/Logger.t .. 1/1 # Failed test 'Test01 -- Simple tests for Koha::Logger' # at t/Logger.t line 73. # Looks like you failed 1 test of 1. t/Logger.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/Logger.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.17 cusr 0.01 csys = 0.20 CPU) Result: FAIL
(In reply to Kyle M Hall from comment #4) > Tests fail on a freshly created koha testing docker: > > root@kohadevbox:koha(bug32979-qa)$ prove t/Logger.t > t/Logger.t .. > # Failed test 'Logger did not init correctly without permission' > # at t/Logger.t line 51. > # expecting: Regexp ((?^u:Permission denied)) > # found: normal exit > # Looks like you failed 1 test of 10. > t/Logger.t .. 1/1 > # Failed test 'Test01 -- Simple tests for Koha::Logger' > # at t/Logger.t line 73. > # Looks like you failed 1 test of 1. > t/Logger.t .. Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/1 subtests > > Test Summary Report > ------------------- > t/Logger.t (Wstat: 256 Tests: 1 Failed: 1) > Failed test: 1 > Non-zero exit status: 1 > Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.17 cusr 0.01 > csys = 0.20 CPU) > Result: FAIL root@kohadevbox:koha(bug32979-qa)$ prove t/Logger.t You should not run this test as ROOT !
See commit message ;)
(In reply to Marcel de Rooy from comment #6) > See commit message ;) ah!
Created attachment 146844 [details] [review] Bug 32979: Add Test::Exception to Logger.t Test plan: Run t/Logger.t Note: Run under koha user, not root. Root wont have the permission failure which is tested. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 146845 [details] [review] Bug 32979: Skip test if running as root Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Many hands makes light work, thankyou everyone! Pushed to 22.11.x for the next release
Backported to 22.05.x for upcoming 22.05.11
applied to 21.11 for 21.11.19
Not backported to 21.05.x