summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrun-tests.sh32
-rwxr-xr-xtests/basic/first-test.t10
2 files changed, 40 insertions, 2 deletions
diff --git a/run-tests.sh b/run-tests.sh
index c681f7d..8fcfa71 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
diff --git a/tests/basic/first-test.t b/tests/basic/first-test.t
new file mode 100755
index 0000000..535b269
--- /dev/null
+++ b/tests/basic/first-test.t
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cat << EOF
+This test should run first for http://review.gluster.org/#/c/13439/ and should
+be removed once that patch has been merged.
+EOF
+
+TEST true