cvs commit: gump gumpy.py
ajack 2004/05/12 10:21:29 Modified:.gumpy.py Log: Trying to determine why Gumpy won't shout about failures. Revision ChangesPath 1.30 +5 -0 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- gumpy.py 10 May 2004 21:34:09 - 1.29 +++ gumpy.py 12 May 2004 17:21:29 - 1.30 @@ -418,6 +418,8 @@ published=1 except: published=0 +else: +print 'Unable to publish log file (containing failures)' # Cat to screen (if running to screen) tty=0 @@ -473,6 +475,9 @@ maildata += '\n' sendEmail(mailto,mailfrom,logTitle,mailData,mailserver,mailport) + +else: +print 'Unable to mail report of failure' # bye! sys.exit(result) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/05/12 10:48:42 Modified:.gumpy.py Log: Mail if at all possible. Revision ChangesPath 1.31 +9 -16 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- gumpy.py 12 May 2004 17:21:29 - 1.30 +++ gumpy.py 12 May 2004 17:48:42 - 1.31 @@ -40,7 +40,7 @@ LINE=' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUMP' -GUMPY_VERSION='2.0.2-alpha-0001' +GUMPY_VERSION='2.0.2-alpha-0002' def ignoreHangup(signum): pass @@ -241,6 +241,9 @@ log=open(logFile,'w',0) # Unbuffered... result=0 + +hostname='Unknown' +workspaceName='Unknown' mailserver=None mailport=None @@ -430,22 +433,12 @@ if tty or not published: catFile(sys.stdout, logFile, logTitle) -if mailserver and mailport and mailto and mailfrom and logurl: +if mailserver and mailport and mailto and mailfrom: -#:TODO: -# We need to move the gumpy.log to the log -# directory, so we can mail a URL to it. - -# :TODO: Sucky to read file into memory... -# Need to figure out attachments, if that -# helps doesn't just do same... -#tmpStream=StringIO.StringIO() -#catFile(tmpStream, logFile, logTitle) -#tmpStream.seek(0) -#logData=tmpStream.read() -#tmpStream.close() -#tmpStream=None -mailData='There is a problem with the run at : ' + logurl + '\n' +if published and logurl: +mailData='There is a problem with the run at : ' + logurl + '\n' +else: +mailData='There is a problem with the run at : ' + hostname + ':' + workspaceName + '\n' # # :TODO: Add link to log - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/05/12 10:58:51 Modified:.gumpy.py Log: If not, why not? Revision ChangesPath 1.32 +1 -1 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- gumpy.py 12 May 2004 17:48:42 - 1.31 +++ gumpy.py 12 May 2004 17:58:50 - 1.32 @@ -470,7 +470,7 @@ sendEmail(mailto,mailfrom,logTitle,mailData,mailserver,mailport) else: -print 'Unable to mail report of failure' +print 'Unable to mail report of failure : ' + `[mailserver,mailport,mailto,mailfrom]` # bye! sys.exit(result) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/05/10 14:34:09 Modified:.gumpy.py Log: If is a TTY cat log to screen. Revision ChangesPath 1.29 +8 -2 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- gumpy.py 5 May 2004 13:58:24 - 1.28 +++ gumpy.py 10 May 2004 21:34:09 - 1.29 @@ -418,8 +418,14 @@ published=1 except: published=0 - -if not published: + +# Cat to screen (if running to screen) +tty=0 +try: +tty=sys.stdout.isatty() +except: +pass +if tty or not published: catFile(sys.stdout, logFile, logTitle) if mailserver and mailport and mailto and mailfrom and logurl: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/04/20 15:53:26 Modified:.gumpy.py Log: Hmm, seems I can delete a file from the file system even though it is locked. I found then when running N at once (they all blocked). [I assume I just remove inode reference from dir, but makes creating a new gumpy.lock and locking that somewhat pointless.] So, make the first test non-blocking. Revision ChangesPath 1.20 +8 -6 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- gumpy.py 20 Apr 2004 21:18:02 - 1.19 +++ gumpy.py 20 Apr 2004 22:53:26 - 1.20 @@ -139,7 +139,7 @@ try: lock=open(lockFile,'a+') -fcntl.flock(lock.fileno(), fcntl.LOCK_EX) +fcntl.flock(lock.fileno(), fcntl.LOCK_EX | fnctl.LOCK_NB) except: failed=1 @@ -175,11 +175,13 @@ # Close it, so we can dispose of it lock.close() -# :TODO: We have issues when python is killed, we get a lock -# left around despite this finally. -os.remove(lockFile) - - +# Others might be blocked on this +try: +os.remove(lockFile) +except: +# Somehow another could delete this, even if locked... +pass + # Allow a lock lockFile=os.path.abspath('gumpy.lock') lock=establishLock(lockFile) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/04/20 16:26:55 Modified:.gumpy.py Log: Typo Revision ChangesPath 1.21 +2 -2 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- gumpy.py 20 Apr 2004 22:53:26 - 1.20 +++ gumpy.py 20 Apr 2004 23:26:55 - 1.21 @@ -139,8 +139,8 @@ try: lock=open(lockFile,'a+') -fcntl.flock(lock.fileno(), fcntl.LOCK_EX | fnctl.LOCK_NB) -except: +fcntl.flock(lock.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) +except: failed=1 else: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/04/16 09:50:41 Modified:.gumpy.py Log: Set vars so fails nicer when fails. Revision ChangesPath 1.18 +2 -0 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- gumpy.py 15 Apr 2004 13:13:26 - 1.17 +++ gumpy.py 16 Apr 2004 16:50:41 - 1.18 @@ -166,6 +166,8 @@ mailport=None mailfrom=None mailto=None +logurl=None +logdir=None args=sys.argv try: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/04/10 16:09:29 Modified:python/gump/results resulter.py model.py python/gump/model server.py workspace.py python/gump/document forrest.py .gumpy.py Log: Tinkering towards: http://issues.apache.org/jira/browse/GUMP-49 Revision ChangesPath 1.19 +28 -3 gump/python/gump/results/resulter.py Index: resulter.py === RCS file: /home/cvs/gump/python/gump/results/resulter.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- resulter.py 16 Mar 2004 23:56:41 - 1.18 +++ resulter.py 10 Apr 2004 23:09:29 - 1.19 @@ -35,6 +35,26 @@ from gump.results.model import * from gump.results.loader import * +class ResultsSet(dict): +def __init__(self): +dict.__init__(self) + +self.calculated=0 +self.differences=0 + +def hasDifferences(self): +if self.calculated: return self.differences + +lastPair=None +for result in self.values(): +statePair=result.getStatePair() +if lastPair: +self.differeces=(lastPair statePair) +lastPair=statePair + +self.calculated=1 +return self.differences + class Resulter: def __init__(self,run): @@ -51,9 +71,9 @@ return results[server] def getResultsForAllServers(self, object): -results = {} +results = ResultsSet() -# Loda on demand +# Load on demand if not self.serversLoaded: self.loadResultsForServers() @@ -98,10 +118,14 @@ log.debug('Loaded results for server [' + str(server) + ']') self.serverResults[server]=results +# Probably a hack, but might as well (for now) +# just wire the server with iht's latest results +server.setResults(results) + self.serversLoaded=1 def loadResultsForServer(self, server): -return self.loadResults(server.getUrl() + '/results.xml') +return self.loadResults(server.getResultsUrl()) def loadResults(self, url): loader = WorkspaceResultLoader() @@ -206,6 +230,7 @@ # Generate results around this run... resulter=Resulter(run) +# In the root. where=run.getOptions().getResolver().getFile(run.getWorkspace(),'results','.xml',1) # Generate the output... 1.9 +35 -1 gump/python/gump/results/model.py Index: model.py === RCS file: /home/cvs/gump/python/gump/results/model.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- model.py 6 Apr 2004 15:57:11 - 1.8 +++ model.py 10 Apr 2004 23:09:29 - 1.9 @@ -138,6 +138,12 @@ # self.moduleResults = {} self.projectResults = {} + + self.startDateTimeUtc='' + self.startDateTime='' + self.endDateTimeUtc='' + self.endDateTime='' + self.timezone='' # # Lists... @@ -155,7 +161,22 @@ def getProjectResults(self): return self.projectResults.values() - + +def getTimezone(self): +return self.timezone + +def getStartDateTime(self): +return self.startDateTime + +def getStartDateTimeUtc(self): +return self.startDateTimeUtc + +def getEndDateTime(self): +return self.endDateTime + +def getEndDateTimeUtc(self): +return self.endDateTimeUtc + # # Named... # @@ -194,6 +215,12 @@ topElement.setAttribute('name',self.getName()) topElement.setAttribute('state',self.getStateName()) topElement.setAttribute('reason',self.getReasonName()) + +topElement.setAttribute('startUtc',self.getStartDateTimeUtc()) +topElement.setAttribute('start',self.getStartDateTime()) +topElement.setAttribute('endUtc',self.getEndDateTimeUtc()) +topElement.setAttribute('end',self.getEndDateTime()) +topElement.setAttribute('tzone',self.getTimezone()) for moduleResult in self.moduleResults.values(): moduleResult.createDom(self.dom,topElement) @@ -204,6 +231,13 @@ # Workspace dom is document, but stuff on first # element
cvs commit: gump gumpy.py
ajack 2004/03/19 12:58:00 Modified:.gumpy.py Log: 1) Process (and pass on) command line arguments. [So I can test xmlutils] 2) Cope with !-- up top of the workspace XML file (above the workspace tag. Revision ChangesPath 1.11 +20 -7 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- gumpy.py 18 Mar 2004 23:24:55 - 1.10 +++ gumpy.py 19 Mar 2004 20:58:00 - 1.11 @@ -191,6 +191,7 @@ mailfrom=None mailto=None +args=sys.argv try: try: @@ -206,17 +207,25 @@ for envkey in os.environ.keys(): envval=os.environ[envkey] -log.write(' ' + envkey + ' - [' + envval + ']\n') +log.write(' ' + envkey + ' - [' + envval + ']\n') +# Workspace is the hostname, unless overridden workspaceName = hostname + '.xml' if os.environ.has_key('GUMP_WORKSPACE'): -workspaceName = os.environ['GUMP_WORKSPACE'] + '.xml' +workspaceName = os.environ['GUMP_WORKSPACE'] + '.xml' +if len(args)2 and args[1] in ['-w','--workspace']: +workspaceName=args[2] +del args[1:3] workspacePath = os.path.abspath(workspaceName) projectsExpr='all' if os.environ.has_key('GUMP_PROJECTS'): -projectsExpr = os.environ['GUMP_PROJECTS'] +projectsExpr = os.environ['GUMP_PROJECTS'] +if len(args)1: +projectsExpr=args[1] +del args[1:2] +# Nope, can't find the workspace... if not os.path.exists(workspacePath): raise RuntimeError('No such workspace at ' + str(workspacePath)) @@ -224,7 +233,11 @@ # Process the workspace... # ws = minidom.parse(workspacePath) -wsw=ws.firstChild +workspaceElementList=ws.getElementsByTagName('workspace') +if not workspaceElementList.length == 1: +raise RuntimeError('Need one (only) workspace tag. Found ' + \ + ` workspaceElementList.length` + '.') +wsw=workspaceElementList.item(0) wsName=wsw.getAttribute('name') # Extract the base directory baseDir=wsw.getAttribute('basedir') @@ -289,11 +302,11 @@ # # Process/build command line # -iargs = '-w ../' + workspaceName + ' ' + projectsExpr + ' ' + ' '.join(sys.argv[1:]) - +iargs = '-w ../' + workspaceName + ' ' + projectsExpr + ' ' + ' '.join(args[1:]) + # Allow a check not an integrate check=0 -if '--check' in sys.argv: +if '--check' in args: check=0 # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/03/01 13:35:31 Modified:.gumpy.py Log: Send url to log, don't send whole log... Revision ChangesPath 1.4 +12 -8 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- gumpy.py 25 Feb 2004 00:00:03 - 1.3 +++ gumpy.py 1 Mar 2004 21:35:31 - 1.4 @@ -234,7 +234,8 @@ mailserver=wsw.getAttribute('mailserver') mailport=wsw.getAttribute('mailport') or 25 mailto=wsw.getAttribute('mailinglist') -mailfrom=wsw.getAttribute('email') +mailfrom=wsw.getAttribute('email') +logurl=wsw.getAttribute('logurl') # Extract the mail server/address ws.unlink() @@ -248,6 +249,8 @@ log.write('- GUMP mail from : ' + mailfrom + '\n') if mailto: log.write('- GUMP mail to: ' + mailto + '\n') +if logurl: +log.write('- GUMP log is @ : ' + logurl + '\n') # # Add Gump to Python Path... @@ -314,16 +317,17 @@ # Cat log if failed... catFile(sys.stdout, logFile, logTitle) -if mailserver and mailport and mailto and mailfrom: +if mailserver and mailport and mailto and mailfrom and logurl: # :TODO: Sucky to read file into memory... # Need to figure out attachments, if that # helps doesn't just do same... -tmpStream=StringIO.StringIO() -catFile(tmpStream, logFile, logTitle) -tmpStream.seek(0) -logData=tmpStream.read() -tmpStream.close() -tmpStream=None +#tmpStream=StringIO.StringIO() +#catFile(tmpStream, logFile, logTitle) +#tmpStream.seek(0) +#logData=tmpStream.read() +#tmpStream.close() +#tmpStream=None +logData='There is a problem with the run at : ' + logurl sendEmail(mailto,mailfrom,logTitle,logData,mailserver,mailport) # bye! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/03/01 13:49:30 Modified:.gumpy.py Log: I hate that Gumpy resolves workspaces relative to ../ 'cos it runs under ./python Revision ChangesPath 1.6 +1 -1 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- gumpy.py 1 Mar 2004 21:46:52 - 1.5 +++ gumpy.py 1 Mar 2004 21:49:30 - 1.6 @@ -212,7 +212,7 @@ if os.environ.has_key('GUMP_WORKSPACE'): workspaceName = os.environ['GUMP_WORKSPACE'] + '.xml' -workspacePath = os.path.abspath(os.path.join('python',workspaceName)) +workspacePath = os.path.abspath(workspaceName) projectsExpr='*' if os.environ.has_key('GUMP_PROJECTS'): - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: gump gumpy.py
ajack 2004/03/01 13:56:23 Modified:.gumpy.py Log: The projects expression '*' gets expanded, so pass 'all'. Revision ChangesPath 1.7 +1 -1 gump/gumpy.py Index: gumpy.py === RCS file: /home/cvs/gump/gumpy.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- gumpy.py 1 Mar 2004 21:49:30 - 1.6 +++ gumpy.py 1 Mar 2004 21:56:23 - 1.7 @@ -214,7 +214,7 @@ workspacePath = os.path.abspath(workspaceName) -projectsExpr='*' +projectsExpr='all' if os.environ.has_key('GUMP_PROJECTS'): projectsExpr = os.environ['GUMP_PROJECTS'] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]