The label and patron card rendering code paths in C4::Labels::Label and C4::Patroncards::Patroncard lack test coverage for their core drawing methods. This patch adds: - t/db_dependent/Labels/t_Label.t - Extends existing tests with subtests for: - draw_label_text() - text positioning and formatting - draw_guide_box() - guide box rendering - barcode() - all supported barcode types (CODE39, COOP2OF5, INDUSTRIAL2OF5, EAN13) - create_label() - printing type orchestration (BIB, BAR, BIBBAR, BARBIB) - t/db_dependent/Patroncards/t_Patroncard.t - New test file covering: - draw_guide_box() and draw_guide_grid() - draw_text() with patron data substitution - draw_barcode() with multiple barcode types - draw_image() with generated test image - End-to-end PDF output validation Tests use t::lib::TestBuilder fixtures and transaction rollback for isolation. AI Disclosure: This contribution was developed with AI assistance (Claude Opus 4.5, Anthropic). See commit message for full disclosure per https://wiki.koha-community.org/wiki/Coding_Guidelines#.5BDRAFT.5D_AI_and_LLM-assisted_contributions.
Created attachment 192076 [details] [review] Bug 41719: Add rendering test coverage for Labels and Patroncards Extends t/db_dependent/Labels/t_Label.t with subtests for: - draw_label_text() structure validation - draw_guide_box() PDF stream output - All supported barcode types (CODE39, CODE39MOD, CODE39MOD10, COOP2OF5, INDUSTRIAL2OF5, EAN13) - create_label() printing type orchestration (BIB/BAR/BIBBAR/BARBIB) Creates t/db_dependent/Patroncards/t_Patroncard.t with subtests for: - draw_guide_box(), draw_guide_grid(), draw_text() - draw_barcode(), draw_image() - End-to-end PDF output AI Assistance: Claude Opus 4.5 drafted test code and debugged a PDF::Reuse issue (GitHub cnighswonger/PDF-Reuse#24, fixed in 0.43). Human author directed the approach, rejected initial implementation that merely exercised PDF::Reuse rather than Koha code, reviewed all changes, and verified tests pass. Assisted-by: Claude Opus 4.5 (Anthropic)
> prove t/db_dependent/Labels/t_Label.t t/db_dependent/Labels/t_Label.t .. 4/11 # Failed test 'PDF with barcodes has content' # at t/db_dependent/Labels/t_Label.t line 258. # Looks like you failed 1 test of 7. # Failed test 'barcode() generates all supported barcode types' # at t/db_dependent/Labels/t_Label.t line 259. # Looks like you failed 1 test of 11. Is there a reason why this problem might be on my end?
(In reply to Owen Leonard from comment #2) > > prove t/db_dependent/Labels/t_Label.t > > t/db_dependent/Labels/t_Label.t .. 4/11 > # Failed test 'PDF with barcodes has content' > # at t/db_dependent/Labels/t_Label.t line 258. > # Looks like you failed 1 test of 7. > > # Failed test 'barcode() generates all supported barcode types' > # at t/db_dependent/Labels/t_Label.t line 259. > # Looks like you failed 1 test of 11. > > Is there a reason why this problem might be on my end? Hey Owen, Could you confirm your system's version of PDF::Reuse? perl -MPDF::Reuse -e 'print $PDF::Reuse::VERSION, "\n" Bug 41717 needs to be applied first (or you need to cpanm PDF::Reuse@0.43 in your test container). I apologize, but I should have made this bug depend on 41717. Doing that now. Thanks!