Bugzilla – Attachment 94109 Details for
Bug 13937
Add an Elasticsearch-compatible Z39.50/SRU daemon
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13937: (QA follow-up) Make tests work with YAZ 4 and 5.
Bug-13937-QA-follow-up-Make-tests-work-with-YAZ-4-.patch (text/plain), 4.94 KB, created by
Ere Maijala
on 2019-10-15 06:40:04 UTC
(
hide
)
Description:
Bug 13937: (QA follow-up) Make tests work with YAZ 4 and 5.
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2019-10-15 06:40:04 UTC
Size:
4.94 KB
patch
obsolete
>From 9ff2400a919bb1cf169a378ad6eb738e2c410a2f Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Tue, 15 Oct 2019 09:39:42 +0300 >Subject: [PATCH] Bug 13937: (QA follow-up) Make tests work with YAZ 4 and 5. > >Also makes add_item_status tests more robust by clearing the cache after modifying authorised values. >--- > t/db_dependent/Koha/Z3950Responder/GenericSession.t | 12 ++++++++---- > t/db_dependent/Koha/Z3950Responder/Session2.t | 8 +++++++- > t/db_dependent/Koha/Z3950Responder/config.xml | 2 +- > 3 files changed, 16 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Koha/Z3950Responder/GenericSession.t b/t/db_dependent/Koha/Z3950Responder/GenericSession.t >index b8d9013826..2ee1aeaec3 100644 >--- a/t/db_dependent/Koha/Z3950Responder/GenericSession.t >+++ b/t/db_dependent/Koha/Z3950Responder/GenericSession.t >@@ -7,6 +7,7 @@ use Test::WWW::Mechanize; > use t::lib::Mocks qw(mock_preference); > > use File::Basename; >+use File::Copy; > use XML::LibXML; > use YAML; > use ZOOM; >@@ -81,10 +82,13 @@ subtest 'test_search' => sub { > $child = fork(); > if ($child == 0) { > my $config_dir = dirname(__FILE__) . '/'; >+ # Copy pqf.properties from etc/z3950 >+ copy($config_dir . '../../../../etc/z3950/pqf.properties', $config_dir . 'pqf.properties') || die "Copying pqf.properties failed: $!"; > my $z = Koha::Z3950Responder->new( { > config_dir => $config_dir > }); > $z->start(); >+ unlink($config_dir . 'pqf.properties'); > exit; > } > sleep(1); >@@ -116,21 +120,21 @@ subtest 'test_search' => sub { > > # SRU protocol tests > my $base = 'http://localhost:42111'; >- my $ns = 'http://docs.oasis-open.org/ns/search-ws/sruResponse'; >+ my $ns = 'http://www.loc.gov/zing/srw/'; > my $marc_ns = 'http://www.loc.gov/MARC21/slim'; > my $agent = Test::WWW::Mechanize->new( autocheck => 1 ); > >- $agent->get_ok("$base", 'Retrieve explain response'); >+ $agent->get_ok("$base?version=1.1", 'Retrieve explain response'); > my $dom = XML::LibXML->load_xml(string => $agent->content()); > my @nodes = $dom->getElementsByTagNameNS($ns, 'explainResponse'); > is(scalar(@nodes), 1, 'explainResponse returned'); > >- $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&maximumRecords=10&query=", 'Try bad search query'); >+ $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=", 'Try bad search query'); > $dom = XML::LibXML->load_xml(string => $agent->content()); > @nodes = $dom->getElementsByTagNameNS($ns, 'diagnostics'); > is(scalar(@nodes), 1, 'diagnostics returned for bad query'); > >- $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&maximumRecords=10&query=(dc.author%3dauthor AND (dc.title%3d\"title(s)\" OR dc.title%3danother))", 'Retrieve search results'); >+ $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=(dc.author%3dauthor AND (dc.title%3d\"title(s)\" OR dc.title%3danother))", 'Retrieve search results'); > $dom = XML::LibXML->load_xml(string => $agent->content()); > @nodes = $dom->getElementsByTagNameNS($ns, 'searchRetrieveResponse'); > is(scalar(@nodes), 1, 'searchRetrieveResponse returned'); >diff --git a/t/db_dependent/Koha/Z3950Responder/Session2.t b/t/db_dependent/Koha/Z3950Responder/Session2.t >index 073889b050..7cb4eb1ef2 100644 >--- a/t/db_dependent/Koha/Z3950Responder/Session2.t >+++ b/t/db_dependent/Koha/Z3950Responder/Session2.t >@@ -5,6 +5,8 @@ use Test::More tests => 3; > use t::lib::TestBuilder; > use C4::Items; > >+use Koha::Caches; >+ > BEGIN { > use_ok('Koha::Z3950Responder'); > use_ok('Koha::Z3950Responder::Session'); >@@ -20,7 +22,7 @@ subtest 'add_item_status' => sub { > plan tests => 2; > > # This time we are sustituting some values >- $builder->schema->resultset( 'AuthorisedValue' )->delete_all; >+ $builder->schema->resultset( 'AuthorisedValue' )->delete_all(); > $builder->build({ > source => 'AuthorisedValue', > value => { >@@ -37,6 +39,10 @@ subtest 'add_item_status' => sub { > lib => "Borked completely" > } > }); >+ >+ # Clear the cache to make sure the above values take effect >+ my $cache = Koha::Caches->get_instance(); >+ $cache->flush_all(); > > ## FIRST ITEM HAS ALL THE STATUSES ## > my $item_1 = $builder->build({ >diff --git a/t/db_dependent/Koha/Z3950Responder/config.xml b/t/db_dependent/Koha/Z3950Responder/config.xml >index 68587d9653..2b47aa3d33 100644 >--- a/t/db_dependent/Koha/Z3950Responder/config.xml >+++ b/t/db_dependent/Koha/Z3950Responder/config.xml >@@ -1,7 +1,7 @@ > <yazgfs> > <listen id="public">tcp:localhost:42111</listen> > <server> >- <cql2rpn>../../../../etc/z3950/pqf.properties</cql2rpn> >+ <cql2rpn>pqf.properties</cql2rpn> > <explain xmlns="http://explain.z3950.org/dtd/2.0/"> > <retrievalinfo> > <retrieval syntax="usmarc" name="marc21"/> >-- >2.17.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 13937
:
46369
|
47417
|
47418
|
47419
|
53503
|
58122
|
58125
|
58126
|
59443
|
59444
|
60735
|
60736
|
60737
|
60738
|
66943
|
66944
|
66945
|
66946
|
69139
|
82562
|
82563
|
82564
|
82565
|
82566
|
82567
|
82589
|
82590
|
82591
|
82592
|
82593
|
82594
|
82595
|
82660
|
82661
|
82662
|
82663
|
82664
|
82665
|
82666
|
82667
|
83780
|
83781
|
83782
|
83783
|
83784
|
83785
|
83786
|
83787
|
83788
|
83789
|
83951
|
83952
|
83953
|
83954
|
83955
|
83956
|
83957
|
83958
|
83959
|
84050
|
84051
|
84052
|
84053
|
84054
|
84055
|
84056
|
84057
|
84058
|
84059
|
84062
|
84063
|
84064
|
84065
|
84066
|
84067
|
84068
|
84069
|
84072
|
84073
|
85112
|
86353
|
86354
|
86355
|
86356
|
86357
|
86358
|
86359
|
86360
|
86361
|
86362
|
86363
|
86364
|
88907
|
88908
|
88909
|
88910
|
88911
|
88912
|
88913
|
88914
|
88915
|
88916
|
88917
|
88918
|
91728
|
91729
|
91730
|
91731
|
91732
|
91733
|
91734
|
91735
|
91736
|
91737
|
91738
|
91739
|
91740
|
93913
|
94097
|
94109
|
94110
|
94209
|
94616
|
94647