[master] d977207 Collect vtest failed tests logs more reliably

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jan 10 13:56:05 CET 2017


commit d977207d1259e985daf0050ad3a5e5bcc870c0d5
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Nov 21 15:24:32 2016 +0100

    Collect vtest failed tests logs more reliably
    
    Instead of randomly looking for the log files, look for them where we
    expect them to land. For instance, after a git pull, a distclean
    operation may not remove the dist directory if Varnish's version
    changed because it would reconfigure itself on the fly.
    
    Instead of reading the output of `make distcheck`, look for failing
    tests in the dist directory.

diff --git a/tools/vtest.sh b/tools/vtest.sh
index cdd2d85..4f732cb 100755
--- a/tools/vtest.sh
+++ b/tools/vtest.sh
@@ -80,21 +80,26 @@ makedistcheck () (
 )
 
 failedtests () (
-	for t in `grep '^FAIL: tests/' ${1} | sort -u | sed 's/.* //'`
+	set -e
+
+	REPORTDIR=`pwd`/_report
+
+	cd varnish-cache
+
+	VERSION=`./configure --version | awk 'NR == 1 {print $NF}'`
+	LOGDIR=varnish-$VERSION/_build/sub/bin/varnishtest/tests
+	VTCDIR=bin/varnishtest/tests
+
+	grep -l ':test-result: FAIL' $LOGDIR/*.trs |
+	while read trs
 	do
-		printf 'VTCGITREV %s ' "${t}"
-		(
-			cd varnish-cache/bin/varnishtest/
-			git log -n 1 ${t} | head -1
-		)
-		b=`basename ${t} .vtc`
-		for i in `find "${BUILDDIR}" -name ${b}.log -print`
-		do
-			if [ -f ${i} ] ; then
-				mv ${i} "_report/_${b}.log"
-				echo "MANIFEST _${b}.log" >> ${LOG}
-			fi
-		done
+		name=`basename $trs .trs`
+		vtc=${name}.vtc
+		log=${name}.log
+		rev=`git log -n 1 --pretty=format:%H ${VTCDIR}/${vtc}`
+		cp ${LOGDIR}/${log} ${REPORTDIR}/_${log}
+		echo "VTCGITREV ${name} ${rev}"
+		echo "MANIFEST _${log}"
 	done
 )
 
@@ -179,7 +184,7 @@ do
 			echo "MAKEDISTCHECK BAD" >> ${LOG}
 			echo "MANIFEST _autogen" >> ${LOG}
 			echo "MANIFEST _makedistcheck" >> ${LOG}
-			failedtests _report/_makedistcheck >> ${LOG}
+			failedtests >> ${LOG}
 		else
 			echo "MAKEDISTCHECK GOOD" >> ${LOG}
 			waitnext=${WAITGOOD}



More information about the varnish-commit mailing list