Subject: | $ENV variable opt-out to skip network tests |
I've attached a new, reworked version of network.t that allows a person to opt out of the network tests (which occasionally randomly fail for me). This should allow people who are packaging the module (possibly like myself), to get a cleaner build process. The new test is simpler and uses Test::More (included in many perl distributions (I believe since 5.6.x). If you accept this test, you may wish to include Test::More in your PREREQ_PM in Makefile.PL
#!/usr/bin/perl -w
use strict;
use HTTP::OAI;
use Test::More tests => 5;
my @repos = qw(
http://eprints.ecs.soton.ac.uk/perl/oai2
http://citebase.eprints.org/cgi-bin/oai2
http://memory.loc.gov/cgi-bin/oai2_0
);
my $h = HTTP::OAI::Harvester->new(debug=>0,baseURL=>$repos[int(rand(@repos))]);
my $r;
my $dotest = not defined($ENV{"skip-http-oai-nettests"});
SKIP : {
skip "Skipping flakey net tests", 5 unless $dotest;
#$r = $h->GetRecord(identifier=>'oai:eprints.ecs.soton.ac.uk:23',metadataPrefix=>'oai_dc');
#ok($r->is_success());
$r = $h->Identify();
ok($r->is_success());
$r = $h->ListIdentifiers(metadataPrefix=>'oai_dc');
ok($r->is_success());
$r = $h->ListMetadataFormats();
ok($r->is_success());
$r = $h->ListRecords(metadataPrefix=>'oai_dc');
ok($r->is_success());
$r = $h->ListSets();
ok($r->is_success());
}