Bugzilla – Attachment 67555 Details for
Bug 18897
Elastic related tests do not skip when ES modules are not installed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18897: Use Module::Load::Conditional::can_load
Bug-18897-Use-ModuleLoadConditionalcanload.patch (text/plain), 1.86 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-10-03 14:19:35 UTC
(
hide
)
Description:
Bug 18897: Use Module::Load::Conditional::can_load
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-10-03 14:19:35 UTC
Size:
1.86 KB
patch
obsolete
>From a315979293c24bd18cbe31cb7a054b664d6e00f6 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 1 Sep 2017 14:15:44 -0400 >Subject: [PATCH] Bug 18897: Use Module::Load::Conditional::can_load > >Rather than rely on eval(), Jonathan Druart recommended in >comment #6 to use Use Module::Load::Conditional::can_load. >This addresses that concern. > >TEST PLAN >--------- >$ git fetch >$ git checkout -b bug_18897 origin/master >$ git bz apply 18897 >$ sudo apt-get remove libcatmandu-store-elasticsearch-perl >... >$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t >-- Note that the message says the correct library is missing. >$ sudo apt-get install libcatmandu-store-elasticsearch-perl >-- Note it runs as expected. >run the koha qa test tools > >Signed-off-by: Lee Jamison <ldjamison@marywood.edu> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha_Elasticsearch_Indexer.t | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha_Elasticsearch_Indexer.t b/t/db_dependent/Koha_Elasticsearch_Indexer.t >index ea65517..3f3b7a7 100644 >--- a/t/db_dependent/Koha_Elasticsearch_Indexer.t >+++ b/t/db_dependent/Koha_Elasticsearch_Indexer.t >@@ -17,6 +17,7 @@ > > use Modern::Perl; > >+use Module::Load::Conditional qw[can_load check_install requires]; > use Test::More; > use Test::MockModule; > use t::lib::Mocks; >@@ -27,10 +28,11 @@ use Koha::Database; > > my $schema = Koha::Database->schema(); > >-eval { require Koha::SearchEngine::Elasticsearch::Indexer; }; >-if ( $@ ) { >+if ( ! can_load( >+ modules => { 'Koha::SearchEngine::Elasticsearch::Indexer' => undef, } ) >+) { > my $missing_module; >- if ( $@ =~ /Can\'t locate (.*?) / ) { >+ if ( $Module::Load::Conditional::ERROR =~ /Can\'t locate (.*?) / ) { > $missing_module = $1; > } > my $es_dep_msg = "Required module $missing_module is not installed"; >-- >2.7.4
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 18897
:
64818
|
66478
|
66479
|
66568
|
66569
|
66777
|
66779
|
67521
|
67522
|
67523
|
67539
|
67540
|
67553
|
67554
| 67555 |
67556
|
67557