X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=maint%2Ftravis-ci_prepare_env;h=6ccaa7a9331abd55c1eb85f25326c804180960c5;hb=47d391d57c19194c1ffd2152f38b72474b059862;hp=b336ac7c9c8cffca85972f0687e1d870efa0c3c6;hpb=d70070c9e7e2a2ec3306f6b95f770c0faff61cbb;p=dbsrgits%2FDBIx-Class.git diff --git a/maint/travis-ci_prepare_env b/maint/travis-ci_prepare_env index b336ac7..6ccaa7a 100755 --- a/maint/travis-ci_prepare_env +++ b/maint/travis-ci_prepare_env @@ -35,78 +35,29 @@ fi # if [[ -n "$BREWVER" ]] ; then + # if this is not master and not a smoke/ branch - cancel all testing + if [[ "$TRAVIS_BRANCH" =~ "topic/" ]]; then + export SHORT_CIRCUIT_SMOKE=1 + sleep 20 # give the console time to attach, otherwise it hangs + return # this is like an `exit 0` in sourcing + fi + perlbrew install --as $BREWVER --notest $BREWOPTS -j $NUMTHREADS perl-$BREWVER perlbrew use $BREWVER fi export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 - -# configure CPAN.pm - older versions get tickled by M::AI and -# go into an endless loop when trying to autoconf themselves -perl -e ' - require CPAN; - require CPAN::FirstTime; - *CPAN::FirstTime::conf_sites = sub {}; - CPAN::Config->load; - $CPAN::Config->{urllist} = [ "http://cpan.cpantesters.org/" ]; - CPAN::Config->commit; -' &> /dev/null - -# if this won't be a CLEANTEST (i.e. no deps) - run basic tests using SQLT -# and set up whatever databases necessary -if [[ "$CLEANTEST" != "true" ]]; then - # extra debian stuff - sudo apt-get -y install memcached firebird2.5-super - echo -e '\v' - echo - - export DBICTEST_SQLT_DEPLOY=1 - - # memcached - export DBICTEST_MEMCACHED=127.0.0.1:11211 - - # mysql - mysql -e 'create database dbic_test;' - export DBICTEST_MYSQL_DSN='dbi:mysql:database=dbic_test;host=127.0.0.1' - export DBICTEST_MYSQL_USER=root - - # pg - psql -c 'create database dbic_test;' -U postgres - export DBICTEST_PG_DSN='dbi:Pg:database=dbic_test;host=127.0.0.1' - export DBICTEST_PG_USER=postgres - - # firebird - sudo perl -pi -e 's/\=no/=yes/' /etc/default/firebird2.5 - sudo /etc/init.d/firebird2.5-super start - # FIXME: todo - #sudo gsec -add dbic_test -pw 123 - #export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test - #export DBICTEST_FIREBIRD_USER=dbic_test - #export DBICTEST_FIREBIRD_PASS=123 - #export DBICTEST_FIREBIRD_INTERBASE_DSN=dbi:InterBase:dbname=/var/lib/firebird/2.5/data/dbic_test - #export DBICTEST_FIREBIRD_INTERBASE_USER=dbic_test - #export DBICTEST_FIREBIRD_INTERBASE_PASS=123 - - # oracle - # FIXME: todo - #DBICTEST_ORA_DSN=dbi:Oracle:host=localhost;sid=XE - #DBICTEST_ORA_USER=dbic_test - #DBICTEST_ORA_PASS=123 - #DBICTEST_ORA_EXTRAUSER_DSN=dbi:Oracle:host=localhost;sid=XE - #DBICTEST_ORA_EXTRAUSER_USER=dbic_test_extra - #DBICTEST_ORA_EXTRAUSER_PASS=123 - #ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client -fi +export PERL_CPANM_OPT="$( echo $PERL_CPANM_OPT | sed 's/--skip-satisfied//' )" installdeps() { if [[ -z "$@" ]] ; then return; fi + # The reason we do things so "non-interactively" is that xargs -P will have the + # latest cpanm instance overwrite the buildlog. There seems to be no way to + # specify a custom buildlog, hence we just collect the verbose output + # and display it in case of failure echo -n "Installing $@... " - # FIXME - # the --reinstall is here because for some reason e.g. `cpanm Carp` does - # not install a newer Carp since it already exists on the system - # investigation pending - if ! OUT=$( echo "$@" | xargs -n 1 -P $NUMTHREADS cpanm --reinstall --verbose --notest 2>&1 ) ; then + if ! OUT=$( echo "$@" | xargs -n 1 -P $NUMTHREADS cpanm --verbose --no-interactive --notest --no-man-pages 2>&1 ) ; then EX=$? echo "FAILED !!!" echo "$OUT" @@ -129,32 +80,123 @@ installdeps Test::Exception Test::Fatal Module::Runtime Carp installdeps Sub::Name multidimensional namespace::clean Class::XSAccessor MRO::Compat installdeps DBI Moo Class::Accessor::Grouped +# configure CPAN.pm - older versions get tickled by M::AI and +# go into an endless loop when trying to autoconf themselves +# we are not *supposed* to actually use it, this is just a +# precaution +perl -e ' + require CPAN; + require CPAN::FirstTime; + *CPAN::FirstTime::conf_sites = sub {}; + CPAN::Config->load; + $CPAN::Config->{urllist} = [ "http://cpan.cpantesters.org/" ]; + CPAN::Config->commit; +' &> /dev/null + if [[ "$CLEANTEST" = "true" ]]; then # get the last inc/ off cpan - we will get rid of MI # soon enough, but till then this will do # the point is to have a *really* clean perl (the ones # we build are guaranteed to be clean, without side # effects from travis preinstalls) - # - # FIXME - not yet implemented - not sure how to reliably - # feed to wget this location: http://cpansearch.perl.org/src/GETTY/DBIx-Class-0.08204/inc/ - echo TODOOOO - M::I is not supposed to be installed here - this test is useless now - installdeps Module::Install + + # trick cpanm into executing true as shell - we just need the find+unpack + SHELL=/bin/true cpanm --look DBIx::Class + mv ~/.cpanm/latest-build/*/inc . else - # we will be running all tests, preinstall MOAR stuff + # we will be running all tests - preinstall MOAR stuff, run basic tests using SQLT + # and set up whatever databases necessary installdeps Module::Install DateTime::Format::Strptime MooseX::Types JSON::Any Class::DBI + + export DBICTEST_SQLT_DEPLOY=1 + +### apt-get invocation - faster to grab everything at once + # + # FIXME these debconf lines should automate the firebird config but do not :((( + sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/enabled\tboolean\ttrue" | debconf-set-selections' + sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/sysdba_password/new_password\tpassword\t123" | debconf-set-selections' + + sudo apt-get install -y memcached firebird2.5-super firebird2.5-dev expect + +### memcached + export DBICTEST_MEMCACHED=127.0.0.1:11211 + +### mysql + mysql -e 'create database dbic_test;' + export DBICTEST_MYSQL_DSN='dbi:mysql:database=dbic_test;host=127.0.0.1' + export DBICTEST_MYSQL_USER=root + +### pg + psql -c 'create database dbic_test;' -U postgres + export DBICTEST_PG_DSN='dbi:Pg:database=dbic_test;host=127.0.0.1' + export DBICTEST_PG_USER=postgres + +### firebird + # poor man's deb config + echo -n "Re-configuring firebird... " + if ! OUT=$( + sync + DEBIAN_FRONTEND=text sudo expect -c ' + spawn dpkg-reconfigure --frontend=text firebird2.5-super + expect "Enable Firebird server?" + send "\177\177\177\177yes\r" + expect "Password for SYSDBA" + send "123\r" + sleep 1 + wait + sleep 1 + ' + sync + # restart the server for good measure + sudo /etc/init.d/firebird2.5-super stop || true + sleep 3 + sudo /etc/init.d/firebird2.5-super start + ) ; then + EX=$? + echo "FAILED !!!" + echo "$OUT" + exit $? + else + echo "done." + fi + + # creating testdb + sudo isql-fb -u sysdba -p 123 <<< "CREATE DATABASE '/var/lib/firebird/2.5/data/dbic_test.fdb';" + + # the official version is full of 5.10-isms, but works perfectly fine on 5.8 + # pull in our patched copy + git clone https://github.com/dbsrgits/perl-dbd-firebird-5.8.git ~/dbd-firebird + + # the official version is very much outdated and does not compile on 5.14+ + # use this rather updated source tree (needs to go to PAUSE): + # https://github.com/pilcrow/perl-dbd-interbase + git clone https://github.com/dbsrgits/perl-dbd-interbase ~/dbd-interbase + + installdeps ~/dbd-interbase/ ~/dbd-firebird/ + + export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb + export DBICTEST_FIREBIRD_USER=SYSDBA + export DBICTEST_FIREBIRD_PASS=123 + + export DBICTEST_FIREBIRD_INTERBASE_DSN=dbi:InterBase:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb + export DBICTEST_FIREBIRD_INTERBASE_USER=SYSDBA + export DBICTEST_FIREBIRD_INTERBASE_PASS=123 + +### oracle + # FIXME: todo + #DBICTEST_ORA_DSN=dbi:Oracle:host=localhost;sid=XE + #DBICTEST_ORA_USER=dbic_test + #DBICTEST_ORA_PASS=123 + #DBICTEST_ORA_EXTRAUSER_DSN=dbi:Oracle:host=localhost;sid=XE + #DBICTEST_ORA_EXTRAUSER_USER=dbic_test_extra + #DBICTEST_ORA_EXTRAUSER_PASS=123 + #ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client fi -# install the rest +# install the remaining dependencies perl Makefile.PL installdeps $(make listalldeps) -# FIXME - for some reason the above invocation does not upgrade outdated -# core libs - just punt and install the remainder by hand (these run tests) -# This snippet should not be here at all -perl Makefile.PL &> /dev/null -make installdeps - # announce what are we running perl -V echo "Using $NUMTHREADS Travis-CI concurrent processes"