ajack 2004/07/21 19:54:39 Modified: python/gump/update artifact.py python/gump/test __init__.py launching.py stats.py timing.py notifying.py utils.py pyunit.py python/gump/notify notifier.py python/gump/utils smtp.py src/documentation/content/xdocs index.xml gettingstarted.xml . .cvsignore python/gump/model repository.py Log: 1) Some documentation work 2) Some unit testing related fixes 3) More debug on SMTP failures. Revision Changes Path 1.5 +21 -12 gump/python/gump/update/artifact.py Index: artifact.py =================================================================== RCS file: /home/cvs/gump/python/gump/update/artifact.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- artifact.py 19 Jul 2004 16:07:55 -0000 1.4 +++ artifact.py 22 Jul 2004 02:54:38 -0000 1.5 @@ -16,7 +16,7 @@ # limitations under the License. """ - + The artifact updater """ import os.path @@ -53,10 +53,8 @@ RunSpecific.__init__(self,run) def updateModule(self,module): - """ - - Perform an Artifact update on a module - + """ + Perform an Artifact update on a module """ log.info('Perform Artifact Update on #[' + `module.getPosition()` + \ '] : ' + module.getName()) @@ -70,9 +68,7 @@ # Execute the command and capture results cmdResult=execute(cmd, module.getWorkspace().tmpdir) - # # Store this as work, on both the module and (cloned) on the repo - # work=CommandWorkItem(WORK_TYPE_UPDATE,cmd,cmdResult) module.performedWork(work) module.getRepository().performedWork(work.clone()) @@ -93,15 +89,16 @@ # Kinda bogus, but better than nowt (for now) module.changeState(STATE_SUCCESS,REASON_UPDATE_FAILED) else: + self.mapArtifacts(module) + module.changeState(STATE_SUCCESS) return module.okToPerformWork() - def preview(self,module): - command = self.getArtifactUpdateCommand(module) - command.dump() - def getArtifactUpdateCommand(self,module): + """ + Create the Depot command line for updating this module. + """ log.debug("Artifact Update Module " + module.getName() + \ ", Repository Name: " + str(module.repository.getName())) @@ -139,4 +136,16 @@ cmd.addParameter(module.getName()) return cmd - + + def mapArtifacts(self,module): + """ + Map the artifacts to jars ids (within projects) + """ + + def preview(self,module): + """ + Preview the command + """ + command = self.getArtifactUpdateCommand(module) + command.dump() + 1.16 +1 -1 gump/python/gump/test/__init__.py Index: __init__.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/__init__.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- __init__.py 19 Jul 2004 16:07:55 -0000 1.15 +++ __init__.py 22 Jul 2004 02:54:38 -0000 1.16 @@ -58,7 +58,7 @@ workspace=getTestWorkspace(xml) # Load statistics for this workspace - db=StatisticsDB(dir.test,'test.db') + db=StatisticsDB(gump.core.config.dir.test,'test.db') db.loadStatistics(workspace) # Some file items... 1.2 +18 -0 gump/python/gump/test/launching.py Index: launching.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/launching.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- launching.py 14 Jul 2004 20:47:02 -0000 1.1 +++ launching.py 22 Jul 2004 02:54:38 -0000 1.2 @@ -26,6 +26,24 @@ def __init__(self): UnitTestSuite.__init__(self) + def testSpacesInCommandLines(self): + params=gump.process.command.Parameters() + params.addParameter('NoSpaces', 'aaaaa','=') + params.addParameter('WithValueSpaces', 'aa aa a','=') + params.addParameter('With Name Spaces', 'aaaaa','=') + params.addParameter('WithQuotesAndSpaces', 'aa \' \" aa a','=') + params.addParameter('WithEscapes', 'aa\\a','=') + + #print params.formatCommandLine() + + params=gump.process.command.Parameters() + params.addPrefixedParameter('-D','X', 'aaaaa','=') + params.addPrefixedParameter('-D','Y', 'aa aa a','=') + params.addPrefixedParameter('-D','Z', 'aa \' aa a','=') + params.addPrefixedParameter('-D','Z', 'aa \" aa a','=') + + #print params.formatCommandLine() + def testGoodLaunch(self): env=gump.process.command.Cmd('env') result=gump.process.launcher.execute(env) 1.12 +2 -0 gump/python/gump/test/stats.py Index: stats.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/stats.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- stats.py 21 May 2004 23:15:00 -0000 1.11 +++ stats.py 22 Jul 2004 02:54:38 -0000 1.12 @@ -24,6 +24,8 @@ from gump import log import gump.core.config from gump.stats.statsdb import * +from gump.utils import * +from gump.utils.timing import * from gump.test import getWorkedTestWorkspace from gump.test.pyunit import UnitTestSuite 1.4 +1 -0 gump/python/gump/test/timing.py Index: timing.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/timing.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- timing.py 14 Jul 2004 20:47:02 -0000 1.3 +++ timing.py 22 Jul 2004 02:54:38 -0000 1.4 @@ -18,6 +18,7 @@ """ from gump.utils import * +from gump.utils.timing import * from gump.test.pyunit import UnitTestSuite class TimingTestSuite(UnitTestSuite): 1.6 +21 -15 gump/python/gump/test/notifying.py Index: notifying.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/notifying.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- notifying.py 19 Jul 2004 16:07:55 -0000 1.5 +++ notifying.py 22 Jul 2004 02:54:38 -0000 1.6 @@ -30,7 +30,7 @@ from gump.test.pyunit import UnitTestSuite from gump.notify.notifier import Notifier -from gump.notify.notification import PositiveNotification,NegativeNotification +from gump.notify.notification import SuccessNotification,FailureNotification,WarningNotification from gump.utils.smtp import * class NotificationTestSuite(UnitTestSuite): @@ -53,38 +53,44 @@ def testNotificationContents(self): resolver=self.run.getOptions().getResolver() - content1=PositiveNotification(self.run, self.workspace).resolveContent(resolver) - content2=NegativeNotification(self.run, self.workspace).resolveContent(resolver) + content1=SuccessNotification(self.run, self.workspace).resolveContent(resolver) + content2=FailureNotification(self.run, self.workspace).resolveContent(resolver) + content3=WarningNotification(self.run, self.workspace).resolveContent(resolver) #print content1 #print content2 + #print content3 # For all modules... for module in self.workspace.getModules(): #print 'Get Content For Module : ' + module.getName() - content1=PositiveNotification(self.run, module).resolveContent(resolver) - content2=NegativeNotification(self.run, module).resolveContent(resolver) + content1=SuccessNotification(self.run, module).resolveContent(resolver) + content2=FailureNotification(self.run, module).resolveContent(resolver) + content3=WarningNotification(self.run, module).resolveContent(resolver) #print content1 #print content2 + #print content3 for project in module.getProjects(): #print 'Get Content For Project : ' + project.getName() # print - content1=PositiveNotification(self.run, project).resolveContent(resolver) - content2=NegativeNotification(self.run, project).resolveContent(resolver) + content1=SuccessNotification(self.run, project).resolveContent(resolver) + content2=FailureNotification(self.run, project).resolveContent(resolver) + content3=WarningNotification(self.run, project).resolveContent(resolver) #print content1 #print content2 + #print content3 def testNotifyUnwantedUnsent(self): notifier=Notifier(self.run) - self.assertFalse( 'No Unwanted', notifier.hasUnwanted() ) - self.assertFalse( 'No Unsent', notifier.hasUnsent() ) + self.assertFalse( 'No Unwanted', notifier._hasUnwanted() ) + self.assertFalse( 'No Unsent', notifier._hasUnsent() ) - notifier.addUnwanted('test subject','test content') - notifier.addUnsent('test subject','test content') + notifier._addUnwanted('test subject','test content') + notifier._addUnsent('test subject','test content') - self.assertTrue( 'Has Unwanted', notifier.hasUnwanted() ) - self.assertTrue( 'Has Unsent', notifier.hasUnsent() ) + self.assertTrue( 'Has Unwanted', notifier._hasUnwanted() ) + self.assertTrue( 'Has Unsent', notifier._hasUnsent() ) def testNotifyAddresses(self): @@ -121,6 +127,6 @@ 'Test Content') #print str(email) - notifier.getUnwantedContent() - notifier.getUnsentContent() + notifier._getUnwantedContent() + notifier._getUnsentContent() 1.16 +0 -19 gump/python/gump/test/utils.py Index: utils.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/utils.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- utils.py 14 Jul 2004 20:47:02 -0000 1.15 +++ utils.py 22 Jul 2004 02:54:38 -0000 1.16 @@ -32,25 +32,6 @@ def suiteSetUp(self): self.now=default.time - - def testSpacesInCommandLines(self): - params=Parameters() - params.addParameter('NoSpaces', 'aaaaa','=') - params.addParameter('WithValueSpaces', 'aa aa a','=') - params.addParameter('With Name Spaces', 'aaaaa','=') - params.addParameter('WithQuotesAndSpaces', 'aa \' \" aa a','=') - params.addParameter('WithEscapes', 'aa\\a','=') - - #print params.formatCommandLine() - - params=Parameters() - params.addPrefixedParameter('-D','X', 'aaaaa','=') - params.addPrefixedParameter('-D','Y', 'aa aa a','=') - params.addPrefixedParameter('-D','Z', 'aa \' aa a','=') - params.addPrefixedParameter('-D','Z', 'aa \" aa a','=') - - #print params.formatCommandLine() - def testWrap(self): eol='\n' 1.36 +1 -0 gump/python/gump/test/pyunit.py Index: pyunit.py =================================================================== RCS file: /home/cvs/gump/python/gump/test/pyunit.py,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- pyunit.py 14 Jul 2004 20:47:02 -0000 1.35 +++ pyunit.py 22 Jul 2004 02:54:38 -0000 1.36 @@ -373,6 +373,7 @@ from gump.test.launching import LaunchingTestSuite runner.addSuite(LaunchingTestSuite()) + # Any args are pattern matches patterns=list(sys.argv) 1.12 +5 -4 gump/python/gump/notify/notifier.py Index: notifier.py =================================================================== RCS file: /home/cvs/gump/python/gump/notify/notifier.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- notifier.py 21 Jul 2004 14:54:34 -0000 1.11 +++ notifier.py 22 Jul 2004 02:54:38 -0000 1.12 @@ -358,14 +358,13 @@ #print 'Server:' + `self.workspace.mailserver` #print 'e-mail:' + `email` # Fire ... - sent=mail(toaddrs,fromaddr,email, \ - self.workspace.mailserver, \ + sent=mail(toaddrs,fromaddr,email, + self.workspace.mailserver, self.workspace.mailport) except Exception, details: sent=False - log.error('Failed to send notify e-mail: ' + str(details), \ - exc_info=1) + log.error('Failed to send notify e-mail: ' + str(details), exc_info=1) # Add why unset along with content stored (and e-mailed) below. content = 'Failed to send notify e-mail: ' + str(details) + '\n' + content @@ -375,5 +374,7 @@ self._addUnsent(subject,content) log.error('Failed with to: ['+str(toaddr)+'] from: ['+str(fromaddr)+']' ) + else: + self.sents+=1 return sent 1.3 +15 -6 gump/python/gump/utils/smtp.py Index: smtp.py =================================================================== RCS file: /home/cvs/gump/python/gump/utils/smtp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- smtp.py 8 Jul 2004 20:33:06 -0000 1.2 +++ smtp.py 22 Jul 2004 02:54:38 -0000 1.3 @@ -93,7 +93,7 @@ else: data = EmailMessage(toaddrs,fromaddr,'',str(message)).getSerialized() - sent=0 + sent=False try: # # Attach to the SMTP server to send.... @@ -103,16 +103,25 @@ failures = server.sendmail(sane_fromaddr, sane_toaddrs, data) server.quit() - # Note: w/o an exception it was accepted to some folk... - # Failures is a list of tuples of error code plus recipient - # that was refused. - if not failures: sent=1 + # Note: w/o an exception it was accepted to some folk... + # Failures is a list of tuples of error code plus recipient + # that was refused. + + if not failures: + sent=True + else: + for failure in failures: + log.error('Failed to send e-mail to : ' + `failure`) except Exception, details: - sent=0 + sent=False + log.error('Failed to send e-mail: ' + str(details)) log.error(data, exc_info=1) log.error('Server :' + str(server) + ' From :' + str(fromaddr) + ' To :' + str(toaddrs)) + + # Keep it going... + raise return sent 1.10 +10 -38 gump/src/documentation/content/xdocs/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/gump/src/documentation/content/xdocs/index.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- index.xml 9 Mar 2004 14:53:53 -0000 1.9 +++ index.xml 22 Jul 2004 02:54:38 -0000 1.10 @@ -117,19 +117,16 @@ </section> <section><title>When does Gump run?</title> - <p> - For Gump to have the desired social effects, it must be predictable. - Given the global scale of open source development, there is clearly no - one time when everyone is inactive. - </p> <p> - The run at midnight US/Pacific time causes nag emails to be sent. - Interrim runs are now done evey eight hours, based on the hardware kindly - donated by Sun and Covalent. Below is the schedule for all runs relative - to several representative time zones. + Gump runs continually in various locations, primarily on Apache hardware, see below. </p> + <note> + Gump operates best in when distributed (over various servers). Please contact us if you are willing to + contribute resources to this project. + </note> + <table> <tr> <th>Site</th> @@ -137,38 +134,13 @@ <th>Comments</th> </tr> <tr> - <td><link href="http://cvs.apache.org/builds/gump/latest">Rubix</link> </td> - <td/> - <td><strong>Unavailable</strong></td> - </tr> - <tr> - <td><link href="http://nagoya.apache.org/~rubys/gump/">Nagoya</link> </td> - <td/> - <td><strong>Unavailable</strong></td> - </tr> - <tr> - <td><link href="http://gump.covalent.net/log/index.html">Covalent</link> </td> - <td>1.4.0_00-b05</td> - <td>Traditional Gump</td> - </tr> - <tr> - <td><link href="http://gump.cocoondev.org/">CocoonDev</link> </td> - <td/> - <td>Traditional Gump</td> - </tr> - <tr> - <td><link href="http://lsd.student.utwente.nl/gump/">LSD</link> </td> - <td>1.4.2-b28</td> - <td>Python Gump</td> - </tr> - <tr> - <td><link href="http://gump.dotnot.org/">DotNot</link> </td> - <td>1.4.1_02-b06</td> + <td><fork href="http://brutus.apache.org/gump/public/">Apache (Brutus)</fork> </td> + <td>1.4.2_04</td> <td>Python Gump</td> </tr> <tr> - <td><link href="http://gump.try.sybase.com/">TrySybase</link> </td> - <td>1.4.2_03</td> + <td><fork href="http://brutus.apache.org/gump/jdk15/">Apache (Brutus) JDK15</fork> </td> + <td>1.5.0-beta2</td> <td>Python Gump</td> </tr> </table> 1.9 +5 -15 gump/src/documentation/content/xdocs/gettingstarted.xml Index: gettingstarted.xml =================================================================== RCS file: /home/cvs/gump/src/documentation/content/xdocs/gettingstarted.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- gettingstarted.xml 29 Feb 2004 19:03:39 -0000 1.8 +++ gettingstarted.xml 22 Jul 2004 02:54:38 -0000 1.9 @@ -99,10 +99,10 @@ <li>SVN -- <fork href="http://subversion.tigris.org">Subversion</fork></li> </ul> </section> - <section><title>Jar Download</title> + <section><title>Jar Downloading</title> <p>This is optional.</p> <ul> - <li>Ruper -- <fork href="http://incubator.apache.org/projects/ruper.html">Resource Updater</fork></li> + <li>Ruper -- <fork href="http://incubator.apache.org/depot">Depot Updater</fork></li> </ul> </section> </section> @@ -119,23 +119,13 @@ </section> <section><title>Defining your workspace</title> - <p>Two sample workspaces are provided, rubix and rubypad. Find the - one that is closest to your needs and make a copy of it. The suggested + <p>Sample workspaces are provided, 'gump' and 'minimal-workspace'. Find + take one an edit it to fit your environment/needs. The suggested name for the file you create is your host name.</p> <p>Again, reference the <link href="site:om/overview">overview</link> to see how you can add projects, define your own profiles, and the modify which version of referenced projects you want to build.</p> - - <p>You will also need to directly modify the <code>gen.bat</code> - or <code>gen.sh</code> scripts to specify where to find the JAXP - implementation to use. At the present time, recent releases of - Xalan are recommended for performance reasons; but the JAXP - reference implementation will likely catch up shortly.</p> - - <p><strong>Note:</strong> Yes, it is tacky that you should have to modify this - file directly. Patches are welcome. Meanwhile, cvs does a fairly - good job of merging changes.</p> </section> <section><title>Installing Packages</title> @@ -146,7 +136,7 @@ </p> <p>A list of some of the packages you might want to install can be found - <link href="http://cvs.apache.org/builds/gump/latest/packages.html"> + <link href="http://brutus.apache.org/gump/public/packages.html"> here</link>.</p> <p><strong>JDK 1.4</strong> includes both <code>jaxp</code> and <code>jsse</code> 1.25 +1 -3 gump/.cvsignore Index: .cvsignore =================================================================== RCS file: /home/cvs/gump/.cvsignore,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- .cvsignore 8 Jul 2004 20:33:10 -0000 1.24 +++ .cvsignore 22 Jul 2004 02:54:39 -0000 1.25 @@ -21,9 +21,7 @@ tsws1.xml test x.txt -gumpy.log -*_log.txt -*_runlog.txt +gumpy*log*.txt gumpy.lock out.tmp *.wpr 1.15 +2 -0 gump/python/gump/model/repository.py Index: repository.py =================================================================== RCS file: /home/cvs/gump/python/gump/model/repository.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- repository.py 14 Jul 2004 18:12:12 -0000 1.14 +++ repository.py 22 Jul 2004 02:54:39 -0000 1.15 @@ -28,7 +28,9 @@ class Repository(NamedModelObject, Statable): """ + A named repository (CVS|SVN|Artifacts) + """ def __init__(self,name,dom,workspace): NamedModelObject.__init__(self,name,dom,workspace)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]