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