public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 1/5] xfstests: fix last test runtime output
Date: Wed,  1 May 2013 18:31:59 +1000	[thread overview]
Message-ID: <1367397123-2530-2-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1367397123-2530-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

Prior to the test directory split-up, xfstests used to output the
time it previously took to run a specific test in it's output. This
was broken during the split up, as test identifiers changed and the
result output changed.

To fix this, the search for previous test results needs to look at
the sequence number rather than the absolute sequence for the test.
The new output looks the same as the old functionality:

generic/001 4s ... 5s
generic/002 1s ... 0s
generic/005 1s ... 1s
generic/006 1s ... 1s
generic/007 2s ... 1s

Where the first column is the time of the previous test run, and the
second column is the time that this run took.

Further, the check files used to generate this information are not
being output properly in the result directory, and so various log
files are not getting written to the correct location or file names.
For example, the calls to _check_test_fs would output failures to
".full", while other messages would be output to check.full, but
none would output to the corect location of RESULT_BASE/check.full.

Fix all this mess up so that all the check files for a specific run
end up in RESULT_BASE, and ensure the timing code checks the right
file and dumps output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 check |   48 +++++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/check b/check
index 966fbe5..a79747e 100755
--- a/check
+++ b/check
@@ -293,14 +293,17 @@ fi
 
 _wrapup()
 {
+    seq="check"
+    check="$RESULT_BASE/check"
+
     if $showme
     then
 	:
     elif $needwrap
     then
-	if [ -f check.time -a -f $tmp.time ]
+	if [ -f $check.time -a -f $tmp.time ]
 	then
-	    cat check.time $tmp.time \
+	    cat $check.time $tmp.time \
 	    | $AWK_PROG '
 	{ t[$1] = $2 }
 END	{ if (NR > 0) {
@@ -308,13 +311,13 @@ END	{ if (NR > 0) {
 	  }
 	}' \
 	    | sort -n >$tmp.out
-	    mv $tmp.out check.time
+	    mv $tmp.out $check.time
 	fi
 
-	echo "" >>check.log
-	date >>check.log
-	echo $list | fmt | sed -e 's/^/    /' -e "s;$SRC_DIR/;;g" >>check.log
-	$interrupt && echo "Interrupted!" >>check.log
+	echo "" >>$check.log
+	date >>$check.log
+	echo $list | fmt | sed -e 's/^/    /' -e "s;$SRC_DIR/;;g" >>$check.log
+	$interrupt && echo "Interrupted!" >>$check.log
         
         if [ ! -z "$n_try" -a $n_try != 0 ]
 	then
@@ -324,18 +327,18 @@ END	{ if (NR > 0) {
 	if [ ! -z "$notrun" ]
 	then
 	    echo "Not run:$notrun"
-	    echo "Not run:$notrun" >>check.log
+	    echo "Not run:$notrun" >>$check.log
 	fi
 
         if [ ! -z "$n_bad" -a $n_bad != 0 ]
 	then
 	    echo "Failures:$bad"
 	    echo "Failed $n_bad of $n_try tests"
-	    echo "Failures:$bad" | fmt >>check.log
-	    echo "Failed $n_bad of $n_try tests" >>check.log
+	    echo "Failures:$bad" | fmt >>$check.log
+	    echo "Failed $n_bad of $n_try tests" >>$check.log
 	else
 	    echo "Passed all $n_try tests"
-	    echo "Passed all $n_try tests" >>check.log
+	    echo "Passed all $n_try tests" >>$check.log
 	fi
 	needwrap=false
     fi
@@ -346,10 +349,19 @@ END	{ if (NR > 0) {
 
 trap "_wrapup; exit \$status" 0 1 2 3 15
 
+mkdir -p $RESULT_BASE
+if [ ! -d $RESULT_BASE ]; then
+	echo "failed to create results directory $RESULTS_BASE"
+	exit 1;
+fi
+
+seq="check"
+check="$RESULT_BASE/check"
+
 # don't leave old full output behind on a clean run
-rm -f check.full
+rm -f $check.full
 
-[ -f check.time ] || touch check.time
+[ -f $check.time ] || touch $check.time
 
 # print out our test configuration
 echo "FSTYP         -- `_full_fstyp_details`"
@@ -385,13 +397,7 @@ if [ ! -z "$SCRATCH_DEV" ]; then
   fi
 fi
 
-mkdir -p $RESULT_BASE
-if [ ! -d $RESULT_BASE ]; then
-	echo "failed to create results directory $RESULTS_BASE"
-	exit 1;
-fi
-
-seq="check"
+seqres="$check"
 _check_test_fs
 
 for seq in $list
@@ -432,7 +438,7 @@ do
 	fi
 
 	# slashes now in names, sed barfs on them so use grep
-	lasttime=`grep -w ^$seq check.time | awk '// {print $2}'`
+	lasttime=`grep -w ^$seqnum $check.time | awk '// {print $2}'`
 	if [ "X$lasttime" != X ]; then
 		echo -n " ${lasttime}s ..."
 	else
-- 
1.7.10.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-05-01  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01  8:31 [PATCH 0/5] xfstests: various fixes Dave Chinner
2013-05-01  8:31 ` Dave Chinner [this message]
2013-05-03 14:24   ` [PATCH 1/5] xfstests: fix last test runtime output Rich Johnston
2013-05-01  8:32 ` [PATCH 2/5] xfstests: 310 fails with existing directory error Dave Chinner
2013-05-03 14:25   ` Rich Johnston
2013-05-01  8:32 ` [PATCH 3/5] xfstests: filter EA paths used by dump Dave Chinner
2013-05-03 14:25   ` Rich Johnston
2013-05-01  8:32 ` [PATCH 4/5] xfstests: fix incorrect redirect in generic/232 Dave Chinner
2013-05-03 14:26   ` Rich Johnston
2013-05-01  8:32 ` [PATCH 5/5] xfstests: fix broken redirects in generic/131 Dave Chinner
2013-05-03 14:26   ` Rich Johnston
2013-05-01  9:31 ` [PATCH 0/5] xfstests: various fixes Dave Chinner
2013-05-03 14:32   ` Rich Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367397123-2530-2-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox