/[escript]/trunk/scripts/prepare.py
ViewVC logotype

Diff of /trunk/scripts/prepare.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2252 by jfenwick, Fri Feb 6 06:25:21 2009 UTC revision 2253 by jfenwick, Sun Feb 8 23:35:28 2009 UTC
# Line 12  EXECUTELOCATION="/scratch/jfenwick/AUTOT Line 12  EXECUTELOCATION="/scratch/jfenwick/AUTOT
12  OUTSIDEDIR=os.getcwd()  OUTSIDEDIR=os.getcwd()
13  TESTSLEEP=30*60  TESTSLEEP=30*60
14    
15    SRCMSG="This message was sent by prepare.py running as "+str(os.environ['USER'])+" on "+str(os.environ['HOSTNAME']+"\n")
16    
17  #Settings for actual tests appear below the class declarations  #Settings for actual tests appear below the class declarations
18    
19    
# Line 20  def failure(msg): Line 22  def failure(msg):
22      print "Should be sending mail to "+str(ERRMAIL)      print "Should be sending mail to "+str(ERRMAIL)
23      mailcmd="cat << ENDMSG |mail -s 'Esys unit tests failed to execute properly' "+ERRMAIL+"\n"      mailcmd="cat << ENDMSG |mail -s 'Esys unit tests failed to execute properly' "+ERRMAIL+"\n"
24      mailcmd=mailcmd+"Error preparing for test run:\n"+msg+"\n"      mailcmd=mailcmd+"Error preparing for test run:\n"+msg+"\n"
25        mailcmd=mailcmd+SRCMSG
26      mailcmd=mailcmd+"ENDMSG\n"      mailcmd=mailcmd+"ENDMSG\n"
27      os.system(mailcmd)      os.system(mailcmd)
28      sys.exit(1)      sys.exit(1)
# Line 48  class TestConfiguration(object): Line 51  class TestConfiguration(object):
51      res=res+"$ATTEMPTING\n\n"      res=res+"$ATTEMPTING\n\n"
52      res=res+"Tests ran from $START until $NOW.\n"      res=res+"Tests ran from $START until $NOW.\n"
53      res=res+"Log files can be found in $FINALLOGDIR.\n"      res=res+"Log files can be found in $FINALLOGDIR.\n"
     res=res+"This mail was sent from $SCRIPTNAME, running as $USER on `hostname`.\n"  
54      res=res+"END_MSG\n"      res=res+"END_MSG\n"
55      res=res+"}\n"      res=res+"}\n"
56      res=res+"function progress()\n{\n"      res=res+"function progress()\n{\n"
# Line 250  if not os.path.exists(LOGDIR+"/Success") Line 252  if not os.path.exists(LOGDIR+"/Success")
252      mailcmd="cat << ENDMSG |mail -s 'Esys unit tests failed to execute properly' "+ERRMAIL+"\n"      mailcmd="cat << ENDMSG |mail -s 'Esys unit tests failed to execute properly' "+ERRMAIL+"\n"
253      mailcmd=mailcmd+"For some reason no Success or failure is recorded for unit tests in "+LOGDIR+"\n"      mailcmd=mailcmd+"For some reason no Success or failure is recorded for unit tests in "+LOGDIR+"\n"
254      mailcmd=mailcmd+"\nAlso: the cleanup of work areas failed. "+EXECUTELOCATION+"/"+TOPDIR+" or "+OUTSIDEDIR+"/"+TOPDIR+"\n"      mailcmd=mailcmd+"\nAlso: the cleanup of work areas failed. "+EXECUTELOCATION+"/"+TOPDIR+" or "+OUTSIDEDIR+"/"+TOPDIR+"\n"
255        mailcmd=mailcmd+SRCMSG
256      mailcmd=mailcmd+"ENDMSG\n"      mailcmd=mailcmd+"ENDMSG\n"
257      os.system(mailcmd)      os.system(mailcmd)
258      sys.exit(1)      sys.exit(1)
# Line 257  if not os.path.exists(LOGDIR+"/Success") Line 260  if not os.path.exists(LOGDIR+"/Success")
260    
261  if os.path.exists(LOGDIR+"/Failure"):  if os.path.exists(LOGDIR+"/Failure"):
262      os.system("echo 'Also: the cleanup of work areas failed. "+EXECUTELOCATION+"/"+TOPDIR+" or "+OUTSIDEDIR+"/"+TOPDIR+"' >> "+LOGDIR+"/message\n")      os.system("echo 'Also: the cleanup of work areas failed. "+EXECUTELOCATION+"/"+TOPDIR+" or "+OUTSIDEDIR+"/"+TOPDIR+"' >> "+LOGDIR+"/message\n")
263        os.system("echo '"+SRCMSG+"' >> "LOGDIR+"/message\n")
264      mailcmd="cat "+LOGDIR+"/message | mail -s 'Esys unit tests failed' "+ERRMAIL+"\n"      mailcmd="cat "+LOGDIR+"/message | mail -s 'Esys unit tests failed' "+ERRMAIL+"\n"
265      os.system(mailcmd)      os.system(mailcmd)
266      sys.exit(1)      sys.exit(1)
267  #so we must have succeeded  #so we must have succeeded
268    
269  if cleanupfailure:  if cleanupfailure:
270        os.system("echo '"+SRCMSG+"' >> "LOGDIR+"/message\n")
271      mailcmd="cat "+LOGDIR+"/message | mail -s 'Esys unit tests cleanup failed - tests succeeded' "+ERRMAIL+"\n"      mailcmd="cat "+LOGDIR+"/message | mail -s 'Esys unit tests cleanup failed - tests succeeded' "+ERRMAIL+"\n"
272      res=os.system(mailcmd)      res=os.system(mailcmd)
273      sys.exit(res)      sys.exit(res)
274    else:
275        os.system("echo '"+SRCMSG+"' >> "LOGDIR+"/message\n")  
276        mailcmd="cat "+LOGDIR+"/message | mail -s 'Esys unit tests succeeded' "+ERRMAIL+"\n"
277        res=os.system(mailcmd)
278        sys.exit(res)
279    

Legend:
Removed from v.2252  
changed lines
  Added in v.2253

  ViewVC Help
Powered by ViewVC 1.1.26