[Zope-Coders] Testing from an INSTANCE_HOME

Stefan H. Holek stefan@epy.co.at
Sat, 7 Jun 2003 02:14:27 +0200


The goal of having Testing not touch INSTANCE_HOME can be achieved 
without changing the "interface" of the Testing package (something I am 
not overly happy with, think backward compatibility).

Simply have Testing communicate the directory to Zope.App.startup() by 
other means, say, an environment variable named TESTING_HOME. I have 
tried this already and could provide code.

The custom_zodb.py "hack" is actually something I am quite fond of. ;-)

It allows for great flexibility when writing integration and regression 
tests. I can choose to run my tests against a preconfigured ZODB (and 
even a ZEO server) simply by providing a custom custom_zodb.py. I'd 
rather not lose that capability.

Stefan


On Freitag, Jun 6, 2003, at 19:47 Europe/Vienna, Shane Hathaway wrote:

> I think I just stumbled on the right solution for this.  It's so 
> obvious that I guess I overlooked it!
>
> What if we just decided that unit tests should not use Zope.app() to 
> open a database, but rather a new function called Testing.app()? 
> Testing.app() would return a clean database that unit tests are free 
> to change.  If all unit tests that use Zope.app() start using 
> Testing.app() instead, we won't need the custom_zodb.py hack and the 
> Testing package can leave INSTANCE_HOME alone.
>
> Does anyone see any holes in this plan?  It might even open up some 
> opportunities to speed up test initialization.

--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/