[Bioperl-l] Tests involving remote databases

Chris Fields cjfields at uiuc.edu
Sat Sep 30 10:57:42 EDT 2006

On Sep 30, 2006, at 4:21 AM, Sendu Bala wrote:

> Chris Fields wrote:
>> I'm not sure how Bio::Root::HTTPget deals with errors, but you can
>> test for several conditions when using LWP (success, error, etc) and
>> throw an error accordingly.  So you could possibly test $@ with a
>> regex for the error message, pass/fail tests based on that, followed
>> by skipping further tests.
> As I see it, the problem is that for some types response received from
> LWP you can't distinguish between a temporary user-specific network
> issue and a permanent server problem. What codes were received in the
> recent problem cases? 408, 500 and 503 seem ambiguous to me. We could
> certainly fail tests on a 404 though.

We could try Hilmar or Torsten's suggestion of using a library  
function or similar; I'll try to find out what other CPAN modules  
do.  What I want to avoid is something like this:

pyrimidine:~/src/bioperl-live cjfields$ perl -I. t/XEMBL_DB.t
ok 1
ok 2 # server may be down
ok 3 # Cannot run XEMBL_DB tests
ok 4 # Cannot run XEMBL_DB tests
ok 5 # Cannot run XEMBL_DB tests
ok 6 # Cannot run XEMBL_DB tests
ok 7 # Cannot run XEMBL_DB tests
ok 8 # Cannot run XEMBL_DB tests
ok 9 # Cannot run XEMBL_DB tests

There should be a failed test to let us know of the problem.  As  
currently set up, the XEMBL server failure doesn't show up in  
Test::Harness test summaries.  Biblio_biofetch.t had the similar  
problems before Brian's fixes.

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign

More information about the Bioperl-l mailing list