[Zope-CVS] CVS: Packages/TestScripts - backgroundtester.py:1.5
Jens Vagelpohl
jens@zope.com
Fri, 25 Jan 2002 13:29:46 -0500
Update of /cvs-repository/Packages/TestScripts
In directory cvs.zope.org:/tmp/cvs-serv31631
Modified Files:
backgroundtester.py
Log Message:
Added some comments and one small fix
=== Packages/TestScripts/backgroundtester.py 1.4 => 1.5 ===
LOG_BUFFER = []
+# Must tweak this for every machine
PYTHONS = { 'Python 2.1' : '/usr/local/bin/python2.1'
, 'Python 2.2' : '/usr/local/bin/python2.2'
}
@@ -31,6 +32,7 @@
}
}
+# The combinations to be tested
TESTS = ( { 'zope' : 'HEAD'
, 'pythons' : ( 'Python 2.1', 'Python 2.2' )
, 'prods' : { 'CMF' : 'HEAD'
@@ -52,6 +54,7 @@
)
+# Pretty stuff to put in between testing output
TEST_DIVIDER = """\n\n***************************************************
**
** Zope %s (%s)
@@ -74,7 +77,7 @@
def _cleanup( home_dir ):
- """ Remove crud """
+ """ Remove everything from last run """
t_str = _get_time( format='time' )
LOG_BUFFER.append( ' - Cleaning out old files (%s)' % t_str )
if os.path.isfile( LOGFILENAME ):
@@ -107,6 +110,7 @@
def _checkout( home_dir ):
""" Do all checkouts """
+ # Make sure we can log into the anonymous repository
cvspass_line = '%s A' % CVSROOT
cvspass_path = os.path.join( os.environ['HOME'], '.cvspass' )
if not os.path.isfile( cvspass_path ):
@@ -179,24 +183,28 @@
log_file.write( '\n'.join( LOG_BUFFER ) )
log_file.close()
+ # Step through all test combos
for test in TESTS:
zope_tag = test.get( 'zope' )
zope_subdir = 'Zope_%s' % zope_tag
pythons = test.get( 'pythons' )
prods = test.get( 'prods' )
+ # Separate testing trees for every python version
for py_label in pythons:
prods_data = []
py_exe = PYTHONS.get( py_label )
py_dir = os.path.join( home_dir, py_label.replace( ' ', '' ) )
zope_dir = os.path.join( py_dir, zope_subdir )
+ # Link the products into the zope tree
for prod_label, prod_tag in prods.items():
prods_data.append( '%s (%s)' % ( prod_label, prod_tag ) )
prod_info = FROM_CVS.get( prod_label )
wiring_method = globals().get( prod_info.get( 'wiring_method' ) )
apply( wiring_method, ( home_dir, py_dir, zope_dir, prod_label, prod_tag ) )
+ # Log the test run and start it
t_str = _get_time( format='time' )
prod_str = ', '.join( prods_data )
log_file = open( os.path.join( home_dir, LOGFILENAME ), 'a' )
@@ -266,8 +274,8 @@
def main():
""" Run the script """
- msg = '*** Zope unit tests on %s (%s) ***\n\n' % sys.platform
- LOG_BUFFER.append( msg % _get_time() )
+ msg = '*** Zope unit tests on %s (%s) ***\n\n'
+ LOG_BUFFER.append( msg % ( sys.platform, _get_time() ) )
module_path = sys.argv[0]
module_dir, module_filename = os.path.split( module_path )
os.chdir( module_dir )