Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

Running Tests

From the First-things-first-department

Yesterday was a bit frustrating — I’ve basically spent all day battling my local setup of Zope and trying to get all relevant tests of my review bundle to run — as long as they don’t I needn’t even bother to do any actual work on the plip itself… Apart from plain stupid typo mistakes in my EXTERNALS.txt, general connectivity problems etc.) there is one lesson for me to take home: run tests with zopectl not runalltests.py!

For example, I needed to run the tests of my freshly cut Archetypes branch, which failed:

cd /opt/zope/instances/plip149/zope/Products/Archetypes
python tests/runalltests.py
[...] # lots of output
File "/Data/opt/zope/instances/plip149/zope/Products/CMFPlone/migrations/v3_0/alphas.py", line 2, in ?
ImportError: No module named globalregistry

However, using zopectl test worked just fine. I.e. to run all tests of the Archetypes product:

cd /opt/zope/instances/plip149/zope/
./bin/zopectl test -s Products.Archetypes

The -s parameter selects the package, but you can also additionally use -m to select a specific module, i.e. to just run tests/test_utils.py:

./bin/zopectl test -s Products.Archetypes -m test_utils

Now the tests ran just fine and I can finally get back to work on the actual plip ;-)