Bugzilla – Attachment 30971 Details for
Bug 12782
t/db_dependent/XISBN.t should work on DOM too
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12782: (followup) skip tests that fail because of provider's error
Bug-12782-followup-skip-tests-that-fail-because-of.patch (text/plain), 2.57 KB, created by
Chris Cormack
on 2014-08-19 09:07:06 UTC
(
hide
)
Description:
Bug 12782: (followup) skip tests that fail because of provider's error
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-08-19 09:07:06 UTC
Size:
2.57 KB
patch
obsolete
>From 18ca24a1b6e40dfd91f4b1fb93af782fe25c4b3d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 18 Aug 2014 17:20:24 -0300 >Subject: [PATCH] Bug 12782: (followup) skip tests that fail because of > provider's error > >It seems that XISBN is failing sometimes, if you run the tests a couple >of times in a row. An error 500 is raised by lwp. > >This problem should be trapped and related tests skipped. Because too much >noise could make people pay no attention to this tests failing. > >To reproduce: >- Run the tests several consecutive times: > $ prove -v t/db_dependent/XISBN.t >=> FAIL: XISBN test will fail eventually, printing a networking-related warning. >- Apply the patch >- Repeat the test >=> SUCCESS: when XISBN the networking/connection refused problem arises, the test > is skipped, and it still passes. > >Regards >To+ > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > t/db_dependent/XISBN.t | 30 ++++++++++++++++++++++-------- > 1 file changed, 22 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t >index 1f6f797..9486274 100755 >--- a/t/db_dependent/XISBN.t >+++ b/t/db_dependent/XISBN.t >@@ -53,19 +53,33 @@ $trial = C4::XISBN::_get_biblio_from_xisbn($isbn1); > is( $trial->{biblionumber}, > $biblionumber1, "Gets biblionumber like the previous test." ); > >+## Test ThingISBN > $context->set_preference( 'ThingISBN', 1 ); > $context->set_preference( 'XISBN', 0 ); >-my $results_thingisbn = C4::XISBN::get_xisbns($isbn1); >-is( $results_thingisbn->[0]->{biblionumber}, >- $biblionumber3, >- "Gets correct biblionumber from a book with a similar isbn using ThingISBN." ); > >+my $results_thingisbn; >+eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1); }; >+SKIP: { >+ skip "Problem retrieving ThingISBN", 1 >+ unless $@ eq ''; >+ is( $results_thingisbn->[0]->{biblionumber}, >+ $biblionumber3, >+ "Gets correct biblionumber from a book with a similar isbn using ThingISBN." ); >+} >+ >+## Test XISBN > $context->set_preference( 'ThingISBN', 0 ); > $context->set_preference( 'XISBN', 1 ); >-my $results_xisbn = C4::XISBN::get_xisbns($isbn1); >-is( $results_xisbn->[0]->{biblionumber}, >- $biblionumber3, >- "Gets correct biblionumber from a book with a similar isbn using XISBN." ); >+ >+my $results_xisbn; >+eval { $results_xisbn = C4::XISBN::get_xisbns($isbn1); }; >+SKIP: { >+ skip "Problem retrieving XISBN", 1 >+ unless $@ eq ''; >+ is( $results_xisbn->[0]->{biblionumber}, >+ $biblionumber3, >+ "Gets correct biblionumber from a book with a similar isbn using XISBN." ); >+} > > $dbh->rollback; > >-- >1.9.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 12782
:
30951
|
30952
|
30970
|
30971
|
31020
|
31021