[Zope-CVS] CVS: Packages/TestScripts - autotester.py:1.3

Chris Withers chrisw@nipltd.com
Thu, 7 Mar 2002 14:44:43 -0500


Update of /cvs-repository/Packages/TestScripts
In directory cvs.zope.org:/tmp/cvs-serv1926

Modified Files:
	autotester.py 
Log Message:
fixed silly things.

=== Packages/TestScripts/autotester.py 1.2 => 1.3 ===
 from os.path import join
 from sys import argv
-from os import system, makedirs, rmdir, chdir, environ, getcwd, popen3
+from os import system, makedirs, rmdir, chdir, getcwd, environ, getcwd, popen3
 from shutil import rmtree
 from mailer import send
 from xml2dict import xml2dict
@@ -41,16 +41,20 @@
     command = command[0]
     return execute(command['location'][0](),p,command['command'][0](),command['options'][0]())
 
+# get our original directory
+home = getcwd()
+
 for scenario in config['scenario']:
 
     # blow away the sandbox
-    #try:
-    #    rmtree(sandbox)
-    #except:
-    #    pass
+    chdir(home)
+    try:
+        rmtree(sandbox)
+    except:
+        pass
 
     # make an empty sand box
-    #makedirs(sandbox)
+    makedirs(sandbox)
     
     # modules tuple: (module, name, tag, location)
     modules=[]
@@ -63,7 +67,7 @@
             module['location'][0]()
             ))
 
-    for modulegroup in scenario['modulegroup']:
+    for modulegroup in scenario.get('modulegroup',[]):
         for module in config['modulegroups'][0][modulegroup()][0]['module']:
             modules.append((
                 module['name'][0](),
@@ -77,7 +81,7 @@
         # change dir to the right place
         chdir(join(sandbox,location))
         # do the checkout
-        #system(config['cvs'][0]['command'][0]()+" export -r "+tag+" -d "+name+" "+module)
+        system(config['cvs'][0]['command'][0]()+" export -r "+tag+" -d "+name+" "+module)
 
     # get the python command
     p = config['python'][0][scenario['python'][0]()][0]()
@@ -86,11 +90,11 @@
     python_version = execute('',p,'',' -c "import sys; print sys.version"')
     
     # execute the build command
-    #build_result = xml_execute(scenario['build'],p)
+    build_result = xml_execute(scenario['build'],p)
         
     # run the tests
     test_result = xml_execute(scenario['test'],p)
-
+    
     # write the results to the appropriate StringIO
     address = scenario['email'][0]()
     body = emails.get(address)