diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2013-09-30 16:10:32 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-10-01 23:29:56 -0700 |
commit | a66bf67965dddd9decd9210c3a530fdc85b6430c (patch) | |
tree | 2321028342a8424e5590b895f80b1b2dd807746d /tests | |
parent | dbe4566beff3239bbb23af50b1ef263b8b100e1b (diff) |
tests: Gather only files which need to built
Previous code would rather provide a filter but never look
for newly "Added" files leading to failures in subsequent
build.
This patch fixes such issue by actually verifying pedantically
for only files which need to be tested.
Change-Id: Ia716acf82ee60f8ffe5e36257f1cc866c6062718
BUG: 904005
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/6016
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/basic/rpm.t | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/basic/rpm.t b/tests/basic/rpm.t index e2c630f8e2e..a914d536c29 100755 --- a/tests/basic/rpm.t +++ b/tests/basic/rpm.t @@ -35,18 +35,11 @@ else GIT_PARENT=$(git describe --abbrev=0) fi -# check for changed files -CHANGED_FILES=$(git diff --name-only ${GIT_PARENT}) -# if a commit changes this test, we should not skip it -SELFTEST=$(grep -e 'tests/basic/rpm.t' <<< "${CHANGED_FILES}") -# filter out any files not affecting the build itself -CHANGED_FILES=$(grep -E -v \ - -e '\.c$' \ - -e '\.h$' \ - -e '\.py$' \ - -e '^tests/' \ - <<< "${CHANGED_FILES}") -if [ -z "${CHANGED_FILES}" -a -z "${SELFTEST}" ] +# Filter out everything and what remains needs to be built +BUILD_FILES=$(git diff --name-status ${GIT_PARENT} | grep -Ev '^M.*\.(c|h|py)' | awk {'print $2'}) +SELFTEST=$(grep -e 'tests/basic/rpm.t' <<< "${BUILD_FILES}") +BUILD_FILES=$(grep -Ev '^tests/' <<< "${BUILD_FILES}") +if [ -z "${BUILD_FILES}" -a -z "${SELFTEST}"] then # nothing affecting packaging changed, no need to retest rpmbuild SKIP_TESTS |