diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2016-03-10 10:50:59 -0500 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-03-11 07:21:09 -0800 |
commit | df7390c9d7db40dcd68cf1020b6248f5105ab8eb (patch) | |
tree | be8d22241727e44b631312c8c045815f4e5824fc /run-tests.sh | |
parent | 805a9c7a40e22f811019f4a854636c30c164525b (diff) |
tests: run tests from the most recent commit first
Change-Id: If11f552543bf0f1f0e9756e9f2237b72e44b7aed
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/13439
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Talur <rtalur@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 c681f7d727e..8fcfa713e80 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -4,6 +4,7 @@ export TZ=UTC force="no" +head="yes" retry="no" tests="" exit_on_failure="yes" @@ -332,12 +333,34 @@ function run_tests() return ${RES} } +function run_head_tests() +{ + [ -d ${regression_testsdir}/.git ] || return + + # The git command needs $cwd to be within the repository, but run_tests + # needs it to be back where we started. + pushd $regression_testsdir + git_cmd="git diff-tree --no-commit-id --name-only -r HEAD" + htests=$($git_cmd tests | grep '.t$') + popd + [ -n "$htests" ] || return + + # Perhaps it's not ideal that we'll end up re-running these tests, but the + # gains from letting them fail fast in the first round should outweigh the + # losses from running them again in the second. OTOH, with so many of our + # tests being non-deterministic, maybe it doesn't hurt to give the newest + # tests an extra workout. + run_tests "$htests" +} + function parse_args () { - args=`getopt frcbk "$@"` + args=`getopt frcbkhH "$@"` set -- $args while [ $# -gt 0 ]; do case "$1" in -f) force="yes" ;; + -h) head="no" ;; + -H) head="only" ;; -r) retry="yes" ;; -c) exit_on_failure="no" ;; -b) skip_bad_tests="no" ;; @@ -367,4 +390,9 @@ check_dependencies check_location # Run the tests -run_tests "$tests" +if [ x"$head" != x"no" ]; then + run_head_tests || exit 1 +fi +if [ x"$head" != x"only" ]; then + run_tests "$tests" || exit 1 +fi |