From a44af993d0aa32cc8852125afdfcc2fa12e2a274 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 5 Oct 2017 17:42:21 -0300 Subject: [PATCH] Bug 18794: Fix test ListMetadataFormats in OAI/Server.t This test may fail on slow servers, it compares the response date with 'now', but both can differ a bit. https://jenkins.koha-community.org/job/Koha_Master_D8/198/consoleFull Failed test 'ListMetadataFormats' at t/db_dependent/OAI/Server.t line 150. Structures begin differing at: $got->{responseDate} = '2017-06-12T14:31:51Z' $expected->{responseDate} = '2017-06-12T14:31:50Z' --- t/db_dependent/OAI/Server.t | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t index 05c2d87a10..768fbd9262 100644 --- a/t/db_dependent/OAI/Server.t +++ b/t/db_dependent/OAI/Server.t @@ -82,10 +82,8 @@ my $get_response = sub { $response = XMLin($stdout); }; $get_response->(); -my $now = DateTime->now . 'Z'; my $expected = { request => 'http://localhost', - responseDate => $now, xmlns => 'http://www.openarchives.org/OAI/2.0/', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd', @@ -104,14 +102,13 @@ my $expected = { ], }, }; +delete $response->{responseDate}; is_deeply($response, $expected, "ListMetadataFormats"); %param = ( verb => 'ListIdentifiers' ); $get_response->(); -$now = DateTime->now . 'Z'; $expected = { request => 'http://localhost', - responseDate => $now, xmlns => 'http://www.openarchives.org/OAI/2.0/', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd', @@ -120,6 +117,7 @@ $expected = { content => "Required argument 'metadataPrefix' was undefined", }, }; +delete $response->{responseDate}; is_deeply($response, $expected, "ListIdentifiers without metadaPrefix argument"); $dbh->rollback; -- 2.39.5