https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41918 --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198261 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198261&action=edit Bug 41918: (QA follow-up) Add unit tests for Koha::Reports->running Adds a 'running' subtest covering the new method: - Returns a Koha::Reports resultset (object identity, not opaque ids). - Returns an empty resultset when nothing is in flight, and when the user_id / report_id filter does not match any process. - Parses saved_sql.id markers out of synthetic processlist rows and resolves them to real Koha::Report objects, ignoring rows without the marker. - Sends parameterised LIKE binds for user_id (proves the WHERE clause is built without string interpolation). - Falls back to an empty resultset and does not propagate the exception when the underlying selectall_arrayref call dies, eg. when the database user lacks PROCESS privilege. To make the failure path mockable without trying to mock DBI::db (which is not loadable as a separate file), the dbh selectall is extracted into a tiny Koha::Reports::_processlist_rows helper so Test::MockModule can replace it cleanly. The helper is otherwise behaviour-preserving. Test plan: 1) prove t/db_dependent/Koha/Reports.t -> 11 tests, all pass. 2) Existing prep_report subtest still passes. -- You are receiving this mail because: You are watching all bug changes.