From 68b840267ed0f6864e4cf5ba7d842988c0fb3da8 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Fri, 11 Mar 2016 16:20:01 -0500 Subject: tests: return correct value from run_head_tests when no tests are found Also added a diff filter to avoid listing deleted tests. Thanks to Raghavendra Talur for the suggestion. Change-Id: Ied2d552d227b55027211c07db6ee5dc20979596b Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/13686 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Tested-by: Gluster Build System --- run-tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'run-tests.sh') diff --git a/run-tests.sh b/run-tests.sh index 8fcfa713e80..db956cf46fe 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -335,15 +335,15 @@ function run_tests() function run_head_tests() { - [ -d ${regression_testsdir}/.git ] || return + [ -d ${regression_testsdir}/.git ] || return 0 # 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$') + git_cmd="git diff-tree --no-commit-id --name-only --diff-filter=ACMRTUXB" + htests=$($git_cmd -r HEAD tests | grep '.t$') popd - [ -n "$htests" ] || return + [ -n "$htests" ] || return 0 # 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 -- cgit