[Plone-testing-team] A tale on dependencies and tests

Héctor Velarde hector.velarde at gmail.com
Fri Oct 2 15:08:19 UTC 2015


first, read this http://bubblenet.be/blog/lets-get-rid-of-z3c.autoinclude

On 02/09/2015 12:31, Asko Soukka wrote:
> Gil Forcada wrote:
>> - - is a good practice to remove <includeDependencies package="." /> ?
>> Any strong reason to keep it?
>
> It's good practice. Don't keep it. Add explicit <include/>s.
>
> z3c.autoinclude provides two features: 1) autoinclude entrypoint for
> includePlugins-directive, 2) includeDependencies -directive. 1) is
> a life saver (removed requirement for explicit zcml-entries in buildout
> 2) is evil (automatically includes meta.zcml, configure.zcml and
> overrides.zcml for all packages in caller's dependency tree).

HV> there is another problem; from plone.app.testing documentation:

When set up, the fixture will:

* Create a configuration context with the disable-autoinclude feature 
set. This has the effect of stopping Plone from automatically loading 
the configuration of any installed package that uses the 
z3c.autoinclude.plugin:plone entry point via z3c.autoinclude. (This is 
to avoid accidentally polluting the test fixture - custom layers should 
load packages’ ZCML configuration explicitly if required).

that means packages will not be initialized on tests and that leads to 
some workarounds that you can easily avoid by declaring the explicit 
inclusion.

>> [2] Ever stumbled upon <five:registerPackage package="."
>> initialize=".initialize" /> ? Seems to be the grandfather of
>> includeDependencies, right?
>
> No. It registers package for legacy initialization (as "Zope 2 style
> product" for products outside Products-namespace), before ZCML was
> invented. Usually just required, if your package includes new
> Archetypes' content types of CMF Tools.

just get rid of the `initialize=".initialize"` part; you will need the 
rest or you package will not be correctly registered as a Zope2 product; 
don't ask me why, I don't know the details.

best regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3713 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.plone.org/pipermail/plone-testing-team/attachments/20151002/02752cc5/attachment.p7s>


More information about the Plone-testing-team mailing list