Bugzilla – Attachment 57551 Details for
Bug 17638
t/db_dependent/Search.t is failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml
Bug-17638-Make-sure-tdbdependentSearcht-doesnt-use.patch (text/plain), 4.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-11-16 14:42:38 UTC
(
hide
)
Description:
Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-11-16 14:42:38 UTC
Size:
4.75 KB
patch
obsolete
>From 8943d7b6529d2f8ceeb314a6877e2f71421145a6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 16 Nov 2016 11:40:21 -0300 >Subject: [PATCH] Bug 17638: Make sure t/db_dependent/Search.t doesn't use a > cached koha-conf.xml > >This patch makes the tests clean the 'config' namespace for cache before >it runs any tests. > >To test: >- Run: > $ prove t/db_dependent/Search.t >=> FAIL: Self explanatory >- Apply the patch >- Run: > $ prove t/db_dependent/Search.t >=> SUCCESS: All green >- Sign off :-D >--- > t/db_dependent/Search.t | 27 ++++++++++++++++++--------- > 1 file changed, 18 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index f051655..d62256d 100644 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -29,11 +29,16 @@ use open ':std', ':encoding(utf8)'; > > use Test::More tests => 4; > use Test::MockModule; >+use Test::Warn; >+use t::lib::Mocks; >+ >+use Koha::Caches; >+ > use MARC::Record; > use File::Spec; > use File::Basename; > use File::Find; >-use Test::Warn; >+ > use File::Temp qw/ tempdir /; > use File::Path; > >@@ -47,21 +52,21 @@ sub index_sample_records_and_launch_zebra { > unlink("$datadir/zebra.log"); > if (-f "$sourcedir/${marc_type}/zebraexport/biblio/exported_records") { > 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 iso2709 -d biblios init"); >- 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"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal -g iso2709 -d biblios init"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal -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"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal -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 -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"); >- system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal,warn -g iso2709 -d authorities update $sourcedir/${marc_type}/zebraexport/authority"); >- system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal,warn -g iso2709 -d authorities commit"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal -g iso2709 -d authorities init"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal -g iso2709 -d authorities update $sourcedir/${marc_type}/zebraexport/authority"); >+ system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal -g iso2709 -d authorities commit"); > } > > $child = fork(); >@@ -199,6 +204,8 @@ sub run_marc21_search_tests { > $datadir = tempdir(); > system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21 $indexing_mode"); > >+ Koha::Caches->get_instance('config')->flush_all; >+ > mock_GetMarcSubfieldStructure('marc21'); > my $context = new C4::Context("$datadir/etc/koha-conf.xml"); > $context->set_context(); >@@ -860,6 +867,8 @@ sub run_unimarc_search_tests { > $datadir = tempdir(); > system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc $indexing_mode"); > >+ Koha::Caches->get_instance('config')->flush_all; >+ > mock_GetMarcSubfieldStructure('unimarc'); > my $context = new C4::Context("$datadir/etc/koha-conf.xml"); > $context->set_context(); >-- >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 17638
:
57529
|
57551
|
57552
|
57568
|
57575