Bugzilla – Attachment 24731 Details for
Bug 11096
Koha cannot retrieve big records from Zebra
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11096: (follow-up) add direct regression tests
Bug-11096-follow-up-add-direct-regression-tests.patch (text/plain), 4.44 KB, created by
Tomás Cohen Arazi
on 2014-01-25 14:27:41 UTC
(
hide
)
Description:
Bug 11096: (follow-up) add direct regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2014-01-25 14:27:41 UTC
Size:
4.44 KB
patch
obsolete
>From b4386065fac674623681f1f7070fc2205638d8ee Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 9 Dec 2013 23:39:07 +0000 >Subject: [PATCH] Bug 11096: (follow-up) add direct regression tests > >This adds direct tests of indexing and retrieving >bib records that are larger than the ISO2709 limit >of 99,999 octets. > >To test: verify that prove -v t/db_dependent/Search.t passes. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Search.t | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index 1233c97..3fbea30 100644 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -12,7 +12,7 @@ use YAML; > use C4::Debug; > require C4::Context; > >-use Test::More tests => 224; >+use Test::More tests => 232; > use Test::MockModule; > use MARC::Record; > use File::Spec; >@@ -41,6 +41,12 @@ sub index_sample_records_and_launch_zebra { > system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio"); > system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios commit"); > } >+ # ... and add large bib records, if present >+ if (-f "$sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}/exported_records.xml") { >+ my $zebra_bib_cfg = ($indexing_mode eq 'dom') ? 'zebra-biblios-dom.cfg' : 'zebra-biblios.cfg'; >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g marcxml -d biblios update $sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g marcxml -d biblios commit"); >+ } > if (-f "$sourcedir/${marc_type}/zebraexport/authority/exported_records") { > my $zebra_auth_cfg = ($indexing_mode eq 'dom') ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg'; > system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal,warn -g iso2709 -d authorities init"); >@@ -227,7 +233,11 @@ sub run_marc21_search_tests { > '020' => { > 'sfs' => { 'a' => [ [ 'biblioitems', 'isbn' ] ] }, > 'list' => [ [ 'a', 'biblioitems', 'isbn' ] ] >- } >+ }, >+ '500' => { >+ 'sfs' => { 'a' => [ [ 'biblioitems', 'notes' ] ] }, >+ 'list' => [ [ 'a', 'biblioitems', 'notes' ] ] >+ }, > } > ); > return \%hash; >@@ -499,7 +509,7 @@ sub run_marc21_search_tests { > $stopwords_removed, $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); > > ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); >- is($results_hashref->{biblioserver}->{hits}, 179, "getRecords on _ALLRECORDS PQF returned all records"); >+ is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records"); > > ( $error, $query, $simple_query, $query_cgi, > $query_desc, $limit, $limit_cgi, $limit_desc, >@@ -775,6 +785,15 @@ sub run_marc21_search_tests { > ); > is($count, 1, 'MARC21 authorities: one hit on match contains "æ²å£«åäºå¨å»å§" (QP)'); > >+ # retrieve records that are larger than the MARC limit of 99,999 octets >+ ( undef, $results_hashref, $facets_loop ) = >+ getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); >+ is($results_hashref->{biblioserver}->{hits}, 1, "can do a search that retrieves an over-large bib record (bug 11096)"); >+ @newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, >+ $results_hashref->{'biblioserver'}->{"RECORDS"}); >+ is($newresults[0]->{title}, 'Marc the Large Record', 'able to render over-large bib record (bug 11096)'); >+ is($newresults[0]->{biblionumber}, '300', 'able to render over-large bib record (bug 11096)'); >+ like($newresults[0]->{notes}, qr/This is large note #550/, 'able to render over-large bib record (bug 11096)'); > > cleanup(); > } >-- >1.8.3.2
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 11096
:
22291
|
22292
|
22821
|
22845
|
22846
|
22997
|
23030
|
23033
|
23234
|
23235
|
23236
|
23237
|
23336
|
23337
|
23366
|
24019
|
24020
|
24029
|
24030
|
24031
|
24172
|
24186
|
24187
|
24188
|
24490
|
24491
|
24492
|
24580
|
24602
|
24603
|
24604
|
24605
|
24607
|
24731
|
24732
|
24874
|
24894
|
24895
|
24896
|
24901
|
25282
|
25634
|
25635
|
25636