[Bioperl-l] Tests involving remote databases

Sendu Bala bix at sendu.me.uk
Mon Oct 2 09:40:02 UTC 2006


Chris Fields wrote:
>
> The idea is to retain current behavior (remote DB access will not be  
> run unless BIOPERLDEBUG is set to 1) and apply it to all tests  
> requiring such access.  Otherwise, just those tests are skipped (and  
> not the rest of the tests, which occurs currently).  If BIOPERLDEBUG  
> is set, the next tests would check the URL, which passes/fails (based  
> on the specific value of $@), and runs/skips tests based on the mere  
> presence of $@, which indicates some URL issue.  You can do this with  
> Test::More, but I'm not sure this can be done with Test.pm or  
> Test::Simple.

Firstly, BIOPERLDEBUG should not be abused; it should be used only when 
you want to see extra debugging messages. There should be another 
variable that you can set to choose if network-requiring tests are run, 
and it should also be a configurable choice when you run perl Makefile.PL.

(But changing this isn't going to happen for 1.5.2)

When the server problem is ambiguous we should not fail the test. Just 
make the skip message visible and pass all ok...


> The current behavior just skips all tests based on a single failed  
> URL.  Then, Test::Harness, as currently set, shows skipped tests as  
> passed.  The last run I posted previously where XEMBL_DB.t remote DB  
> tests failed, I also ran all tests (make test) and get this, which  
> doesn't tell us that the remote URL failed:
> 
> -----------------------------------------
> 
> ...
> t/WABA.......................ok
> t/XEMBL_DB...................ok
> t/ztr........................Bio::SeqIO::staden::read of bioperl-ext  
> is not installed or is installed incorrectly - skipping ztr.t tests
> ok
> All tests successful, 5 subtests skipped.

All you have to do to make it visible is start the skip message with the 
work 'Skip':

skip('Skip server may be down',1);

...
t/WABA.......................ok 

t/XEMBL_DB...................ok 

         1/9 skipped: server may be down
t/ztr........................Bio::SeqIO::staden::read of bioperl-ext is 
not installed or is installed incorrectly - skipping ztr.t tests
t/ztr........................ok


It's nicer when using Test::More.



More information about the Bioperl-l mailing list