3 source maint/travis-ci_scripts/common.bash
4 if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
6 if [[ -n "$BREWVER" ]] ; then
7 # .travis.yml already restricts branches to master, topic/* and smoke/*
8 # do some extra short-circuiting here
10 # when smoking master do not attempt bleadperl (not release-critical)
11 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
12 echo_err "$(tstamp) pull-request smoking with custom perl compilation requested - bailing out"
13 export SHORT_CIRCUIT_SMOKE=1
14 elif [[ "$TRAVIS_BRANCH" = "master" ]] && [[ "$BREWVER" = "blead" ]]; then
15 echo_err "$(tstamp) master branch is not smoked with bleadperl - bailing out"
16 export SHORT_CIRCUIT_SMOKE=1
17 # on topic/ branches test only with travis perls
18 elif [[ "$TRAVIS_BRANCH" =~ "topic/" ]]; then
19 echo_err "$(tstamp) non-smoke branch and custom perl compilation requested - bailing out"
20 export SHORT_CIRCUIT_SMOKE=1
23 if [[ -n "$SHORT_CIRCUIT_SMOKE" ]]; then
24 sleep 20 # give the console time to attach, otherwise it hangs
25 return # this is like an `exit 0` in sourcing
29 # different boxes we run on may have different amount of hw threads
30 # hence why we need to query
31 # result is 1.5 times the physical threads
32 export NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 ))
34 if [[ "$CLEANTEST" != "true" ]]; then
35 ### apt-get invocation - faster to grab everything at once
37 # FIXME these debconf lines should automate the firebird config but do not :(((
38 sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/enabled\tboolean\ttrue" | debconf-set-selections'
39 sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/sysdba_password/new_password\tpassword\t123" | debconf-set-selections'
41 APT_PACKAGES="memcached firebird2.5-super firebird2.5-dev expect"
42 run_or_err "Installing packages ($APT_PACKAGES)" "sudo apt-get install --allow-unauthenticated -y $APT_PACKAGES"
45 export DBICTEST_MEMCACHED=127.0.0.1:11211
48 run_or_err "Creating MySQL TestDB" "mysql -e 'create database dbic_test;'"
49 export DBICTEST_MYSQL_DSN='dbi:mysql:database=dbic_test;host=127.0.0.1'
50 export DBICTEST_MYSQL_USER=root
53 run_or_err "Creating PostgreSQL TestDB" "psql -c 'create database dbic_test;' -U postgres"
54 export DBICTEST_PG_DSN='dbi:Pg:database=dbic_test;host=127.0.0.1'
55 export DBICTEST_PG_USER=postgres
58 # poor man's deb config
60 spawn dpkg-reconfigure --frontend=text firebird2.5-super
61 expect "Enable Firebird server?"
62 send "\177\177\177\177yes\r"
63 expect "Password for SYSDBA"
70 # FIXME - this step still fails from time to time >:(((
71 # has to do with the FB reconfiguration I suppose
72 # for now if it fails twice - simply skip FB testing
75 run_or_err "Re-configuring Firebird" "
77 DEBIAN_FRONTEND=text sudo expect -c '$EXPECT_FB_SCRIPT'
80 # restart the server for good measure
81 sudo /etc/init.d/firebird2.5-super stop || true
84 sudo /etc/init.d/firebird2.5-super start
89 if run_or_err "Creating Firebird TestDB" \
90 "echo \"CREATE DATABASE '/var/lib/firebird/2.5/data/dbic_test.fdb';\" | sudo isql-fb -u sysdba -p 123"
92 export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb
93 export DBICTEST_FIREBIRD_USER=SYSDBA
94 export DBICTEST_FIREBIRD_PASS=123
96 export DBICTEST_FIREBIRD_INTERBASE_DSN=dbi:InterBase:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb
97 export DBICTEST_FIREBIRD_INTERBASE_USER=SYSDBA
98 export DBICTEST_FIREBIRD_INTERBASE_PASS=123
107 #DBICTEST_ORA_DSN=dbi:Oracle:host=localhost;sid=XE
108 #DBICTEST_ORA_USER=dbic_test
109 #DBICTEST_ORA_PASS=123
110 #DBICTEST_ORA_EXTRAUSER_DSN=dbi:Oracle:host=localhost;sid=XE
111 #DBICTEST_ORA_EXTRAUSER_USER=dbic_test_extra
112 #DBICTEST_ORA_EXTRAUSER_PASS=123
113 #ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client