Bugzilla – Attachment 126479 Details for
Bug 25030
IncludeSeeFromInSearches not honoured in Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25030: (QA follow-up) Fix tests
Bug-25030-QA-follow-up-Fix-tests.patch (text/plain), 3.52 KB, created by
Nick Clemens (kidclamp)
on 2021-10-19 10:37:58 UTC
(
hide
)
Description:
Bug 25030: (QA follow-up) Fix tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-19 10:37:58 UTC
Size:
3.52 KB
patch
obsolete
>From 8f60e2ba1e5f35ed403541d215803d6d6dae2bfd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 19 Oct 2021 10:34:38 +0000 >Subject: [PATCH] Bug 25030: (QA follow-up) Fix tests > >Fluid is not a valid value for cxn_pool - valid values are: >Sniff,Static,NoPing > >AddAuthority call calls index - the indexing call was trying to access >the ES server with mocked values and dying when they were invalid > >This patch uses a correct value for cxn_pool and inserts directly into DB >to avoid indexing >--- > t/db_dependent/Koha/SearchEngine/Elasticsearch.t | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index 53a236a49d..78d0c4e331 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -29,7 +29,7 @@ use MARC::Record; > use Try::Tiny; > use List::Util qw( any ); > >-use C4::AuthoritiesMarc; >+use C4::AuthoritiesMarc qw( AddAuthority ); > > use Koha::SearchEngine::Elasticsearch; > use Koha::SearchEngine::Elasticsearch::Search; >@@ -98,16 +98,16 @@ subtest '_read_configuration() tests' => sub { > is( $configuration->{cxn_pool}, 'Static', 'cxn_pool configuration set correctly to Static if not specified' ); > is_deeply( $configuration->{nodes}, \@servers , 'Server configuration parsed correctly' ); > >- t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid' } ); >+ t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Sniff' } ); > > $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; >- is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' ); >+ is( $configuration->{cxn_pool}, 'Sniff', 'cxn_pool configuration parsed correctly' ); > isnt( defined $configuration->{trace_to}, 'trace_to is not defined if not set' ); > > my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params; > is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' ); > >- t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid', trace_to => 'Stderr' } ); >+ t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Sniff', trace_to => 'Stderr' } ); > > $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; > is( $configuration->{trace_to}, 'Stderr', 'trace_to configuration parsed correctly' ); >@@ -858,6 +858,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents with Inclu > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('IncludeSeeFromInSearches', '1'); >+ my $dbh = C4::Context->dbh; > > my $builder = t::lib::TestBuilder->new; > my $auth_type = $builder->build_object({ >@@ -871,7 +872,8 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents with Inclu > MARC::Field->new(150, '', '', a => 'Foo'), > MARC::Field->new(450, '', '', a => 'Bar'), > ); >- my $authid = AddAuthority($authority_record, undef, $auth_type->authtypecode); >+ $dbh->do( "INSERT INTO auth_header (datecreated,marcxml) values (NOW(),?)", undef, ($authority_record->as_xml_record('MARC21') ) ); >+ my $authid = $dbh->last_insert_id( undef, undef, 'auth_header', 'authid' ); > > my @mappings = ( > { >-- >2.20.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 25030
:
113415
|
118144
|
121001
|
121036
|
126426
|
126427
| 126479