diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2015-04-07 15:32:18 -0400 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-15 12:29:08 +0000 |
commit | c07f166560e5f0b7f3ef400520773b2c7f1f4220 (patch) | |
tree | d0082ec40afa28ba071a1c332e870cf73ed00f16 /run-tests.sh | |
parent | 08a1041ca9aaf5300032294ca5c5e19dc8f836eb (diff) |
tests: early bail-out on bad status or new core file(s)
This started as a way to identify which test created new core files,
since that's a critical piece of debugging information that's missing
when we only check for cores at the end of a run. It also exits
*immediately* either on bad status or discovery of a new core file.
This allows the run to be retried or aborted quickly, to reduce the
latency of all jobs in the regression-test pipeline.
Change-Id: Ib4a1c779b44f041ab8728f772874f6c23de95929
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/10157
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'run-tests.sh')
-rwxr-xr-x | run-tests.sh | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/run-tests.sh b/run-tests.sh index d6de6c6c31a..ae41fd9a345 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -186,11 +186,39 @@ function run_tests() return ${RES} } +function run_all () +{ + old_cores=$(ls /core.* 2> /dev/null | wc -l) + + find ${regression_testsdir}/tests -name '*.t' \ + | LC_COLLATE=C sort \ + | while read t; do + retval=0 + prove -f --timer $t + TMP_RES=$? + if [ ${TMP_RES} -ne 0 ] ; then + echo "$t: bad status $TMP_RES" + retval=$((retval+1)) + fi + new_cores=$(ls /core.* 2> /dev/null | wc -l) + if [ x"$new_cores" != x"$old_cores" ]; then + core_diff=$((new_cores-old_cores)) + echo "$t: $core_diff new core files" + retval=$((retval+2)) + fi + if [ $retval -ne 0 ]; then + return $retval + fi + done +} + function main() { if [ $# -lt 1 ]; then - echo "Running all the regression test cases" - prove -rf --timer ${regression_testsdir}/tests; + echo "Running all the regression test cases (new way)" + #prove -rf --timer ${regression_testsdir}/tests; + run_all + echo "result = $?" else run_tests "$@" fi |