[m-rev.] diff: improve nightly test status report mail

Simon Taylor stayl at cs.mu.OZ.AU
Wed Aug 22 03:55:48 AEST 2001



Estimated hours taken: 0.25

Improve the nightly test status report mail.

tools/run_all_tests_from_cron:
	Use `mutt' rather than `mail' to send the mail, now that
	`mutt' is available on all machines that we run tests on.
	On Linux, `mail' does not recognize a `Subject: ' line at
	the start of the mail to send as a subject header, so
	use `mutt -s'.
		
	State whether the test failed in the subject of the mail.

	Reduce the length of the subject line to keep it within
	the screen boundary.

	Send the test results to stayl rather than fjh.


Index: run_all_tests_from_cron
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/run_all_tests_from_cron,v
retrieving revision 1.33
diff -u -u -r1.33 run_all_tests_from_cron
--- run_all_tests_from_cron	2001/08/15 16:41:02	1.33
+++ run_all_tests_from_cron	2001/08/21 17:54:53
@@ -45,12 +45,6 @@
 	mars)		ARCH=i686	FULLARCH=i686-pc-linux-gnu ;;
 	*)		echo "$0: unknown HOST $HOST" 1>&2; exit 1 ;;
 esac
-	
-case $HOST in
-	kryten|taifun) 	mail="rsh mundook /bin/mail" ;;
-	hydra|ender|roy|venus|earth|mars) mail=/usr/bin/mail ;;
-	*)		mail=/bin/mail ;;
-esac
 
 #-----------------------------------------------------------------------------#
 
@@ -127,8 +121,6 @@
 tmpfile=/tmp/run_test$$
 trap 'rm -f $tmpfile $tmpscript; exit 1' 1 2 3 13 15
 {
-echo "Subject: Mercury auto-test: $BRANCH $HOST $C_COMPILER"
-echo
 if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH $BRANCH $C_COMPILER \
 		> $logfile 2>&1
 then
@@ -157,6 +149,7 @@
 		size mercury_compile
 		echo
 	} >> $tm_dir/logs/sizes
+	test_status="succeeded"
 else
 	fgrep '**' $logfile > $logfile.errs
 	echo test FAILED
@@ -165,11 +158,15 @@
 	echo
 	echo last 20 lines of log file:
 	tail -20 $logfile
+	test_status="FAILED"
 fi
 } > $tmpfile 2>&1
-# NB we can't just pipe into $mail, because $mail times out while
+
+# NB we can't just pipe into `mail', because `mail' times out while
 # waiting for the message.  So we need to use a temp file.
-$mail fjh < $tmpfile
+# XXX This may not be necessary now we're using mutt on the local
+# machine to send the mail.
+mutt -s "test_mercury $test_status: $BRANCH $HOST $C_COMPILER" stayl < $tmpfile
 rm -f $tmpfile $tmpscript
 
 #-----------------------------------------------------------------------------#
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list