[Zope-dev] SVN: ZODB/trunk/buildout.cfg Changed the generated test script to use a part-local tmp directory
Jim Fulton
jim at zope.com
Fri Oct 17 12:43:45 EDT 2008
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
More information about the Zope-Dev
mailing list