Bugzilla – Attachment 110355 Details for
Bug 24807
Add "year" type to improve sorting by publication date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24807: (QA follow-up) Remove uneccessary tests
Bug-24807-QA-follow-up-Remove-uneccessary-tests.patch (text/plain), 2.66 KB, created by
Nick Clemens (kidclamp)
on 2020-09-18 10:37:43 UTC
(
hide
)
Description:
Bug 24807: (QA follow-up) Remove uneccessary tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-09-18 10:37:43 UTC
Size:
2.66 KB
patch
obsolete
>From 376e3a64b5a1017c9dd031f8749a6fb50868cab9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 18 Sep 2020 10:35:43 +0000 >Subject: [PATCH] Bug 24807: (QA follow-up) Remove uneccessary tests > >These tests fail now, the code expects a real response from ES in Indexer.pm >but these tests mock 'bulk' and so don't have the necessary fields. > >We are testing the same code above and can just add the _id == biblionumber test >--- > .../Koha/SearchEngine/Elasticsearch/Indexer.t | 31 +++------------------- > 1 file changed, 3 insertions(+), 28 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >index b05a15eec7..0b610bd79c 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 2; > use Test::MockModule; > use t::lib::Mocks; > >@@ -30,7 +30,7 @@ my $schema = Koha::Database->schema(); > use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); > > subtest 'create_index() tests' => sub { >- plan tests => 5; >+ plan tests => 6; > my $se = Test::MockModule->new( 'Koha::SearchEngine::Elasticsearch' ); > $se->mock( '_read_configuration', sub { > my ($self, $sub ) = @_; >@@ -63,6 +63,7 @@ subtest 'create_index() tests' => sub { > my $response = $indexer->update_index([1], $records); > is( $response->{errors}, 0, "no error on update_index" ); > is( scalar(@{$response->{items}}), 1, "1 item indexed" ); >+ is( $response->{items}[0]->{index}->{_id},"1", "We should get a string matching the bibnumber passed in"); > > is( > $indexer->drop_index(), >@@ -70,29 +71,3 @@ subtest 'create_index() tests' => sub { > 'Dropping the index' > ); > }; >- >- >-subtest 'update_index() tests' => sub { >- plan tests => 2; >- my $kse = Test::MockModule->new( 'Koha::SearchEngine::Elasticsearch' ); >- $kse->mock( 'marc_records_to_documents', sub { >- my ($self, $params ) = @_; >- return [1]; >- }); >- >- my $indexer; >- ok( >- $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => 'biblios' }), >- 'Creating a new indexer object' >- ); >- >- my $searcher = $indexer->get_elasticsearch(); >- my $se = Test::MockModule->new( ref $searcher ); >- $se->mock( 'bulk', sub { >- my ($self, %params ) = @_; >- return $params{body}; >- }); >- >- my $bibnumber_array = $indexer->update_index([13],["faked"]); >- is( $bibnumber_array->[0]->{index}->{_id},"13", "We should get a string matching the bibnumber"); >-}; >-- >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 24807
:
100170
|
100171
|
100176
|
102547
|
102548
|
103084
|
103085
|
103086
|
103087
|
103163
|
103277
|
104525
|
104526
|
104527
|
104528
|
104529
|
104530
|
104531
|
106768
|
108382
|
108383
|
108384
|
108385
|
108386
|
108387
|
108388
|
108389
|
109997
|
109998
|
109999
|
110000
|
110001
|
110002
|
110003
|
110004
| 110355 |
110884