Bugzilla – Attachment 134411 Details for
Bug 27344
Implement Elastic's update_index_background using Koha::BackgroundJob
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27344: Fix tests
Bug-27344-Fix-tests.patch (text/plain), 2.68 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-04-29 17:23:59 UTC
(
hide
)
Description:
Bug 27344: Fix tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-04-29 17:23:59 UTC
Size:
2.68 KB
patch
obsolete
>From 229c9b6ba9cc6e42b83cc46fa5ad320655b689e8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Apr 2022 14:33:05 +0200 >Subject: [PATCH] Bug 27344: Fix tests > >--- > .../Koha/SearchEngine/Elasticsearch/Indexer.t | 22 ++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >index 42e9266c9b..70e6ab073d 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >@@ -91,7 +91,11 @@ subtest 'index_records() tests' => sub { > my $mock_index = Test::MockModule->new("Koha::SearchEngine::Elasticsearch::Indexer"); > $mock_index->mock( update_index => sub { > my ($self, $record_ids, $records) = @_; >- warn $record_ids->[0] . $records->[0]->as_usmarc; >+ warn "Update " . $record_ids->[0] . $records->[0]->as_usmarc; >+ }); >+ $mock_index->mock( update_index_background => sub { >+ my ($self, $record_ids) = @_; >+ warn "Update background " . $record_ids->[0]; > }); > > my $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => 'authorities' }); >@@ -101,13 +105,21 @@ subtest 'index_records() tests' => sub { > MARC::Field->new('001', '1234567'), > MARC::Field->new('100', '', '', 'a' => 'Rosenstock, Jeff'), > ); >- warning_is{ $indexer->index_records([42],'specialUpdate','authorityserver',[$marc_record]); } "42".$marc_record->as_usmarc, >- "When passing record and ids to index_records they are correctly passed through to update_index"; >+ warning_is { >+ $indexer->index_records( [42], 'specialUpdate', 'authorityserver', >+ [$marc_record] ); >+ } >+ "Update 42" . $marc_record->as_usmarc, >+ "When passing record and ids to index_records they are correctly passed through to update_index"; > > $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => 'biblios' }); > $marc_record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblio->biblionumber, embed_items => 1 }); >- warning_is{ $indexer->index_records([$biblio->biblionumber],'specialUpdate','biblioserver'); } $biblio->biblionumber.$marc_record->as_usmarc, >- "When passing id only to index_records the marc record is fetched and passed through to update_index"; >+ warning_is { >+ $indexer->index_records( [ $biblio->biblionumber ], >+ 'specialUpdate', 'biblioserver' ); >+ } >+ "Update background " . $biblio->biblionumber, >+ "When passing id only to index_records the marc record is fetched and passed through to update_index"; > }; > > } >-- >2.34.1
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 27344
:
114877
|
116252
|
116931
|
132444
|
132445
|
132446
|
132586
|
132609
|
132610
|
132611
|
132612
|
132613
|
132645
|
132646
|
132794
|
132795
|
132796
|
132797
|
132798
|
132843
|
132844
|
132845
|
132969
|
132970
|
132994
|
132995
|
133033
|
134406
|
134407
|
134408
|
134409
|
134410
| 134411 |
134412
|
134413