Skip to content

Commit

Permalink
Merge pull request #223 from zmughal/travis-perl-helpers
Browse files Browse the repository at this point in the history
Use Travis Perl helper script and enable coverage
  • Loading branch information
cjfields committed Apr 21, 2017
2 parents 4d2cb13 + 5053111 commit eef145d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 31 deletions.
74 changes: 44 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@ perl:
- "5.16"
- "5.14"

matrix:
include:
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=1
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=2
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=3
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=4
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=5
- perl: 5.18
env: COVERAGE=1 TEST_PARTITION=6

sudo: false
env: PERL_CPANM_OPT="--notest --force --skip-satisfied"
env:
global:
- PERL_CPANM_OPT="--notest --force --skip-satisfied"
- BIOPERL_NETWORK_TESTING=0 # disables the network tests
- TEST_PARTITIONS=6

addons:
apt:
Expand All @@ -17,38 +36,33 @@ addons:
- libgd2-xpm-dev
- libxml2-dev

before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init
- build-perl
- perl -V
- cpanm DBD::mysql DBD::Pg DBD::SQLite 2>&1 | tail -n 1
- cpanm Test::Pod 2>&1 | tail -n 1
- cpanm Bio::ASN1::EntrezGene 2>&1 | tail -n 1
- if [ "$BIOPERL_NETWORK_TESTING" = "1" ]; then
export TRAVIS_AUTHOR_TESTING=1;
export TRAVIS_RELEASE_TESTING=1;
cpanm LWP::UserAgent LWP::Protocol::https 2>&1 | tail -n 1;
fi
- build-dist
- cd $BUILD_DIR
install:
#These are recommended or required Perl libraries:
- "cpanm GD 2>&1 CGI | tail -n 1"
- "cpanm HTML::TableExtract DBI Data::Stag DB_File 2>&1 | tail -n 1"
- "cpanm DBD::mysql DBD::Pg DBD::SQLite 2>&1 | tail -n 1"
- "cpanm Algorithm::Munkres Array::Compare Convert::Binary::C Error 2>&1 | tail -n 1"
- "cpanm Graph SVG SVG::Graph GraphViz 2>&1 | tail -n 1"
- "cpanm XML::DOM::XPath XML::Parser XML::Parser::PerlSAX 2>&1 | tail -n 1"
- "cpanm XML::SAX XML::SAX::Writer XML::Simple XML::LibXML XML::Twig XML::Writer 2>&1 | tail -n 1"
- "cpanm PostScript::TextBlock Set::Scalar Sort::Naturally YAML | tail -n 1"
- "cpanm Math::Random Spreadsheet::ParseExcel | tail -n 1"
- "cpanm Bio::Phylo | tail -n 1"
- "cpanm Test::Weaken | tail -n 1"
- "cpanm Test::Memory::Cycle | tail -n 1"
- "cpanm Test::Most | tail -n 1"
#Test coverage from Coveralls
#- cpanm --quiet --notest Devel::Cover::Report::Coveralls
#for some reason tests and deps aren't skipped here. Will have to look into it more...
#git repos, seems to only work for simple checkouts, so pure perl only (TODO: look into before_script for more detail)
#- "git clone https://github.com/bioperl/Bio-Root.git; export PERL5LIB=$( pwd )/Bio-Root/lib:$PERL5LIB"
#This installs BioPerl itself:
- "perl ./Build.PL --accept"

- cpan-install --deps
- cpan-install --coverage
before_script:
- coverage-setup
script:
- "./Build test"
#Devel::Cover coverage options are: statement, branch, condition, path, subroutine, pod, time, all and none
#- "./Build build && cover -test -report coveralls" #complete version coverage test
#- PERL5OPT=-MDevel::Cover=+ignore,prove,-coverage,statement,subroutine prove -lr t #limited version coverage test
#- cover -report coveralls

- export AUTHOR_TESTING=${TRAVIS_AUTHOR_TESTING:=0}
- export RELEASE_TESTING=${TRAVIS_RELEASE_TESTING:=0}
- prove -l -j$(test-jobs) $(test-files)
after_success:
- ./travis_scripts/trigger-dockerhub.sh
- coverage-report
- ./travis_scripts/trigger-dockerhub.sh

#TODO - send emails to bioperl-guts-l
notifications:
Expand Down
2 changes: 1 addition & 1 deletion t/RemoteDB/Taxonomy.t
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ SKIP: {

# tests for #212
SKIP: {
test_skip( -tests => 12, -requires_networking => 1 );
test_skip( -tests => 6, -requires_networking => 1 );

my $db = Bio::DB::Taxonomy->new( -source => "entrez" );

Expand Down

0 comments on commit eef145d

Please sign in to comment.