Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83666

Running non-eggified products against zc.recipe.testrunner

I have some old products which still work fine with Plone 4.1

These products have unit tests run earlier with bin/instance test command. Since the products are old, they are not packaged as eggs, but used thru products buildout directive.

Does zc.recipe.testrunner somehow find these products and is it able to execute their unit tests?

Upvotes: 0

Views: 105

Answers (2)

mitchellrj
mitchellrj

Reputation: 488

If you really, really need to do this, add the following to your testrunner section:

products = ${instance:products}
initialization =
    import OFS.Application
    import Products
    Products.__path__ = getattr(Products, '__path__', []) + \
        [p.strip() for p in """${:products}""".split('\n') if p.strip()]
    OFS.Application.import_products()
    import App.config
    App.config._config = None

This should be considered a last resort and in almost every case, it is preferable to create a proper egg to replace the product.

Upvotes: 1

Giacomo Spettoli
Giacomo Spettoli

Reputation: 4496

No, zc.recipe.testrunner can't run non-eggified products. I think it would take less time to eggify your products rather then trying some alchemic trick.

Upvotes: 3

Related Questions