Bugzilla – Attachment 69093 Details for
Bug 19581
Elasticsearch - Catmandu split option adds extra null fields to indexes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19581: Unit tests
Bug-19581-Unit-tests.patch (text/plain), 2.44 KB, created by
David Bourgault
on 2017-11-10 20:32:26 UTC
(
hide
)
Description:
Bug 19581: Unit tests
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-11-10 20:32:26 UTC
Size:
2.44 KB
patch
obsolete
>From 62fd077f65c202bb77567d830a9eabe3a4f18bff Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sun, 5 Nov 2017 01:47:49 +0000 >Subject: [PATCH] Bug 19581: Unit tests > >This patch makes a few changes to the tests to take into account the >change to indexing. > >To test: >prove t/db_dependent/Koha_Elasticsearch_Indexer.t >Should return green > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >--- > t/db_dependent/Koha_Elasticsearch_Indexer.t | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Koha_Elasticsearch_Indexer.t b/t/db_dependent/Koha_Elasticsearch_Indexer.t >index 9a525bf..7ad9e21 100644 >--- a/t/db_dependent/Koha_Elasticsearch_Indexer.t >+++ b/t/db_dependent/Koha_Elasticsearch_Indexer.t >@@ -60,7 +60,7 @@ SKIP: { > > subtest '_convert_marc_to_json() tests' => sub { > >- plan tests => 2; >+ plan tests => 4; > > $schema->storage->txn_begin; > >@@ -113,12 +113,23 @@ subtest '_convert_marc_to_json() tests' => sub { > MARC::Field->new( '110', '', '', 'a' => 'Corp Author' ), > MARC::Field->new( '245', '', '', 'a' => 'Title' ), > ); >- my @records = ( $marc_record ); >+ my $marc_record_2 = MARC::Record->new(); >+ $marc_record_2->append_fields( >+ MARC::Field->new( '001', '1234567' ), >+ MARC::Field->new( '020', '', '', 'a' => '1234567890123' ), >+ MARC::Field->new( '100', '', '', 'a' => 'Author' ), >+ MARC::Field->new( '245', '', '', 'a' => 'Title' ), >+ ); >+ my @records = ( $marc_record, $marc_record_2 ); >+ >+ my $importer = Koha::SearchEngine::Elasticsearch::Indexer->new({ index => 'biblios' })->_convert_marc_to_json( \@records ); >+ my $conv = $importer->next(); >+ is( $conv->{author}[0], "Author", "First mapped author should be 100a"); >+ is( $conv->{author}[1], "Corp Author", "Second mapped author should be 110a"); > >- my $importer = Koha::SearchEngine::Elasticsearch::Indexer->new({ index => 'biblios' }); >- my $conv = $importer->_convert_marc_to_json( \@records )->next(); >- is( $conv->{author}[0][0], "Author", "First mapped author should be 100a"); >- is( $conv->{author}[1][0], "Corp Author", "Second mapped author should be 110a"); >+ $conv = $importer->next(); >+ is( $conv->{author}[0], "Author", "First mapped author should be 100a"); >+ is( scalar @{$conv->{author}} , 1, "We should map field only if exists, shouldn't add extra nulls"); > > $schema->storage->txn_rollback; > }; >-- >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 19581
:
68947
|
68948
|
68949
|
69092
|
69093
|
72745
|
72767
|
72997
|
73864
|
73865
|
73866
|
73867
|
73896