Bugzilla – Attachment 189713 Details for
Bug 41271
pod_coverage.t skips over files that fail silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41271: Make pod_coverage.t die verbosely instead of silently
Bug-41271-Make-podcoveraget-die-verbosely-instead-.patch (text/plain), 1.53 KB, created by
Pedro Amorim
on 2025-11-19 16:17:20 UTC
(
hide
)
Description:
Bug 41271: Make pod_coverage.t die verbosely instead of silently
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-11-19 16:17:20 UTC
Size:
1.53 KB
patch
obsolete
>From 25ed9f3e4149ee312a93573444f5eb4c5099fbea Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 19 Nov 2025 15:27:33 +0000 >Subject: [PATCH] Bug 41271: Make pod_coverage.t die verbosely instead of > silently > >To test, ktd: >1) Rollback to commit before bug 37893: > git reset --hard 3f59557d2ac >2) Apply this patch >3) Reset: > reset_all >4) Run the pod_coverage.t test: > prove -v /kohadevbox/koha/xt/author/pod_coverage.t > >You get error: >"Module died while loading 'C4::SIP::SIPServer': Could not find pod_coverage.xml in /kohadevbox/koha/xt/author. >--- > xt/author/pod_coverage.t | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/xt/author/pod_coverage.t b/xt/author/pod_coverage.t >index 8430a12c4cb..e59cd203dbd 100755 >--- a/xt/author/pod_coverage.t >+++ b/xt/author/pod_coverage.t >@@ -43,6 +43,21 @@ sub check_pod_coverage { > $package_name =~ s|/|::|g; > $package_name =~ s|\.pm$||; > >- my $coverage = Pod::Coverage->new( package => $package_name ); >+ # 1) Try loading the package manually >+ my $require_path = $file; >+ $require_path =~ s|::|/|g; # convert back just in case >+ my $error; >+ >+ eval { require $require_path; }; >+ if ($@) { >+ return "Module died while loading '$package_name': $@"; >+ } >+ >+ # 2) Now safely ask Pod::Coverage >+ my $coverage = eval { Pod::Coverage->new( package => $package_name ); }; >+ if ($@) { >+ return "Pod::Coverage died for '$package_name': $@"; >+ } >+ > return $coverage->uncovered; > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41271
: 189713