[Bug 41719] New: Add rendering test coverage for Labels and Patroncards
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 Bug ID: 41719 Summary: Add rendering test coverage for Labels and Patroncards Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: chris.nighswonger@veritassuperaitsolutions.com QA Contact: testopia@bugs.koha-community.org 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_LL.... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 --- Comment #1 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- Created attachment 192076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192076&action=edit 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) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |chris.nighswonger@veritassu | |peraitsolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #2 from Owen Leonard <oleonard@myacpl.org> ---
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? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41717 --- Comment #3 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- (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! Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41717 [Bug 41717] Update PDF::Reuse and PDF::Reuse::Barcode to the latest version -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org