Skip to contentSkip to conversation

Add start and end times to the report.

TOOLS Applied Tony Breeds 2 participants 3 messages Nov 10, 2006

lore
Share & tools
lore
#0 lore raw

When running tests unattended it's useful to know how long they have taken, as (significantly) increasing the runtime (without introducing failures) can be considered a regression. This patch adds a block like:

====
Xm-test timing summary:
Run Started : Fri, 10 Nov 2006 14:53:18 +1100
Run Stopped : Fri, 10 Nov 2006 14:53:20 +1100
====

to the generated report.

---
 tools/xm-test/runtest.sh |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

---

tools/xm-test/runtest.sh Fri Nov 10 14:54:04 2006 +1100 renamed from tools/xm-test/runtest.sh Mon Nov 06 11:02:51 2006 +1100 +16 -3
diff -r a713b09f2cb2 tools/xm-test/runtest.sh
@@ -133,7 +133,11 @@ run_tests() {
 run_tests() {
     groupentered=$1
     output=$2
-
+    report=$3
+    startfile=${report}.start
+    stopfile=${report}.stop
+
+    echo `date -R` > $startfile
     exec <  grouptest/$groupentered
     while read casename testlist; do
        echo Running $casename tests...
@@ -147,6 +151,7 @@ run_tests() {
        fi
 
     done
+    echo `date -R` > $stopfile
 
 }
 
@@ -156,7 +161,10 @@ make_text_reports() {
     failures=$2
     output=$3
     reportfile=$4
+    report=$5
     summary=summary.tmp
+    startfile=${report}.start
+    stopfile=${report}.stop
     echo "Making PASS/FAIL report ($passfail)..."
     cat $OUTPUT | egrep '(REASON|PASS|FAIL|XPASS|XFAIL|SKIP)' | perl -pe 's/^(PASS|FAIL|XPASS|XFAIL)(.+)$/$1$2\n/' > $passfail
     
@@ -167,7 +175,12 @@ make_text_reports() {
     NUMFAIL=`grep -c FAIL $output`
     NUMXPASS=`grep -c XPASS $output`
     NUMXFAIL=`grep -c XFAIL $output`
+    START=`cat $startfile`
+    STOP=`cat $stopfile`
     cat > $summary << EOF
+Xm-test timing summary:
+  Run Started : $START
+  Run Stopped : $STOP
 Xm-test execution summary:
   PASS:  $NUMPASS
   FAIL:  $NUMFAIL
@@ -289,8 +302,8 @@ if [ "$run" != "no" ]; then
     if [ "$unsafe" = "no" ]; then
       make_environment_report $OSREPORTTEMP $PROGREPORTTEMP
     fi
-    run_tests $GROUPENTERED $OUTPUT
-    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT
+    run_tests $GROUPENTERED $OUTPUT $REPORT
+    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT $REPORT
     if [ "$unsafe" = "no" ]; then
       make_result_report $OUTPUT $RESULTREPORTTEMP
       cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

#1 lore raw

Please ignore the previous patch, as "echo date -R > $startfile", is more than a little silly ;P

From: Tony Breeds <[email protected]>

When running tests unattended it's useful to know how long they have taken, as (significantly) increasing the runtime (without introducing failures) can be considered a regression. This patch adds a block like:

====
Xm-test timing summary:
Run Started : Fri, 10 Nov 2006 14:53:18 +1100
Run Stopped : Fri, 10 Nov 2006 14:53:20 +1100
====

to the generated report.

---
Additionals ....

 tools/xm-test/runtest.sh |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

---

tools/xm-test/runtest.sh Fri Nov 10 15:10:54 2006 +1100 renamed from tools/xm-test/runtest.sh Mon Nov 06 11:02:51 2006 +1100 +16 -3
diff -r a713b09f2cb2 tools/xm-test/runtest.sh
@@ -133,7 +133,11 @@ run_tests() {
 run_tests() {
     groupentered=$1
     output=$2
-
+    report=$3
+    startfile=${report}.start
+    stopfile=${report}.stop
+
+    date -R > $startfile
     exec <  grouptest/$groupentered
     while read casename testlist; do
        echo Running $casename tests...
@@ -147,6 +151,7 @@ run_tests() {
        fi
 
     done
+    date -R > $stopfile
 
 }
 
@@ -156,7 +161,10 @@ make_text_reports() {
     failures=$2
     output=$3
     reportfile=$4
+    report=$5
     summary=summary.tmp
+    startfile=${report}.start
+    stopfile=${report}.stop
     echo "Making PASS/FAIL report ($passfail)..."
     cat $OUTPUT | egrep '(REASON|PASS|FAIL|XPASS|XFAIL|SKIP)' | perl -pe 's/^(PASS|FAIL|XPASS|XFAIL)(.+)$/$1$2\n/' > $passfail
     
@@ -167,7 +175,12 @@ make_text_reports() {
     NUMFAIL=`grep -c FAIL $output`
     NUMXPASS=`grep -c XPASS $output`
     NUMXFAIL=`grep -c XFAIL $output`
+    START=`cat $startfile`
+    STOP=`cat $stopfile`
     cat > $summary << EOF
+Xm-test timing summary:
+  Run Started : $START
+  Run Stoped  : $STOP
 Xm-test execution summary:
   PASS:  $NUMPASS
   FAIL:  $NUMFAIL
@@ -289,8 +302,8 @@ if [ "$run" != "no" ]; then
     if [ "$unsafe" = "no" ]; then
       make_environment_report $OSREPORTTEMP $PROGREPORTTEMP
     fi
-    run_tests $GROUPENTERED $OUTPUT
-    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT
+    run_tests $GROUPENTERED $OUTPUT $REPORT
+    make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT $REPORT
     if [ "$unsafe" = "no" ]; then
       make_result_report $OUTPUT $RESULTREPORTTEMP
       cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

Applied
#2 lore raw
Quoted 15 lines · Tony Breeds

Please ignore the previous patch, as "echo date -R > $startfile", is more than a little silly ;P

From: Tony Breeds <[email protected]>

When running tests unattended it's useful to know how long they have taken, as (significantly) increasing the runtime (without introducing failures) can be considered a regression. This patch adds a block like:

====
Xm-test timing summary:
Run Started : Fri, 10 Nov 2006 14:53:18 +1100
Run Stopped : Fri, 10 Nov 2006 14:53:20 +1100
====

Quoted 4 lines

to the generated report.

Applied, thanks Tony.

Ewan.