Bugzilla – Attachment 110772 Details for
Bug 26543
Elasticsearch - Importing biblios with multiple items can cause incorrect index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26543: Unit tests
Bug-26543-Unit-tests.patch (text/plain), 2.79 KB, created by
Nick Clemens (kidclamp)
on 2020-09-25 18:54:01 UTC
(
hide
)
Description:
Bug 26543: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-09-25 18:54:01 UTC
Size:
2.79 KB
patch
obsolete
>From 567c387cec9b7c3e442ffa285ca420762aa0ea50 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 25 Sep 2020 18:52:09 +0000 >Subject: [PATCH] Bug 26543: Unit tests > >--- > t/db_dependent/Koha/SearchEngine/Indexer.t | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Indexer.t b/t/db_dependent/Koha/SearchEngine/Indexer.t >index 4515d69f8d..49b6d31315 100755 >--- a/t/db_dependent/Koha/SearchEngine/Indexer.t >+++ b/t/db_dependent/Koha/SearchEngine/Indexer.t >@@ -19,6 +19,7 @@ use C4::AuthoritiesMarc; > use C4::Biblio; > use C4::Circulation; > use Koha::Database; >+use Koha::SearchEngine::Elasticsearch; > use Koha::SearchEngine::Indexer; > > use t::lib::TestBuilder; >@@ -58,13 +59,13 @@ subtest 'Test indexer object creation' => sub { > }; > > subtest 'Test indexer calls' => sub { >- plan tests => 24; >+ plan tests => 32; > > my @engines = ('Zebra'); > eval { Koha::SearchEngine::Elasticsearch->get_elasticsearch_params; }; > push @engines, 'Elasticsearch' unless $@; > SKIP: { >- skip 'Elasticsearch configuration not available', 12 >+ skip 'Elasticsearch configuration not available', 16 > if scalar @engines == 1; > } > >@@ -74,6 +75,8 @@ subtest 'Test indexer calls' => sub { > > my $biblionumber1 = $builder->build_sample_biblio()->biblionumber; > my $biblionumber2 = $builder->build_sample_biblio()->biblionumber; >+ my $marcbiblio1 = GetMarcBiblio({biblionumber => $biblionumber1}); >+ my $marcbiblio2 = GetMarcBiblio({biblionumber => $biblionumber2}); > > my $mock_zebra = Test::MockModule->new("Koha::SearchEngine::Zebra::Indexer"); > $mock_zebra->mock( ModZebra => sub { warn "ModZebra"; } ); >@@ -149,6 +152,22 @@ subtest 'Test indexer calls' => sub { > DelBiblio( $biblio->biblionumber, { skip_record_index =>1 }); > } undef, "index_records is not called for $engine when calling DelBiblio if skip_record_index passed"; > >+ warnings_are{ >+ AddBiblio($marcbiblio1,""); >+ } [$engine, "C4::Biblio"], "index_records is called for $engine when calling AddBiblio"; >+ my $new_bib_num; >+ warnings_are{ >+ $new_bib_num = AddBiblio($marcbiblio2,"",{skip_record_index=>1}); >+ } undef, "index_records is not called for $engine when calling AddBiblio if skip_record_index passed"; >+ >+ warnings_are{ >+ ModBiblioMarc($marcbiblio2,$new_bib_num,""); >+ } [$engine, "C4::Biblio"], "index_records is called for $engine when calling ModBiblioMarc"; >+ warnings_are{ >+ ModBiblioMarc($marcbiblio2,$new_bib_num,"",{skip_record_index=>1}); >+ } undef, "index_records is not called for $engine when calling ModBiblioMarc if skip_record_index passed"; >+ >+ > } > > }; >-- >2.11.0
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 26543
:
110771
| 110772