Re: [Zope-dev] SVN: ZODB/trunk/buildout.cfg Changed the generated test script to use a part-local tmp directory

2008-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Fulton wrote:
 Log message for revision 92293:
   Changed the generated test script to use a part-local tmp directory
   that is cleaned up at the start of a test run.
   
   Unfortunately, the ZODB tests leave lots of temporary files behind
   which can cause failures in subsequent test runs and which tend to
   litter /tmp. Eventually, I want to clean that up, but, in the mean
   time, I can limit the damage to the test part directory.
   
 
 Changed:
   U   ZODB/trunk/buildout.cfg
 
 -=-
 Modified: ZODB/trunk/buildout.cfg
 ===
 --- ZODB/trunk/buildout.cfg   2008-10-17 12:46:34 UTC (rev 92292)
 +++ ZODB/trunk/buildout.cfg   2008-10-17 14:02:39 UTC (rev 92293)
 @@ -6,6 +6,11 @@
  [test]
  recipe = zc.recipe.testrunner
  eggs = ZODB3
 +initialization = 
 +  import os, tempfile, shutil
 +  if os.path.exists('tmp'): shutil.rmtree('tmp')
 +  os.mkdir('tmp')
 +  tempfile.tempdir = os.path.abspath('tmp')
  
  [scripts]
  recipe = zc.recipe.egg

Maybe zc.recipe.testrunner could add support for a 'finalization' or
'cleanup' argument which would do the same think as the 'initialization'
(or maybe only if there were no failures?)


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+L+Y+gerLs4ltQ4RAgtjAKClCd+fCX0zjCPZD944HDJ/Tp2ZxwCgmVHM
0IMF4ykSw9OKP0ICgwPCNfg=
=+qlo
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] SVN: ZODB/trunk/buildout.cfg Changed the generated test script to use a part-local tmp directory

2008-10-17 Thread Jim Fulton

On Oct 17, 2008, at 12:38 PM, Tres Seaver wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Jim Fulton wrote:
 Log message for revision 92293:
  Changed the generated test script to use a part-local tmp directory
  that is cleaned up at the start of a test run.

  Unfortunately, the ZODB tests leave lots of temporary files behind
  which can cause failures in subsequent test runs and which tend to
  litter /tmp. Eventually, I want to clean that up, but, in the mean
  time, I can limit the damage to the test part directory.


 Changed:
  U   ZODB/trunk/buildout.cfg

 -=-
 Modified: ZODB/trunk/buildout.cfg
 ===
 --- ZODB/trunk/buildout.cfg  2008-10-17 12:46:34 UTC (rev 92292)
 +++ ZODB/trunk/buildout.cfg  2008-10-17 14:02:39 UTC (rev 92293)
 @@ -6,6 +6,11 @@
 [test]
 recipe = zc.recipe.testrunner
 eggs = ZODB3
 +initialization =
 +  import os, tempfile, shutil
 +  if os.path.exists('tmp'): shutil.rmtree('tmp')
 +  os.mkdir('tmp')
 +  tempfile.tempdir = os.path.abspath('tmp')

 [scripts]
 recipe = zc.recipe.egg

 Maybe zc.recipe.testrunner could add support for a 'finalization' or
 'cleanup' argument which would do the same think as the  
 'initialization'
 (or maybe only if there were no failures?)


Yup.  That would be good. In the mean time ... :)

It would also be good to have some automated way to check for leaving  
temp files behind, much as it now checks for leaving threads behind.

I've got a significant project ahead to fix the ZODB tests to be less  
sloppy about the way they manage files, although this initializer hack  
buys me some time. :)

Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )