(travis) Various TravisCI improvements lifted from blead
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 40_script.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
c4c7254d 3# this file is executed in a subshell - set up the common stuff
4source maint/travis-ci_scripts/common.bash
5
6if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi
b58ecb01 7
ad191fcf 8run_harness_tests() {
ad191fcf 9 local -x HARNESS_OPTIONS=c:j$NUMTHREADS
10 make test 2> >(tee "$TEST_STDERR_LOG")
11}
b58ecb01 12
b9970637 13TEST_T0=$SECONDS
b58ecb01 14if [[ "$CLEANTEST" = "true" ]] ; then
15 echo_err "$(tstamp) Running tests with plain \`make test\`"
16 run_or_err "Prepare blib" "make pure_all"
ad191fcf 17 run_harness_tests
b58ecb01 18else
d8541ca3 19 PROVECMD="prove -lrswj$NUMTHREADS xt t"
19d6c0e1 20
21 # FIXME - temporary, until Package::Stash is fixed
22 if perl -M5.010 -e 1 &>/dev/null ; then
23 PROVECMD="$PROVECMD -T"
24 fi
25
b58ecb01 26 echo_err "$(tstamp) running tests with \`$PROVECMD\`"
b9970637 27 $PROVECMD 2> >(tee "$TEST_STDERR_LOG")
b58ecb01 28fi
b9970637 29TEST_T1=$SECONDS
b58ecb01 30
b9970637 31if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then
32 STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG")
33
a9fc70ee 34 # prepend STDERR log
35 POSTMORTEM="$(
36 echo
37 echo "Test run produced $STDERR_LOG_SIZE lines of output on STDERR:"
f207111d 38 echo "============================================================="
a9fc70ee 39 cat "$TEST_STDERR_LOG"
f207111d 40 echo "============================================================="
a9fc70ee 41 echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)"
f207111d 42 echo
879ff8cb 43 echo
a9fc70ee 44 )$POSTMORTEM"
b9970637 45fi
46
a9fc70ee 47echo
48echo "${POSTMORTEM:- \o/ No notable smoke run issues \o/ }"
49echo
b9970637 50echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s"
a9fc70ee 51if [[ -n "$INSTALLDEPS_OUT" ]] ; then
52 echo "$(tstamp) Full dep install log at $(/usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")"
53fi
54echo