Fix failures and protect the suite from spurious VERSION-related warnings
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 40_script.bash
index 8cb9048..3b8b110 100755 (executable)
@@ -1,20 +1,31 @@
 #!/bin/bash
 
+# this file is executed in a subshell - set up the common stuff
 source maint/travis-ci_scripts/common.bash
-if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
+
+if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi
 
 run_harness_tests() {
-  local -x HARNESS_OPTIONS=c:j$NUMTHREADS
+  local -x HARNESS_OPTIONS=c:j$VCPU_USE
+  if [[ "$VCPU_USE" == 1 ]]; then
+    ulim=$(( ( $(ps xH | wc -l) - 3 ) + 4 )) # (real count excluding header + ps + wc) + space for ( make + tee + harness + <actual test> )
+    echo_err "$(tstamp) Setting process/thread limit to $ulim"
+    ulimit -u $ulim
+    sleep 10 # needed to settle things down a bit
+  fi
   make test 2> >(tee "$TEST_STDERR_LOG")
 }
 
+# announce everything we have on this box
+TRAVIS="" perl -Ilib t/00describe_environment.t >/dev/null
+
 TEST_T0=$SECONDS
 if [[ "$CLEANTEST" = "true" ]] ; then
   echo_err "$(tstamp) Running tests with plain \`make test\`"
   run_or_err "Prepare blib" "make pure_all"
   run_harness_tests
 else
-  PROVECMD="prove -lrswj$NUMTHREADS xt t"
+  PROVECMD="prove -lrswj$VCPU_USE xt t"
 
   # FIXME - temporary, until Package::Stash is fixed
   if perl -M5.010 -e 1 &>/dev/null ; then
@@ -26,7 +37,12 @@ else
 fi
 TEST_T1=$SECONDS
 
-if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then
+if \
+   [[ -z "$DBIC_TRACE" ]] \
+&& [[ -z "$DBIC_MULTICREATE_DEBUG" ]] \
+&& [[ -z "$DBICTEST_DEBUG_CONCURRENCY_LOCKS" ]] \
+&& [[ -z "$DBICTEST_VERSION_WARNS_INDISCRIMINATELY" ]] \
+&& [[ -s "$TEST_STDERR_LOG" ]] ; then
   STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG")
 
   # prepend STDERR log