From e47aa16ebbc2784553d1f9f2042d59653970aea7 Mon Sep 17 00:00:00 2001 From: Lee Jamison Date: Fri, 25 Aug 2017 07:18:15 -0400 Subject: [PATCH] Bug 18897: Koha_Elasticsearch_Indexer.t doesn't skip when ES module(s) not installed If Catmandu::Importer::MARC is not installed, Koha_Elasticsearch_Indexer.t fails instead of skipping. It should skip as ES is not currently mandatory. Test Plan: 1. Run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t" as koha-shell 2. Note failure on test 1/5 indicating module not installed. 3. Apply patch. 4. Re-run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t" 5. Note test now skips. Signed-off-by: Mark Tompsett Signed-off-by: Lee Jamison --- t/db_dependent/Koha_Elasticsearch_Indexer.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha_Elasticsearch_Indexer.t b/t/db_dependent/Koha_Elasticsearch_Indexer.t index 9a525bf..1cb3a7d 100644 --- a/t/db_dependent/Koha_Elasticsearch_Indexer.t +++ b/t/db_dependent/Koha_Elasticsearch_Indexer.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 6; +use Test::More; use Test::MockModule; use t::lib::Mocks; @@ -27,6 +27,15 @@ use Koha::Database; my $schema = Koha::Database->schema(); +eval { require Koha::SearchEngine::Elasticsearch::Indexer; }; +if ( $@ ) { + my $es_dep_msg = "Required module Catmandu::Importer::MARC is not installed"; + plan( skip_all => $es_dep_msg ); +} +else { + plan tests => 6; +} + use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); my $indexer; -- 2.1.4