Fix last remaining tests with -T under < 5.10
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 40_script.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
afeb40d2 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() {
5ac4a96d 9 local -x HARNESS_OPTIONS=c:j$VCPU_USE
36372426 10 # if we run under docker (! have_sudo) the logic below won't work
11 # it seems as if ulimit acts globally, across the entire OS
12 # and is thus not served properly by a localised `ps xH`
13 if [[ "$VCPU_USE" == 1 ]] && have_sudo ; then
c5915b45 14 ulim=$(( ( $(ps xH | wc -l) - 3 ) + 4 )) # (real count excluding header + ps + wc) + space for ( make + tee + harness + <actual test> )
15 echo_err "$(tstamp) Setting process/thread limit to $ulim"
16 ulimit -u $ulim
36372426 17 sleep 5 # needed to settle things down a bit
c5915b45 18 fi
ad191fcf 19 make test 2> >(tee "$TEST_STDERR_LOG")
20}
b58ecb01 21
55c6fb91 22# announce everything we have on this box
23TRAVIS="" perl -Ilib t/00describe_environment.t >/dev/null
24
b9970637 25TEST_T0=$SECONDS
b58ecb01 26if [[ "$CLEANTEST" = "true" ]] ; then
27 echo_err "$(tstamp) Running tests with plain \`make test\`"
28 run_or_err "Prepare blib" "make pure_all"
ad191fcf 29 run_harness_tests
b58ecb01 30else
652d9b76 31 PROVECMD="prove -lrswTj$VCPU_USE xt t"
19d6c0e1 32
7db28735 33 # List every single SKIP/TODO when they are visible
34 if [[ "$VCPU_USE" == 1 ]] ; then
35 PROVECMD="$PROVECMD --directives"
36 fi
37
b58ecb01 38 echo_err "$(tstamp) running tests with \`$PROVECMD\`"
b9970637 39 $PROVECMD 2> >(tee "$TEST_STDERR_LOG")
b58ecb01 40fi
b9970637 41TEST_T1=$SECONDS
b58ecb01 42
da9346a0 43if \
44 [[ -z "$DBIC_TRACE" ]] \
45&& [[ -z "$DBIC_MULTICREATE_DEBUG" ]] \
46&& [[ -z "$DBICTEST_DEBUG_CONCURRENCY_LOCKS" ]] \
47&& [[ -z "$DBICTEST_VERSION_WARNS_INDISCRIMINATELY" ]] \
48&& [[ -s "$TEST_STDERR_LOG" ]] ; then
b9970637 49 STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG")
50
a9fc70ee 51 # prepend STDERR log
52 POSTMORTEM="$(
53 echo
54 echo "Test run produced $STDERR_LOG_SIZE lines of output on STDERR:"
f207111d 55 echo "============================================================="
a9fc70ee 56 cat "$TEST_STDERR_LOG"
f207111d 57 echo "============================================================="
a9fc70ee 58 echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)"
f207111d 59 echo
879ff8cb 60 echo
a9fc70ee 61 )$POSTMORTEM"
b9970637 62fi
63
a9fc70ee 64echo
65echo "${POSTMORTEM:- \o/ No notable smoke run issues \o/ }"
66echo
b9970637 67echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s"
a9fc70ee 68if [[ -n "$INSTALLDEPS_OUT" ]] ; then
36372426 69 echo "$(tstamp) Full dep install log at $(/usr/bin/perl /usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")"
a9fc70ee 70fi
71echo