[Zope3-dev] ZCML, functional testing and buildout

Jim Fulton jim at zope.com
Tue Nov 28 05:29:39 EST 2006


Christian Theune wrote:
> Hi everyone,
> 
> Thomas Lotze and I were working on creating a zc.buildout for one of our
> internal projects.
> 
> The ZCML of our application is loaded using the 'package-includes'
> mechanism.

I think this is a bad idea.  I think for serious development,
package-includes is a bad idea.  For our projects, we *never*
use package-includes.

 > To support functional testing, a 'kita-ftesting.zcml' slug
> was placed in the 'package-includes' and - as far as I can tell - this
> takes care to only load this ZCML when running functional tests.

I have no idea what you are trying to say.

> We're having a problem with the buildout integration at this point, as
> for the testrunner we are using the zc.recipe.testrunner recipe.
> 
> However, the functional testing ZCML is placed in the instance part, but
> the testrunner does not know anything about this (should it?).

You'll need to use the working-directory option in the testrunner recipe to get it
to run from the instance.  The functional test code in zope.app.testing.functional
*assumes* that the current working directory is an instance directory. :(

> Here's the question: what would be a good way to get the test runner
> load the correct ZCML for running tests?

IMO, the package you want to test should define it's own
ftesting.zcml and define a zcml-based test layer based on that.
see zc.sharing as an example.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list